lkml.org 
[lkml]   [2006]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: Two vulnerabilities are founded,please confirm.
Date
>>>>> "ADLab" == ADLab  <adlab@venustech.com.cn> writes:

ADLab> Advisory: [AD_LAB-06011] Linux kernel Filesystem Mount Dead
ADLab> Loop Class: Design Error

Would a simple fix like this one (untested) work?

Check that the requested block fits in the device.

Fix for advisory AD_LAB-06011 Linux kernel Filesystem Mount Dead Loop.

Signed-off-by: Samuel Tardieu <sam@rfc1149.net>

diff -r db51efd75e66 fs/buffer.c
--- a/fs/buffer.c Sun Sep 10 01:02:33 2006 +0200
+++ b/fs/buffer.c Tue Sep 12 17:54:13 2006 +0200
@@ -1456,7 +1456,17 @@ struct buffer_head *
struct buffer_head *
__getblk(struct block_device *bdev, sector_t block, int size)
{
- struct buffer_head *bh = __find_get_block(bdev, block, size);
+ struct buffer_head *bh;
+ char b[BDEVNAME_SIZE];
+
+ if (block >= bdev->bd_disk->capacity) {
+ printk(KERN_ERR "Invalid block number %Ld requested on device %s",
+ (unsigned long long)block,
+ bdevname(bdev, b));
+ return NULL;
+ }
+
+ bh = __find_get_block(bdev, block, size);

might_sleep();
if (bh == NULL)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-09-12 19:17    [W:0.058 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site