12 #include <linux/module.h>
13 #include <linux/signal.h>
14 #include <linux/capability.h>
15 #include <linux/errno.h>
16 #include <linux/sched.h>
18 #include <linux/kernel.h>
19 #include <linux/stat.h>
20 #include <linux/socket.h>
22 #include <linux/fcntl.h>
23 #include <linux/net.h>
25 #include <linux/netdevice.h>
29 #include <linux/slab.h>
31 #include <asm/uaccess.h>
51 if (!uid_valid(uid) || !gid_valid(gid))
55 ((uid_eq(uid, cred->
uid) || uid_eq(uid, cred->
euid) ||
57 ((gid_eq(gid, cred->
gid) || gid_eq(gid, cred->
egid) ||
97 for (i=0; i< num; i++)
102 if (fd < 0 || !(file =
fget_raw(fd)))
117 for (i=fpl->
count-1; i>=0; i--)
152 err=scm_fp_copy(cmsg, &p->
fp);
164 err = scm_check_creds(&creds);
182 if (!uid_valid(uid) || !gid_valid(gid))
189 !uid_eq(p->
cred->euid, uid) ||
190 !gid_eq(p->
cred->egid, gid)) {
210 if (p->
fp && !p->
fp->count)
242 cmhdr.cmsg_level =
level;
243 cmhdr.cmsg_type =
type;
244 cmhdr.cmsg_len = cmlen;
268 int fdnum = scm->
fp->count;
269 struct file **
fp = scm->
fp->fp;
312 int cmlen =
CMSG_LEN(i*
sizeof(
int));
324 if (i < fdnum || (fdnum && fdmax <= 0))
346 for (i = 0; i < fpl->
count; i++)
347 get_file(fpl->
fp[i]);