]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ipc/shm.c: check for overflows of shm_tot
authorManfred Spraul <manfred@colorfullife.com>
Thu, 22 May 2014 00:44:16 +0000 (10:44 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 22 May 2014 00:44:16 +0000 (10:44 +1000)
commitdd585f2a27a45f3a6ec2741e459cd5ef73e26fcd
tree9e25d767f60f1f71a755ec1e8e51155296a839a5
parent19467e2b7693369594cf7c0ecfa9852e575a7e3c
ipc/shm.c: check for overflows of shm_tot

shm_tot counts the total number of pages used by shm segments.

If SHMALL is ULONG_MAX (or nearly ULONG_MAX), then the number can
overflow.  Subsequent calls to shmctl(,SHM_INFO,) would return wrong
values for shm_tot.

The patch adds a detection for overflows.

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>
ipc/shm.c