]> Git Repo - J-linux.git/commitdiff
vmscan: avoid multiplication overflow in shrink_zone()
authorAndrew Morton <[email protected]>
Thu, 30 Apr 2009 22:08:55 +0000 (15:08 -0700)
committerLinus Torvalds <[email protected]>
Sat, 2 May 2009 22:36:10 +0000 (15:36 -0700)
Local variable `scan' can overflow on zones which are larger than

(2G * 4k) / 100 = 80GB.

Making it 64-bit on 64-bit will fix that up.

Cc: KOSAKI Motohiro <[email protected]>
Cc: Wu Fengguang <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Lee Schermerhorn <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/vmscan.c

index eac9577941f935a0d8f281a6e851b68995e50314..5fa3eda1f03fccb6626f08c8e7bdad53326bce84 100644 (file)
@@ -1471,7 +1471,7 @@ static void shrink_zone(int priority, struct zone *zone,
 
        for_each_evictable_lru(l) {
                int file = is_file_lru(l);
-               int scan;
+               unsigned long scan;
 
                scan = zone_nr_pages(zone, sc, l);
                if (priority) {
This page took 0.054026 seconds and 4 git commands to generate.