aboutsummaryrefslogtreecommitdiffstats
path: root/security/security.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-08-02 15:12:13 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2022-08-02 15:12:13 -0700
commit87fe1adb66a514fa3abbe8bdb4278a5b2f421d8b (patch)
tree7ccabb83cbf8b72b05aaadc19286f5a01545fecb /security/security.c
parentea7099d5229c0fe9f9302b03a246e15e78b87011 (diff)
parent64b634830c919979de4b18163e15d30df66e64a8 (diff)
downloadlinux-87fe1adb66a514fa3abbe8bdb4278a5b2f421d8b.tar.gz
Merge tag 'safesetid-6.0' of https://github.com/micah-morton/linux
Pull SafeSetID updates from Micah Morton: "This contains one commit that touches common kernel code, one that adds functionality internal to the SafeSetID LSM code, and a few other commits that only modify the SafeSetID LSM selftest. The commit that touches common kernel code simply adds an LSM hook in the setgroups() syscall that mirrors what is done for the existing LSM hooks in the setuid() and setgid() syscalls. This commit combined with the SafeSetID-specific one allow the LSM to filter setgroups() calls according to configured rule sets in the same way that is already done for setuid() and setgid()" * tag 'safesetid-6.0' of https://github.com/micah-morton/linux: LSM: SafeSetID: add setgroups() testing to selftest LSM: SafeSetID: Add setgroups() security policy handling security: Add LSM hook to setgroups() syscall LSM: SafeSetID: add GID testing to selftest LSM: SafeSetID: selftest cleanup and prepare for GIDs LSM: SafeSetID: fix userns bug in selftest
Diffstat (limited to 'security/security.c')
-rw-r--r--security/security.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/security/security.c b/security/security.c
index f85afb02ea1c2..14d30fec8a003 100644
--- a/security/security.c
+++ b/security/security.c
@@ -1804,6 +1804,11 @@ int security_task_fix_setgid(struct cred *new, const struct cred *old,
return call_int_hook(task_fix_setgid, 0, new, old, flags);
}
+int security_task_fix_setgroups(struct cred *new, const struct cred *old)
+{
+ return call_int_hook(task_fix_setgroups, 0, new, old);
+}
+
int security_task_setpgid(struct task_struct *p, pid_t pgid)
{
return call_int_hook(task_setpgid, 0, p, pgid);