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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 05 Feb 2012 23:10:42 +0100
From:	Willy Tarreau <w@....eu>
To:	linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc:	"Theodore Tso" <tytso@....edu>,
	Xiaoyun Mao <xiaoyun.maoxy@...yun-inc.com>,
	Yingbin Wang <yingbin.wangyb@...yun-inc.com>,
	Jia Wan <jia.wanj@...yun-inc.com>,
	Zheng Liu <wenqing.lz@...bao.com>,
	Greg KH <gregkh@...uxfoundation.org>
Subject: [PATCH 53/91] ext4: fix BUG_ON() in ext4_ext_insert_extent()

2.6.27-longterm review patch.  If anyone has any objections, please let us know.

------------------

Does not corrispond with a direct commit in Linus's tree as it was fixed
differently in the 3.0 release.


We will meet with a BUG_ON() if following script is run.

mkfs.ext4 -b 4096 /dev/sdb1 1000000
mount -t ext4 /dev/sdb1 /mnt/sdb1
fallocate -l 100M /mnt/sdb1/test
sync
for((i=0;i<170;i++))
do
        dd if=/dev/zero of=/mnt/sdb1/test conv=notrunc bs=256k count=1
seek=`expr $i \* 2`
done
umount /mnt/sdb1
mount -t ext4 /dev/sdb1 /mnt/sdb1
dd if=/dev/zero of=/mnt/sdb1/test conv=notrunc bs=256k count=1 seek=341
umount /mnt/sdb1
mount /dev/sdb1 /mnt/sdb1
dd if=/dev/zero of=/mnt/sdb1/test conv=notrunc bs=256k count=1 seek=340
sync

The reason is that it forgot to mark dirty when splitting two extents in
ext4_ext_convert_to_initialized(). Althrough ex has been updated in
memory, it is not dirtied both in ext4_ext_convert_to_initialized() and
ext4_ext_insert_extent(). The disk layout is corrupted. Then it will
meet with a BUG_ON() when writting at the start of that extent again.

Cc: "Theodore Ts'o" <tytso@....edu>
Cc: Xiaoyun Mao <xiaoyun.maoxy@...yun-inc.com>
Cc: Yingbin Wang <yingbin.wangyb@...yun-inc.com>
Cc: Jia Wan <jia.wanj@...yun-inc.com>
Signed-off-by: Zheng Liu <wenqing.lz@...bao.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
---
 fs/ext4/extents.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Index: longterm-2.6.27/fs/ext4/extents.c
===================================================================
--- longterm-2.6.27.orig/fs/ext4/extents.c	2012-02-05 22:34:33.413914999 +0100
+++ longterm-2.6.27/fs/ext4/extents.c	2012-02-05 22:34:42.416916530 +0100
@@ -2327,6 +2327,7 @@
 		ex1 = ex;
 		ex1->ee_len = cpu_to_le16(iblock - ee_block);
 		ext4_ext_mark_uninitialized(ex1);
+		ext4_ext_dirty(handle, inode, path + depth);
 		ex2 = &newex;
 	}
 	/*


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

Powered by Openwall GNU/*/Linux Powered by OpenVZ