ipc: sysv shared memory limited to 8TiB
authorRobin Holt <holt@sgi.com>
Wed, 1 May 2013 02:15:54 +0000 (19:15 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 13 May 2013 14:02:30 +0000 (15:02 +0100)
commit5a467624b1c06db5a47bf2fe58e41347686af512
tree713d0c9098bd83bab7d0561dd7ac507de3574c2f
parent9a91027ba2368234da322cb32d5c13a41731dd2d
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: Ben Hutchings <ben@decadent.org.uk>
include/linux/ipc_namespace.h
ipc/shm.c