diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2022-06-15 17:25:04 +0200 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2022-06-28 09:08:29 +0200 |
commit | 700a78335fc28a59c307f420857fd2d4521549f8 (patch) | |
tree | aae5997212a93e654059896b14eb059f23e4173d /block/blk-mq.c | |
parent | c64b551f6a338eb9724a2f9ef3dddf80ccef2894 (diff) | |
download | linux-700a78335fc28a59c307f420857fd2d4521549f8.tar.bz2 |
sched: only perform capability check on privileged operation
sched_setattr(2) issues via kernel/sched/core.c:__sched_setscheduler()
a CAP_SYS_NICE audit event unconditionally, even when the requested
operation does not require that capability / is unprivileged, i.e. for
reducing niceness.
This is relevant in connection with SELinux, where a capability check
results in a policy decision and by default a denial message on
insufficient permission is issued.
It can lead to three undesired cases:
1. A denial message is generated, even in case the operation was an
unprivileged one and thus the syscall succeeded, creating noise.
2. To avoid the noise from 1. the policy writer adds a rule to ignore
those denial messages, hiding future syscalls, where the task
performs an actual privileged operation, leading to hidden limited
functionality of that task.
3. To avoid the noise from 1. the policy writer adds a rule to allow
the task the capability CAP_SYS_NICE, while it does not need it,
violating the principle of least privilege.
Conduct privilged/unprivileged categorization first and perform a
capable test (and at most once) only if needed.
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20220615152505.310488-1-cgzones@googlemail.com
Diffstat (limited to 'block/blk-mq.c')
0 files changed, 0 insertions, 0 deletions