diff options
Diffstat (limited to 'ipc/shm.c')
-rw-r--r-- | ipc/shm.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -953,7 +953,8 @@ out: | |||
953 | * "raddr" thing points to kernel space, and there has to be a wrapper around | 953 | * "raddr" thing points to kernel space, and there has to be a wrapper around |
954 | * this. | 954 | * this. |
955 | */ | 955 | */ |
956 | long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr) | 956 | long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr, |
957 | unsigned long shmlba) | ||
957 | { | 958 | { |
958 | struct shmid_kernel *shp; | 959 | struct shmid_kernel *shp; |
959 | unsigned long addr; | 960 | unsigned long addr; |
@@ -973,9 +974,9 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr) | |||
973 | if (shmid < 0) | 974 | if (shmid < 0) |
974 | goto out; | 975 | goto out; |
975 | else if ((addr = (ulong)shmaddr)) { | 976 | else if ((addr = (ulong)shmaddr)) { |
976 | if (addr & (SHMLBA-1)) { | 977 | if (addr & (shmlba - 1)) { |
977 | if (shmflg & SHM_RND) | 978 | if (shmflg & SHM_RND) |
978 | addr &= ~(SHMLBA-1); /* round down */ | 979 | addr &= ~(shmlba - 1); /* round down */ |
979 | else | 980 | else |
980 | #ifndef __ARCH_FORCE_SHMLBA | 981 | #ifndef __ARCH_FORCE_SHMLBA |
981 | if (addr & ~PAGE_MASK) | 982 | if (addr & ~PAGE_MASK) |
@@ -1107,7 +1108,7 @@ SYSCALL_DEFINE3(shmat, int, shmid, char __user *, shmaddr, int, shmflg) | |||
1107 | unsigned long ret; | 1108 | unsigned long ret; |
1108 | long err; | 1109 | long err; |
1109 | 1110 | ||
1110 | err = do_shmat(shmid, shmaddr, shmflg, &ret); | 1111 | err = do_shmat(shmid, shmaddr, shmflg, &ret, SHMLBA); |
1111 | if (err) | 1112 | if (err) |
1112 | return err; | 1113 | return err; |
1113 | force_successful_syscall_return(); | 1114 | force_successful_syscall_return(); |