mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-29 04:50:26 +00:00
memfd: use PROC_SELF instead of getpid in __open_proc
This looks better for me, should be no functional change.
Another implication of this is nested pid namespaces, when we will
support them "__open_proc(getpid()...)" will try to open file of the
process which has the same pid but in NS_ROOT pidns, which is bad.
See also aa2d92082 ("files: use PROC_SELF when a process accesses its
/proc/PID") for a similar change.
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
This commit is contained in:
parent
34024dfdcb
commit
0bb3d85863
1 changed files with 1 additions and 1 deletions
|
|
@ -332,7 +332,7 @@ int memfd_open(struct file_desc *d, u32 *fdflags)
|
|||
* O_LARGEFILE file flag with regular open(). It doesn't seem that
|
||||
* important though.
|
||||
*/
|
||||
_fd = __open_proc(getpid(), 0, flags, "fd/%d", fd);
|
||||
_fd = __open_proc(PROC_SELF, 0, flags, "fd/%d", fd);
|
||||
if (_fd < 0) {
|
||||
pr_perror("Can't reopen memfd id=%d", mfe->id);
|
||||
goto err;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue