lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 20 Jun 2012 14:01:28 -0400
From:	Jeff Moyer <jmoyer@...hat.com>
To:	Jens Axboe <jaxboe@...ionio.com>, linux-kernel@...r.kernel.org
Cc:	stable@...r.kernel.org, torsten.hilbrich@...unet.com,
	Nick Piggin <npiggin@...nel.dk>
Subject: [patch] block: fix off-by-one in init_page_buffers

Hi,

This commit:

commit 080399aaaf3531f5b8761ec0ac30ff98891e8686
Author: Jeff Moyer <jmoyer@...hat.com>
Date:   Fri May 11 16:34:10 2012 +0200

    block: don't mark buffers beyond end of disk as mapped

introduced a bug whereby the last block on the device was treated as
beyond the end of the device.  This causes the mount program to hang
when trying to (erroneously) mount an extended partition, as reported by
Torsten Hilbrich here: https://lkml.org/lkml/2012/6/18/54, and also
reported independently here:
http://www.sysresccd.org/forums/viewtopic.php?f=13&t=4511.

The attached patch was tested by myself and Torsten and found to resolve
the problem.  I also instrumented the init_page_buffers routine to
ensure that the end_block is indeed the last block of the device.

Comments, as always, are appreciated.

--

This needs backporting to the stable trees where the offending commit
was backported.  I'm sure that includes 3.0 and 3.3, but not sure where
else it was committed.  Is there an easy way to tell what trees got the
commit?

CC: stable@...r.kernel.org, npiggin@...nel.dk
Reported-and-Tested-by: Torsten Hilbrich <torsten.hilbrich@...unet.com>
Signed-off-by: Jeff Moyer <jmoyer@...hat.com>

diff --git a/fs/buffer.c b/fs/buffer.c
index 838a9cf..769b30b 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -930,7 +930,7 @@ init_page_buffers(struct page *page, struct block_device *bdev,
 			bh->b_blocknr = block;
 			if (uptodate)
 				set_buffer_uptodate(bh);
-			if (block < end_block)
+			if (block <= end_block)
 				set_buffer_mapped(bh);
 		}
 		block++;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists