Commit 9612fb29 authored by Anton Blanchard's avatar Anton Blanchard

Merge samba.org:/scratch/anton/export_compile

into samba.org:/scratch/anton/export
parents cd36ee21 033fbd9f
...@@ -1243,16 +1243,19 @@ asmlinkage long sys32_settimeofday(struct compat_timeval *tv, struct timezone *t ...@@ -1243,16 +1243,19 @@ asmlinkage long sys32_settimeofday(struct compat_timeval *tv, struct timezone *t
} }
struct msgbuf32 { s32 mtype; char mtext[1]; }; struct msgbuf32 {
compat_long_t mtype;
char mtext[1];
};
struct semid_ds32 { struct semid_ds32 {
struct ipc_perm sem_perm; struct ipc_perm sem_perm;
compat_time_t sem_otime; compat_time_t sem_otime;
compat_time_t sem_ctime; compat_time_t sem_ctime;
u32 sem_base; compat_uptr_t sem_base;
u32 sem_pending; compat_uptr_t sem_pending;
u32 sem_pending_last; compat_uptr_t sem_pending_last;
u32 undo; compat_uptr_t undo;
unsigned short sem_nsems; unsigned short sem_nsems;
}; };
...@@ -1262,21 +1265,20 @@ struct semid64_ds32 { ...@@ -1262,21 +1265,20 @@ struct semid64_ds32 {
compat_time_t sem_otime; compat_time_t sem_otime;
unsigned int __unused2; unsigned int __unused2;
compat_time_t sem_ctime; compat_time_t sem_ctime;
u32 sem_nsems; compat_ulong_t sem_nsems;
u32 __unused3; compat_ulong_t __unused3;
u32 __unused4; compat_ulong_t __unused4;
}; };
struct msqid_ds32 struct msqid_ds32 {
{
struct ipc_perm msg_perm; struct ipc_perm msg_perm;
u32 msg_first; compat_uptr_t msg_first;
u32 msg_last; compat_uptr_t msg_last;
compat_time_t msg_stime; compat_time_t msg_stime;
compat_time_t msg_rtime; compat_time_t msg_rtime;
compat_time_t msg_ctime; compat_time_t msg_ctime;
u32 msg_lcbytes; compat_ulong_t msg_lcbytes;
u32 msg_lqbytes; compat_ulong_t msg_lqbytes;
unsigned short msg_cbytes; unsigned short msg_cbytes;
unsigned short msg_qnum; unsigned short msg_qnum;
unsigned short msg_qbytes; unsigned short msg_qbytes;
...@@ -1292,13 +1294,13 @@ struct msqid64_ds32 { ...@@ -1292,13 +1294,13 @@ struct msqid64_ds32 {
compat_time_t msg_rtime; compat_time_t msg_rtime;
unsigned int __unused3; unsigned int __unused3;
compat_time_t msg_ctime; compat_time_t msg_ctime;
unsigned int msg_cbytes; compat_ulong_t msg_cbytes;
unsigned int msg_qnum; compat_ulong_t msg_qnum;
unsigned int msg_qbytes; compat_ulong_t msg_qbytes;
compat_pid_t msg_lspid; compat_pid_t msg_lspid;
compat_pid_t msg_lrpid; compat_pid_t msg_lrpid;
unsigned int __unused4; compat_ulong_t __unused4;
unsigned int __unused5; compat_ulong_t __unused5;
}; };
struct shmid_ds32 { struct shmid_ds32 {
...@@ -1311,8 +1313,8 @@ struct shmid_ds32 { ...@@ -1311,8 +1313,8 @@ struct shmid_ds32 {
compat_ipc_pid_t shm_lpid; compat_ipc_pid_t shm_lpid;
unsigned short shm_nattch; unsigned short shm_nattch;
unsigned short __unused; unsigned short __unused;
unsigned int __unused2; compat_uptr_t __unused2;
unsigned int __unused3; compat_uptr_t __unused3;
}; };
struct shmid64_ds32 { struct shmid64_ds32 {
...@@ -1327,9 +1329,9 @@ struct shmid64_ds32 { ...@@ -1327,9 +1329,9 @@ struct shmid64_ds32 {
compat_size_t shm_segsz; compat_size_t shm_segsz;
compat_pid_t shm_cpid; compat_pid_t shm_cpid;
compat_pid_t shm_lpid; compat_pid_t shm_lpid;
unsigned int shm_nattch; compat_ulong_t shm_nattch;
unsigned int __unused5; compat_ulong_t __unused5;
unsigned int __unused6; compat_ulong_t __unused6;
}; };
/* /*
...@@ -1350,7 +1352,7 @@ static long do_sys32_semctl(int first, int second, int third, void *uptr) ...@@ -1350,7 +1352,7 @@ static long do_sys32_semctl(int first, int second, int third, void *uptr)
err = -EFAULT; err = -EFAULT;
if (get_user(pad, (u32 *)uptr)) if (get_user(pad, (u32 *)uptr))
return err; return err;
if (third == SETVAL) if ((third & ~IPC_64) == SETVAL)
fourth.val = (int)pad; fourth.val = (int)pad;
else else
fourth.__pad = (void *)A(pad); fourth.__pad = (void *)A(pad);
......
/* /*
* linux/arch/ppc/kernel/sys_ppc.c * linux/arch/ppc64/kernel/sys_ppc.c
* *
* PowerPC version * PowerPC version
* Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/ipc.h> #include <asm/ipc.h>
#include <asm/semaphore.h> #include <asm/semaphore.h>
#include <asm/ppcdebug.h>
#include <asm/time.h> #include <asm/time.h>
extern unsigned long wall_jiffies; extern unsigned long wall_jiffies;
...@@ -79,6 +78,7 @@ sys_ipc (uint call, int first, int second, long third, void *ptr, long fifth) ...@@ -79,6 +78,7 @@ sys_ipc (uint call, int first, int second, long third, void *ptr, long fifth)
case SEMCTL: { case SEMCTL: {
union semun fourth; union semun fourth;
ret = -EINVAL;
if (!ptr) if (!ptr)
break; break;
if ((ret = get_user(fourth.__pad, (void **)ptr))) if ((ret = get_user(fourth.__pad, (void **)ptr)))
...@@ -94,6 +94,7 @@ sys_ipc (uint call, int first, int second, long third, void *ptr, long fifth) ...@@ -94,6 +94,7 @@ sys_ipc (uint call, int first, int second, long third, void *ptr, long fifth)
case 0: { case 0: {
struct ipc_kludge tmp; struct ipc_kludge tmp;
ret = -EINVAL;
if (!ptr) if (!ptr)
break; break;
if ((ret = copy_from_user(&tmp, if ((ret = copy_from_user(&tmp,
...@@ -127,6 +128,7 @@ sys_ipc (uint call, int first, int second, long third, void *ptr, long fifth) ...@@ -127,6 +128,7 @@ sys_ipc (uint call, int first, int second, long third, void *ptr, long fifth)
break; break;
} }
case 1: /* iBCS2 emulator entry point */ case 1: /* iBCS2 emulator entry point */
ret = -EINVAL;
if (!segment_eq(get_fs(), get_ds())) if (!segment_eq(get_fs(), get_ds()))
break; break;
ret = sys_shmat (first, (char *) ptr, second, ret = sys_shmat (first, (char *) ptr, second,
......
...@@ -132,6 +132,7 @@ extern long __put_user_bad(void); ...@@ -132,6 +132,7 @@ extern long __put_user_bad(void);
#define __put_user_size(x,ptr,size,retval,errret) \ #define __put_user_size(x,ptr,size,retval,errret) \
do { \ do { \
might_sleep(); \
retval = 0; \ retval = 0; \
switch (size) { \ switch (size) { \
case 1: __put_user_asm(x,ptr,retval,"stb",errret); break; \ case 1: __put_user_asm(x,ptr,retval,"stb",errret); break; \
...@@ -185,6 +186,7 @@ extern long __get_user_bad(void); ...@@ -185,6 +186,7 @@ extern long __get_user_bad(void);
#define __get_user_size(x,ptr,size,retval,errret) \ #define __get_user_size(x,ptr,size,retval,errret) \
do { \ do { \
might_sleep(); \
retval = 0; \ retval = 0; \
switch (size) { \ switch (size) { \
case 1: __get_user_asm(x,ptr,retval,"lbz",errret); break; \ case 1: __get_user_asm(x,ptr,retval,"lbz",errret); break; \
...@@ -220,6 +222,7 @@ extern unsigned long __copy_tofrom_user(void *to, const void *from, ...@@ -220,6 +222,7 @@ extern unsigned long __copy_tofrom_user(void *to, const void *from,
static inline unsigned long static inline unsigned long
__copy_from_user(void *to, const void __user *from, unsigned long n) __copy_from_user(void *to, const void __user *from, unsigned long n)
{ {
might_sleep();
if (__builtin_constant_p(n)) { if (__builtin_constant_p(n)) {
unsigned long ret; unsigned long ret;
...@@ -244,6 +247,7 @@ __copy_from_user(void *to, const void __user *from, unsigned long n) ...@@ -244,6 +247,7 @@ __copy_from_user(void *to, const void __user *from, unsigned long n)
static inline unsigned long static inline unsigned long
__copy_to_user(void __user *to, const void *from, unsigned long n) __copy_to_user(void __user *to, const void *from, unsigned long n)
{ {
might_sleep();
if (__builtin_constant_p(n)) { if (__builtin_constant_p(n)) {
unsigned long ret; unsigned long ret;
...@@ -289,6 +293,7 @@ copy_to_user(void *to, const void *from, unsigned long n) ...@@ -289,6 +293,7 @@ copy_to_user(void *to, const void *from, unsigned long n)
static inline unsigned long static inline unsigned long
copy_in_user(void *to, const void *from, unsigned long n) copy_in_user(void *to, const void *from, unsigned long n)
{ {
might_sleep();
if (likely(access_ok(VERIFY_READ, from, n) && if (likely(access_ok(VERIFY_READ, from, n) &&
access_ok(VERIFY_WRITE, to, n))) access_ok(VERIFY_WRITE, to, n)))
n =__copy_tofrom_user(to, from, n); n =__copy_tofrom_user(to, from, n);
...@@ -300,6 +305,7 @@ extern unsigned long __clear_user(void *addr, unsigned long size); ...@@ -300,6 +305,7 @@ extern unsigned long __clear_user(void *addr, unsigned long size);
static inline unsigned long static inline unsigned long
clear_user(void *addr, unsigned long size) clear_user(void *addr, unsigned long size)
{ {
might_sleep();
if (likely(access_ok(VERIFY_WRITE, addr, size))) if (likely(access_ok(VERIFY_WRITE, addr, size)))
size = __clear_user(addr, size); size = __clear_user(addr, size);
return size; return size;
...@@ -310,6 +316,7 @@ extern int __strncpy_from_user(char *dst, const char *src, long count); ...@@ -310,6 +316,7 @@ extern int __strncpy_from_user(char *dst, const char *src, long count);
static inline long static inline long
strncpy_from_user(char *dst, const char *src, long count) strncpy_from_user(char *dst, const char *src, long count)
{ {
might_sleep();
if (likely(access_ok(VERIFY_READ, src, 1))) if (likely(access_ok(VERIFY_READ, src, 1)))
return __strncpy_from_user(dst, src, count); return __strncpy_from_user(dst, src, count);
return -EFAULT; return -EFAULT;
...@@ -329,6 +336,7 @@ extern int __strnlen_user(const char *str, long len); ...@@ -329,6 +336,7 @@ extern int __strnlen_user(const char *str, long len);
*/ */
static inline int strnlen_user(const char *str, long len) static inline int strnlen_user(const char *str, long len)
{ {
might_sleep();
if (likely(access_ok(VERIFY_READ, str, 1))) if (likely(access_ok(VERIFY_READ, str, 1)))
return __strnlen_user(str, len); return __strnlen_user(str, len);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment