groups.c (f9cd49033b349b8be3bb1f01b39eed837853d880) | groups.c (c7b96acf1456ef127fef461fcfedb54b81fecfbb) |
---|---|
1/* 2 * Supplementary group IDs 3 */ 4#include <linux/cred.h> 5#include <linux/export.h> 6#include <linux/slab.h> 7#include <linux/security.h> 8#include <linux/syscalls.h> --- 219 unchanged lines hidden (view full) --- 228 * without another task interfering. 229 */ 230 231SYSCALL_DEFINE2(setgroups, int, gidsetsize, gid_t __user *, grouplist) 232{ 233 struct group_info *group_info; 234 int retval; 235 | 1/* 2 * Supplementary group IDs 3 */ 4#include <linux/cred.h> 5#include <linux/export.h> 6#include <linux/slab.h> 7#include <linux/security.h> 8#include <linux/syscalls.h> --- 219 unchanged lines hidden (view full) --- 228 * without another task interfering. 229 */ 230 231SYSCALL_DEFINE2(setgroups, int, gidsetsize, gid_t __user *, grouplist) 232{ 233 struct group_info *group_info; 234 int retval; 235 |
236 if (!nsown_capable(CAP_SETGID)) | 236 if (!ns_capable(current_user_ns(), CAP_SETGID)) |
237 return -EPERM; 238 if ((unsigned)gidsetsize > NGROUPS_MAX) 239 return -EINVAL; 240 241 group_info = groups_alloc(gidsetsize); 242 if (!group_info) 243 return -ENOMEM; 244 retval = groups_from_user(group_info, grouplist); --- 37 unchanged lines hidden --- | 237 return -EPERM; 238 if ((unsigned)gidsetsize > NGROUPS_MAX) 239 return -EINVAL; 240 241 group_info = groups_alloc(gidsetsize); 242 if (!group_info) 243 return -ENOMEM; 244 retval = groups_from_user(group_info, grouplist); --- 37 unchanged lines hidden --- |