Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vmscan: avoid multiplication overflow in shrink_zone()

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 <kosaki.motohiro@jp.fujitsu.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Andrew Morton and committed by
Linus Torvalds
8713e012 0ae05fb2

+1 -1
+1 -1
mm/vmscan.c
··· 1471 1471 1472 1472 for_each_evictable_lru(l) { 1473 1473 int file = is_file_lru(l); 1474 - int scan; 1474 + unsigned long scan; 1475 1475 1476 1476 scan = zone_nr_pages(zone, sc, l); 1477 1477 if (priority) {