aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-03-16 15:10:45 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-03-16 15:10:45 -0800
commit9c6d7e9227b83c85b268369af828d01d5b69cfec (patch)
tree3c0ac0d96ea7badfb9d1bf03d5f9ce7655dd9134 /ipc
parent289b0e41fbcde9706029d39934c3f259d08eeeef (diff)
downloadhistory-9c6d7e9227b83c85b268369af828d01d5b69cfec.tar.gz
[PATCH] SHMLBA compat task alignment fix
From: Arun Sharma <arun.sharma@intel.com> The current Linux implementation of shmat() insists on SHMLBA alignment even when shmflg & SHM_RND == 0. This is not consistent with the man pages and the single UNIX spec, which require only a page-aligned address. However, some architectures require a SHMLBA alignment for correctness in all cases. Such architectures use __ARCH_FORCE_SHMLBA.
Diffstat (limited to 'ipc')
-rw-r--r--ipc/shm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ipc/shm.c b/ipc/shm.c
index d7d932d6dea5db..9721b42ec9d87c 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -656,7 +656,10 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr)
if (shmflg & SHM_RND)
addr &= ~(SHMLBA-1); /* round down */
else
- return -EINVAL;
+#ifndef __ARCH_FORCE_SHMLBA
+ if (addr & ~PAGE_MASK)
+#endif
+ return -EINVAL;
}
flags = MAP_SHARED | MAP_FIXED;
} else {