summary refs log tree commit diff
path: root/mm/rmap.c
diff options
context:
space:
mode:
authorDavid Rientjes <rientjes@google.com>2009-08-26 14:29:22 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-08-26 20:06:52 -0700
commitb62e408c05228f40e69bb38a48db8961cac6cd23 (patch)
tree40711bad4a60adb8f331d71574ec61e13c5a352d /mm/rmap.c
parent8e7ee27095aee87b5db1b0061e2ceea5878a1bbd (diff)
downloadlinux-b62e408c05228f40e69bb38a48db8961cac6cd23.tar.gz
flex_array: convert element_nr formals to unsigned
It's problematic to allow signed element_nr's or total's to be passed as
part of the flex array API.

flex_array_alloc() allows total_nr_elements to be set to a negative
quantity, which is obviously erroneous.

flex_array_get() and flex_array_put() allows negative array indices in
dereferencing an array part, which could address memory mapped before
struct flex_array.

The fix is to convert all existing element_nr formals to be qualified as
unsigned.  Existing checks to compare it to total_nr_elements or the max
array size based on element_size need not be changed.

Signed-off-by: David Rientjes <rientjes@google.com>
Cc: Dave Hansen <dave@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/rmap.c')
0 files changed, 0 insertions, 0 deletions