]> git.baikalelectronics.ru Git - kernel.git/commit
kernel/pid.c: implement additional checks upon pidfd_create() parameters
authorMatthew Bobrowski <repnop@google.com>
Sun, 8 Aug 2021 05:25:05 +0000 (15:25 +1000)
committerJan Kara <jack@suse.cz>
Tue, 10 Aug 2021 10:53:07 +0000 (12:53 +0200)
commite063f367eb96e26866d63efe9807e619890ac333
tree3e8d42bb78fb4849c495567b04c70516a6cb8b7f
parent63186f5b2810d0f4a84bf3f37f212b5d9c020f54
kernel/pid.c: implement additional checks upon pidfd_create() parameters

By adding the pidfd_create() declaration to linux/pid.h, we
effectively expose this function to the rest of the kernel. In order
to avoid any unintended behavior, or set false expectations upon this
function, ensure that constraints are forced upon each of the passed
parameters. This includes the checking of whether the passed struct
pid is a thread-group leader as pidfd creation is currently limited to
such pid types.

Link: https://lore.kernel.org/r/2e9b91c2d529d52a003b8b86c45f866153be9eb5.1628398044.git.repnop@google.com
Signed-off-by: Matthew Bobrowski <repnop@google.com>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Jan Kara <jack@suse.cz>
kernel/pid.c