mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
security: Add LSM hook to setgroups() syscall
Give the LSM framework the ability to filter setgroups() syscalls. There are already analagous hooks for the set*uid() and set*gid() syscalls. The SafeSetID LSM will use this new hook to ensure setgroups() calls are allowed by the installed security policy. Tested by putting print statement in security_task_fix_setgroups() hook and confirming that it gets hit when userspace does a setgroups() syscall. Acked-by: Casey Schaufler <casey@schaufler-ca.com> Reviewed-by: Serge Hallyn <serge@hallyn.com> Signed-off-by: Micah Morton <mortonm@chromium.org>
This commit is contained in:
@@ -415,6 +415,7 @@ int security_task_fix_setuid(struct cred *new, const struct cred *old,
|
||||
int flags);
|
||||
int security_task_fix_setgid(struct cred *new, const struct cred *old,
|
||||
int flags);
|
||||
int security_task_fix_setgroups(struct cred *new, const struct cred *old);
|
||||
int security_task_setpgid(struct task_struct *p, pid_t pgid);
|
||||
int security_task_getpgid(struct task_struct *p);
|
||||
int security_task_getsid(struct task_struct *p);
|
||||
@@ -1098,6 +1099,12 @@ static inline int security_task_fix_setgid(struct cred *new,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int security_task_fix_setgroups(struct cred *new,
|
||||
const struct cred *old)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int security_task_setpgid(struct task_struct *p, pid_t pgid)
|
||||
{
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user