Files
Centos-kernel-stream-9/ipc
Ondrej Mosnacek bff6ed3548 ipc: don't audit capability check in ipc_permissions()
JIRA: https://issues.redhat.com/browse/RHEL-135610

commit 071588136007482d70fd2667b827036bc60b1f8f
Author: Ondrej Mosnacek <omosnace@redhat.com>
Date:   Thu Jan 22 15:13:03 2026 +0100

    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.

    Fixes: 0889f44e2810 ("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>
    Signed-off-by: Serge Hallyn <sergeh@kernel.org>

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2026-03-12 09:18:07 +01:00
..