mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Samuel Tardieu <sam@rfc1149.net>
To: linux-kernel@vger.kernel.org
Subject: Re: Two vulnerabilities are founded,please confirm.
Date: 12 Sep 2006 17:55:23 +0200	[thread overview]
Message-ID: <87lkop9j10.fsf@willow.rfc1149.net> (raw)
In-Reply-To: <4506C376.1080606@venustech.com.cn>

>>>>> "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)



  reply	other threads:[~2006-09-12 15:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-12 14:25 ADLab
2006-09-12 15:55 ` Samuel Tardieu [this message]
2006-09-12 16:03   ` Samuel Tardieu
2006-09-18  5:45 ` Marcel Holtmann
2006-09-12 15:09 ADLab
2006-09-18  2:05 ADLab
2006-09-18  2:40 ADLab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lkop9j10.fsf@willow.rfc1149.net \
    --to=sam@rfc1149.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome