aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorRobin Holt <holt@sgi.com>2013-04-30 19:15:54 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-05-07 19:57:27 -0700
commit9b2bdb66b65fcbdd4f3a3d08c28e4c46b4a59364 (patch)
treefb9bf9bc8e9e64d1b2c68a549c433414f9b60c9e /ipc
parentd2a51f02ccc6fac30f8cdb7e5f2791b2fe43d129 (diff)
downloadkernel_samsung_smdk4412-9b2bdb66b65fcbdd4f3a3d08c28e4c46b4a59364.tar.gz
kernel_samsung_smdk4412-9b2bdb66b65fcbdd4f3a3d08c28e4c46b4a59364.tar.bz2
kernel_samsung_smdk4412-9b2bdb66b65fcbdd4f3a3d08c28e4c46b4a59364.zip
ipc: sysv shared memory limited to 8TiB
commit d69f3bad4675ac519d41ca2b11e1c00ca115cecd upstream. Trying to run an application which was trying to put data into half of memory using shmget(), we found that having a shmall value below 8EiB-8TiB would prevent us from using anything more than 8TiB. By setting kernel.shmall greater than 8EiB-8TiB would make the job work. In the newseg() function, ns->shm_tot which, at 8TiB is INT_MAX. ipc/shm.c: 458 static int newseg(struct ipc_namespace *ns, struct ipc_params *params) 459 { ... 465 int numpages = (size + PAGE_SIZE -1) >> PAGE_SHIFT; ... 474 if (ns->shm_tot + numpages > ns->shm_ctlall) 475 return -ENOSPC; [akpm@linux-foundation.org: make ipc/shm.c:newseg()'s numpages size_t, not int] Signed-off-by: Robin Holt <holt@sgi.com> Reported-by: Alex Thorlton <athorlton@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'ipc')
-rw-r--r--ipc/shm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ipc/shm.c b/ipc/shm.c
index ab3385a21b2..10e17a7ccad 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -343,7 +343,7 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
size_t size = params->u.size;
int error;
struct shmid_kernel *shp;
- int numpages = (size + PAGE_SIZE -1) >> PAGE_SHIFT;
+ size_t numpages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
struct file * file;
char name[13];
int id;