Re: [Qemu-devel] [PATCH v2] linux-user: fix is_proc_myself to check the paths via realpath

2017-11-10 Thread Zach Riggle
I wrote up a quick example to show that this should work specifically for /proc/self/exe: #define _GNU_SOURCE #include #include #include #include int main(int argc, char** argv) { int fd = open("/proc/self/exe", O_NOFOLLOW | O_PATH); system("ls -la /proc/$PPID/fd/"

Re: [Qemu-devel] [PATCH v2] linux-user: fix is_proc_myself to check the paths via realpath

2017-11-10 Thread Zach Riggle
in the process of link resolution via the readlink() loop, we end up with the same path as our candidate, we can return true. This avoids the need to rely on any libc implementation of realpath(), since we're just relying on the host kernel. *Zach Riggle* On Fri, Nov 10, 2017 at 5:44 PM, L

Re: [Qemu-devel] [PATCH v2] linux-user: fix is_proc_myself to check the paths via realpath

2017-11-10 Thread Zach Riggle
Day 17 Ping :) *Zach Riggle* On Tue, Nov 7, 2017 at 2:06 PM, Riku Voipio wrote: > Hi, > > On Mon, Nov 06, 2017 at 08:17:44PM +0000, Zach Riggle wrote: > > Ping! What needs to be done to move this forward? My current > implementation > > is compatible with musl. &g

Re: [Qemu-devel] [PATCH v2] linux-user: fix is_proc_myself to check the paths via realpath

2017-11-06 Thread Zach Riggle
Ping! What needs to be done to move this forward? My current implementation is compatible with musl. On Thu, Nov 2, 2017 at 12:36 PM Peter Maydell wrote: > On 28 October 2017 at 06:14, Eric Blake wrote: > > By definition, in linux-user, we ARE using glibc; therefore, you are > > free to use all

Re: [Qemu-devel] [PATCH v2] linux-user: fix is_proc_myself to check the paths via realpath

2017-11-02 Thread Zach Riggle
Ping. What changes do I need to make to land this? On Sat, Oct 28, 2017 at 12:49 AM Eric Blake wrote: > On 10/27/2017 09:07 PM, Zach Riggle wrote: > > Another case that may be more relevant for general QEMU use, is that the > > current code fails if the software under test has poo

Re: [Qemu-devel] [PATCH v2] linux-user: fix is_proc_myself to check the paths via realpath

2017-10-27 Thread Zach Riggle
canonicalization issues and could be resolved with e.g. canonicalize_file_name, but I'm not sure if QEMU allows GNU extensions -- and realpath() is portable. *Zach Riggle* On Fri, Oct 27, 2017 at 12:05 PM, Zach Riggle wrote: > The symlink was just an easy test case. Doing cd pro

Re: [Qemu-devel] [PATCH v2] linux-user: fix is_proc_myself to check the paths via realpath

2017-10-27 Thread Zach Riggle
ly, this will return the memory layout of QEMU, not the emulated memory layout of the software under test. *Zach Riggle* On Fri, Oct 27, 2017 at 4:36 AM, Riku Voipio wrote: > On Thu, Oct 26, 2017 at 04:06:22PM -0500, Zach Riggle wrote: > > Friendly ping :) > > > > I'

Re: [Qemu-devel] [PATCH v2] linux-user: fix is_proc_myself to check the paths via realpath

2017-10-26 Thread Zach Riggle
Friendly ping :) I've updated the patch with v2 which addresses the style issue *Zach Riggle* On Tue, Oct 24, 2017 at 10:34 PM, Zach Riggle wrote: > Previously, it was possible to get a handle to the "real" /proc/self/mem > by creating a symlink to it and opening the sy

[Qemu-devel] [PATCH v2] linux-user: fix is_proc_myself to check the paths via realpath

2017-10-24 Thread Zach Riggle
602bc000 r-xp fc:01 270375 /usr/bin/qemu-arm-static 604bc000-6050f000 rw-p 002bc000 fc:01 270375 /usr/bin/qemu-arm-static ... Signed-off-by: Zach Riggle --- linux-user/syscall.c | 47 --- 1

[Qemu-devel] [PATCH] linux-user: fix is_proc_myself to check the paths via realpath

2017-10-24 Thread Zach Riggle
From: Zach Riggle Previously, it was possible to get a handle to the "real" /proc/self/mem by creating a symlink to it and opening the symlink, or opening e.g. "./mem" after chdir'ing to "/proc/self". $ ln -s /proc/self self $ cat self/maps 60