Re: [PATCH v2] linux-user: Use memfd for open syscall emulation

2022-07-29 Thread Richard Henderson
On 7/29/22 14:19, Rainer Müller wrote: On 29/07/2022 18.01, Richard Henderson wrote: On 7/29/22 08:49, Rainer Müller wrote: +    /* create temporary file to map stat to */ +    tmpdir = getenv("TMPDIR"); +    if (!tmpdir) +    tmpdir = "/tmp"; +    sn

Re: [PATCH v2] linux-user: Use memfd for open syscall emulation

2022-07-29 Thread Rainer Müller
On 29/07/2022 18.01, Richard Henderson wrote: > On 7/29/22 08:49, Rainer Müller wrote: >> +    /* create temporary file to map stat to */ >> +    tmpdir = getenv("TMPDIR"); >> +    if (!tmpdir) >> +    tmpdir = "/tmp"; >> +    snprintf(filename, sizeof(fi

Re: [PATCH v2] linux-user: Use memfd for open syscall emulation

2022-07-29 Thread Richard Henderson
On 7/29/22 08:49, Rainer Müller wrote: +/* create temporary file to map stat to */ +tmpdir = getenv("TMPDIR"); +if (!tmpdir) +tmpdir = "/tmp"; +snprintf(filename, sizeof(filename), "%s/qemu-open.XX", tmpdir); +fd = m

[PATCH v2] linux-user: Use memfd for open syscall emulation

2022-07-29 Thread Rainer Müller
For certain paths in /proc, the open syscall is intercepted and the returned file descriptor points to a temporary file with emulated contents. If TMPDIR is not accessible or writable for the current user (for example in a read-only mounted chroot or container) tools such as ps from procps may fai