]> git.baikalelectronics.ru Git - kernel.git/commit
ipc/shm.c: check for integer overflow during shmget.
authorManfred Spraul <manfred@colorfullife.com>
Fri, 6 Jun 2014 21:37:41 +0000 (14:37 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Jun 2014 23:08:14 +0000 (16:08 -0700)
commitaea8f98b5a14b509a4a488a30fbb9f8747b0b34c
tree6d6c8b14231b487e476e0aa84775173be45ff455
parentcc793846cd7ec3606d8b244282438e4d031829b8
ipc/shm.c: check for integer overflow during shmget.

SHMMAX is the upper limit for the size of a shared memory segment, counted
in bytes.  The actual allocation is that size, rounded up to the next full
page.

Add a check that prevents the creation of segments where the rounded up
size causes an integer overflow.

Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
Acked-by: Davidlohr Bueso <davidlohr@hp.com>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
ipc/shm.c