]> git.baikalelectronics.ru Git - kernel.git/commit
ipc: check checkpoint_restore_ns_capable() to modify C/R proc files
authorMichal Clapinski <mclapinski@google.com>
Tue, 9 Nov 2021 02:35:59 +0000 (18:35 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 9 Nov 2021 18:02:53 +0000 (10:02 -0800)
commit41d54e65bc8c211f16dd06b7fbda03f7d71529f0
tree7aa5212a7c84ab3df319c71b15b511204e6a3b4d
parent0f6abf8104bee58a7acf07c43ffcad5e926bd769
ipc: check checkpoint_restore_ns_capable() to modify C/R proc files

This commit removes the requirement to be root to modify sem_next_id,
msg_next_id and shm_next_id and checks checkpoint_restore_ns_capable
instead.

Since those files are specific to the IPC namespace, there is no reason
they should require root privileges.  This is similar to ns_last_pid,
which also only checks checkpoint_restore_ns_capable.

[akpm@linux-foundation.org: ipc/ipc_sysctl.c needs capability.h for checkpoint_restore_ns_capable()]

Link: https://lkml.kernel.org/r/20210916163717.3179496-1-mclapinski@google.com
Signed-off-by: Michal Clapinski <mclapinski@google.com>
Reviewed-by: Davidlohr Bueso <dbueso@suse.de>
Reviewed-by: Manfred Spraul <manfred@colorfullife.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
ipc/ipc_sysctl.c