linux/ipc
Ondrej Mosnacek 8924336531 ipc: don't audit capability check in ipc_permissions()
The IPC sysctls implement the ctl_table_root::permissions hook and they
override the file access mode based on the CAP_CHECKPOINT_RESTORE
capability, which is being checked regardless of whether any access is
actually denied or not, so if an LSM denies the capability, an audit
record may be logged even when access is in fact granted.

It wouldn't be viable to restructure the sysctl permission logic to only
check the capability when the access would be actually denied if it's not
granted.  Thus, do the same as in net_ctl_permissions() (net/sysctl_net.c)
- switch from ns_capable() to ns_capable_noaudit(), so that the check
never emits an audit record.

Link: https://lkml.kernel.org/r/20260122141303.241133-1-omosnace@redhat.com
Fixes: 0889f44e28 ("ipc: Check permissions for checkpoint_restart sysctls at open time")
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Acked-by: Alexey Gladkov <legion@kernel.org>
Acked-by: Serge Hallyn <serge@hallyn.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Paul Moore <paul@paul-moore.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2026-01-31 16:16:07 -08:00
..
compat.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ipc_sysctl.c ipc: don't audit capability check in ipc_permissions() 2026-01-31 16:16:07 -08:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mq_sysctl.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
mqueue.c vfs-6.19-rc1.fixes 2025-12-05 15:52:30 -08:00
msg.c ipc/msg: replace one-element array with flexible array member 2024-11-05 17:12:28 -08:00
msgutil.c ns: drop custom reference count initialization for initial namespaces 2025-11-11 10:01:32 +01:00
namespace.c Significant patch series in this pull request: 2025-12-06 14:01:20 -08:00
sem.c copy_process: pass clone_flags as u64 across calltree 2025-09-01 15:31:34 +02:00
shm.c ipc: support ns lookup 2025-09-19 14:26:15 +02:00
syscall.c y2038: remove CONFIG_64BIT_TIME 2019-11-15 14:38:27 +01:00
util.c ipc/util.c: complete the kernel-doc function descriptions 2025-01-24 22:47:27 -08:00
util.h sched.h: move pid helpers to pid.h 2023-12-20 19:26:31 -05:00