lib/radix-tree.c: fix overflow in radix_tree_range_tag_if_tagged()
authorJan Kara <jack@suse.cz>
Thu, 19 Aug 2010 21:13:33 +0000 (14:13 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 20 Aug 2010 16:34:55 +0000 (09:34 -0700)
commitd5ed3a4af77b851b6271ad3d9abc4c57fa3ce0f5
treef06894404e4af25051e8918bfd3fdac95974fc97
parentf2e41e910320197d55b52e28d99a07130f2ae738
lib/radix-tree.c: fix overflow in radix_tree_range_tag_if_tagged()

When radix_tree_maxindex() is ~0UL, it can happen that scanning overflows
index and tree traversal code goes astray reading memory until it hits
unreadable memory.  Check for overflow and exit in that case.

Signed-off-by: Jan Kara <jack@suse.cz>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/radix-tree.c
mm/page-writeback.c