summaryrefslogtreecommitdiffstats
path: root/mm/vmscan.c
diff options
context:
space:
mode:
authorDavid Rientjes <rientjes@google.com>2009-08-26 23:29:22 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2009-08-27 05:06:52 +0200
commitb62e408c05228f40e69bb38a48db8961cac6cd23 (patch)
tree40711bad4a60adb8f331d71574ec61e13c5a352d /mm/vmscan.c
parentflex_array: declare parts member to have incomplete type (diff)
downloadlinux-b62e408c05228f40e69bb38a48db8961cac6cd23.tar.xz
linux-b62e408c05228f40e69bb38a48db8961cac6cd23.zip
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 '')
0 files changed, 0 insertions, 0 deletions