Commit 402df0e9 authored by Arun Sharma's avatar Arun Sharma Committed by David Mosberger

[PATCH] ia64: fix IA-32 version of shmctl()

This one is similar to msgctl. We should be calling sys_shmctl with
struct shmid64_ds.

In the absence of this patch:

shmctl(shmid, IPC_SET, &shmid_ds)

will fail.
parent 0644d178
......@@ -1430,7 +1430,7 @@ static int
shmctl32 (int first, int second, void *uptr)
{
int err = -EFAULT, err2;
struct shmid_ds s;
struct shmid64_ds s64;
struct shmid_ds32 *up32 = (struct shmid_ds32 *)uptr;
struct shmid64_ds32 *up64 = (struct shmid64_ds32 *)uptr;
......@@ -1482,19 +1482,19 @@ shmctl32 (int first, int second, void *uptr)
case IPC_SET:
if (version == IPC_64) {
err = get_user(s.shm_perm.uid, &up64->shm_perm.uid);
err |= get_user(s.shm_perm.gid, &up64->shm_perm.gid);
err |= get_user(s.shm_perm.mode, &up64->shm_perm.mode);
err = get_user(s64.shm_perm.uid, &up64->shm_perm.uid);
err |= get_user(s64.shm_perm.gid, &up64->shm_perm.gid);
err |= get_user(s64.shm_perm.mode, &up64->shm_perm.mode);
} else {
err = get_user(s.shm_perm.uid, &up32->shm_perm.uid);
err |= get_user(s.shm_perm.gid, &up32->shm_perm.gid);
err |= get_user(s.shm_perm.mode, &up32->shm_perm.mode);
err = get_user(s64.shm_perm.uid, &up32->shm_perm.uid);
err |= get_user(s64.shm_perm.gid, &up32->shm_perm.gid);
err |= get_user(s64.shm_perm.mode, &up32->shm_perm.mode);
}
if (err)
break;
old_fs = get_fs();
set_fs(KERNEL_DS);
err = sys_shmctl(first, second, &s);
err = sys_shmctl(first, second, &s64);
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