]> git.baikalelectronics.ru Git - kernel.git/commit
copy_process(): don't use ksys_close() on cleanups
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 27 Jun 2019 02:22:09 +0000 (22:22 -0400)
committerChristian Brauner <christian@brauner.io>
Thu, 27 Jun 2019 10:24:03 +0000 (12:24 +0200)
commit9506a95c5a8d1c093c8b6af13eb321730541d051
tree10373d534062579195279de454be72ad7c562147
parent85d14e75dfb41a0318884f8cbd612cd96ee0a836
copy_process(): don't use ksys_close() on cleanups

anon_inode_getfd() should be used *ONLY* in situations when we are
guaranteed to be past the last failure point (including copying the
descriptor number to userland, at that).  And ksys_close() should
not be used for cleanups at all.

anon_inode_getfile() is there for all nontrivial cases like that.
Just use that...

Fixes: 2cde90b917e3 ("clone: add CLONE_PIDFD")
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Reviewed-by: Jann Horn <jannh@google.com>
Signed-off-by: Christian Brauner <christian@brauner.io>
kernel/fork.c