[PATCH] RLIMIT_MEMLOCK accounting of shmctl() SHM_LOCK is broken
Michael Kerrisk authored

The accounting of shmctl() SHM_LOCK memory locks against the user
structure is broken.  The check of the size of the to-be-locked region
is based on the size of the segment as specified when it was created by
shmget() (this size is *not* rounded up to a page boundary).

Fix it by rounding the size properlt.  Also, tune up the spinlock
coverage in there a little.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
193aa382