17 #include <linux/kernel.h>
18 #include <linux/sched.h>
22 #include <linux/signal.h>
23 #include <linux/resource.h>
26 #include <linux/sem.h>
27 #include <linux/msg.h>
28 #include <linux/shm.h>
29 #include <linux/uio.h>
30 #include <linux/quota.h>
31 #include <linux/module.h>
32 #include <linux/poll.h>
33 #include <linux/personality.h>
34 #include <linux/stat.h>
35 #include <linux/filter.h>
38 #include <linux/mman.h>
39 #include <linux/ipv6.h>
41 #include <linux/icmpv6.h>
43 #include <linux/sysctl.h>
44 #include <linux/binfmts.h>
45 #include <linux/capability.h>
48 #include <linux/ptrace.h>
50 #include <linux/ipc.h>
51 #include <linux/slab.h>
53 #include <asm/types.h>
54 #include <asm/uaccess.h>
75 #undef SET_OLDSTAT_UID
76 #undef SET_OLDSTAT_GID
80 #define high2lowuid(uid) ((uid) > 65535) ? (u16)overflowuid : (u16)(uid)
81 #define high2lowgid(gid) ((gid) > 65535) ? (u16)overflowgid : (u16)(gid)
82 #define low2highuid(uid) ((uid) == (u16)-1) ? (uid_t)-1 : (uid_t)(uid)
83 #define low2highgid(gid) ((gid) == (u16)-1) ? (gid_t)-1 : (gid_t)(gid)
84 #define SET_UID16(var, uid) var = high2lowuid(uid)
85 #define SET_GID16(var, gid) var = high2lowgid(gid)
86 #define NEW_TO_OLD_UID(uid) high2lowuid(uid)
87 #define NEW_TO_OLD_GID(gid) high2lowgid(gid)
88 #define SET_OLDSTAT_UID(stat, uid) (stat).st_uid = high2lowuid(uid)
89 #define SET_OLDSTAT_GID(stat, gid) (stat).st_gid = high2lowgid(gid)
90 #define SET_STAT_UID(stat, uid) (stat).st_uid = high2lowuid(uid)
91 #define SET_STAT_GID(stat, gid) (stat).st_gid = high2lowgid(gid)
144 if (!(retval =
put_user(ruid, ruidp)) &&
167 if (!(retval =
put_user(rgid, rgidp)) &&
191 for (i = 0; i < group_info->
ngroups; i++) {
201 static int groups16_from_user(
struct group_info *group_info,
u16 __user *grouplist)
208 for (i = 0; i < group_info->
ngroups; i++) {
213 if (!gid_valid(kgid))
229 get_group_info(
current->cred->group_info);
230 i =
current->cred->group_info->ngroups;
232 if (i > gidsetsize) {
236 if (groups16_to_user(grouplist,
current->cred->group_info)) {
248 struct group_info *group_info;
259 retval = groups16_from_user(group_info, grouplist);
296 #ifdef CONFIG_SYSVIPC
304 second, compat_ptr(third));
330 return sys_shmget(first, (
unsigned)second, third);
372 compat_sigset_t __user *oset,
size_t sigsetsize)
382 s.
sig[0] = s32.sig[0] | (((
long)s32.sig[1]) << 32);
392 s32.sig[1] = (s.
sig[0] >> 32);
393 s32.sig[0] = s.
sig[0];
412 s32.sig[1] = (s.
sig[0] >> 32);
413 s32.sig[0] = s.
sig[0];
440 return sys_pread64(fd, ubuf, count, ((loff_t)
AA(poshi) << 32) |
AA(poslo));
448 return sys_pwrite64(fd, ubuf, count, ((loff_t)
AA(poshi) << 32) |
AA(poslo));
483 if (offset &&
get_user(lof, offset))
492 if (offset &&
put_user(lof, offset))
501 #define STAT64_HAS_BROKEN_ST_INO 1
527 memset(&tmp, 0,
sizeof(tmp));
552 ret = cp_stat64(statbuf, &stat);
561 ret = cp_stat64(statbuf, &stat);
570 ret = cp_stat64(statbuf, &stat);
583 return cp_stat64(statbuf, &stat);
649 else if (advise == 5)