]> err.no Git - linux-2.6/commitdiff
[PATCH] 32bit integer overflow in invalidate_inode_pages2()
authorOleg Drokin <green@linuxhacker.ru>
Wed, 23 Nov 2005 21:37:47 +0000 (13:37 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 24 Nov 2005 00:08:39 +0000 (16:08 -0800)
Fix a 32 bit integer overflow in invalidate_inode_pages2_range.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
mm/truncate.c

index 29c18f68dc35cd9b1cc17ee6e5f21bf05d3658e7..9173ab500604d904747f6f2681b9eb1305de7b42 100644 (file)
@@ -282,8 +282,8 @@ int invalidate_inode_pages2_range(struct address_space *mapping,
                                         * Zap the rest of the file in one hit.
                                         */
                                        unmap_mapping_range(mapping,
-                                           page_index << PAGE_CACHE_SHIFT,
-                                           (end - page_index + 1)
+                                          (loff_t)page_index<<PAGE_CACHE_SHIFT,
+                                          (loff_t)(end - page_index + 1)
                                                        << PAGE_CACHE_SHIFT,
                                            0);
                                        did_range_unmap = 1;
@@ -292,7 +292,7 @@ int invalidate_inode_pages2_range(struct address_space *mapping,
                                         * Just zap this page
                                         */
                                        unmap_mapping_range(mapping,
-                                         page_index << PAGE_CACHE_SHIFT,
+                                         (loff_t)page_index<<PAGE_CACHE_SHIFT,
                                          PAGE_CACHE_SIZE, 0);
                                }
                        }