git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
ipc
/
compat.c
diff --git
a/ipc/compat.c
b/ipc/compat.c
index
4d20cfd
..
fa18141
100644
(file)
--- a/
ipc/compat.c
+++ b/
ipc/compat.c
@@
-115,7
+115,6
@@
struct compat_shm_info {
extern int sem_ctls[];
#define sc_semopm (sem_ctls[2])
extern int sem_ctls[];
#define sc_semopm (sem_ctls[2])
-#define MAXBUF (64*1024)
static inline int compat_ipc_parse_version(int *cmd)
{
static inline int compat_ipc_parse_version(int *cmd)
{
@@
-307,35
+306,30
@@
long compat_sys_semctl(int first, int second, int third, void __user *uptr)
long compat_sys_msgsnd(int first, int second, int third, void __user *uptr)
{
long compat_sys_msgsnd(int first, int second, int third, void __user *uptr)
{
- struct msgbuf __user *p;
struct compat_msgbuf __user *up = uptr;
long type;
if (first < 0)
return -EINVAL;
struct compat_msgbuf __user *up = uptr;
long type;
if (first < 0)
return -EINVAL;
- if (second < 0
|| (second >= MAXBUF - sizeof(struct msgbuf))
)
+ if (second < 0)
return -EINVAL;
return -EINVAL;
- p = compat_alloc_user_space(second + sizeof(struct msgbuf));
- if (get_user(type, &up->mtype) ||
- put_user(type, &p->mtype) ||
- copy_in_user(p->mtext, up->mtext, second))
+ if (get_user(type, &up->mtype))
return -EFAULT;
return -EFAULT;
- return
sys_msgsnd(first, p
, second, third);
+ return
do_msgsnd(first, type, up->mtext
, second, third);
}
long compat_sys_msgrcv(int first, int second, int msgtyp, int third,
int version, void __user *uptr)
{
}
long compat_sys_msgrcv(int first, int second, int msgtyp, int third,
int version, void __user *uptr)
{
- struct msgbuf __user *p;
struct compat_msgbuf __user *up;
long type;
int err;
if (first < 0)
return -EINVAL;
struct compat_msgbuf __user *up;
long type;
int err;
if (first < 0)
return -EINVAL;
- if (second < 0
|| (second >= MAXBUF - sizeof(struct msgbuf))
)
+ if (second < 0)
return -EINVAL;
if (!version) {
return -EINVAL;
if (!version) {
@@
-349,14
+343,11
@@
long compat_sys_msgrcv(int first, int second, int msgtyp, int third,
uptr = compat_ptr(ipck.msgp);
msgtyp = ipck.msgtyp;
}
uptr = compat_ptr(ipck.msgp);
msgtyp = ipck.msgtyp;
}
-
p = compat_alloc_user_space(second + sizeof(struct msgbuf))
;
- err =
sys_msgrcv(first, p
, second, msgtyp, third);
+
up = uptr
;
+ err =
do_msgrcv(first, &type, up->mtext
, second, msgtyp, third);
if (err < 0)
goto out;
if (err < 0)
goto out;
- up = uptr;
- if (get_user(type, &p->mtype) ||
- put_user(type, &up->mtype) ||
- copy_in_user(up->mtext, p->mtext, err))
+ if (put_user(type, &up->mtype))
err = -EFAULT;
out:
return err;
err = -EFAULT;
out:
return err;