Commit 0644d178 authored by Arun Sharma's avatar Arun Sharma Committed by David Mosberger

[PATCH] ia64: fix IA-32 emulation of msgctl()

IA-32 programs executing:

msgctl(id, IPC_SET, &buf)

currently fail with EPERM due to this bug.
parent b9e72fef
......@@ -1336,21 +1336,21 @@ msgctl32 (int first, int second, void *uptr)
case IPC_SET:
if (version == IPC_64) {
err = get_user(m.msg_perm.uid, &up64->msg_perm.uid);
err |= get_user(m.msg_perm.gid, &up64->msg_perm.gid);
err |= get_user(m.msg_perm.mode, &up64->msg_perm.mode);
err |= get_user(m.msg_qbytes, &up64->msg_qbytes);
err = get_user(m64.msg_perm.uid, &up64->msg_perm.uid);
err |= get_user(m64.msg_perm.gid, &up64->msg_perm.gid);
err |= get_user(m64.msg_perm.mode, &up64->msg_perm.mode);
err |= get_user(m64.msg_qbytes, &up64->msg_qbytes);
} else {
err = get_user(m.msg_perm.uid, &up32->msg_perm.uid);
err |= get_user(m.msg_perm.gid, &up32->msg_perm.gid);
err |= get_user(m.msg_perm.mode, &up32->msg_perm.mode);
err |= get_user(m.msg_qbytes, &up32->msg_qbytes);
err = get_user(m64.msg_perm.uid, &up32->msg_perm.uid);
err |= get_user(m64.msg_perm.gid, &up32->msg_perm.gid);
err |= get_user(m64.msg_perm.mode, &up32->msg_perm.mode);
err |= get_user(m64.msg_qbytes, &up32->msg_qbytes);
}
if (err)
break;
old_fs = get_fs();
set_fs(KERNEL_DS);
err = sys_msgctl(first, second, &m);
err = sys_msgctl(first, second, &m64);
set_fs(old_fs);
break;
......
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