linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ext4: buffer underrun in ext4_ext_split()?
@ 2009-08-07 18:19 Roel Kluin
  2009-08-07 18:50 ` Roel Kluin
  2009-08-08  3:32 ` Theodore Tso
  0 siblings, 2 replies; 3+ messages in thread
From: Roel Kluin @ 2009-08-07 18:19 UTC (permalink / raw)
  To: Theodore Ts'o, linux-ext4, Andrew Morton

If `depth' is less or equal to `at', a buffer underrun occurs

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
I am not sure whether this is possible.

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index afea652..25bc182 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -822,7 +822,7 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode,
 	}
 
 	/* initialize new leaf */
-	newblock = ablocks[--a];
+	newblock = a ? ablocks[--a] : 0;
 	BUG_ON(newblock == 0);
 	bh = sb_getblk(inode->i_sb, newblock);
 	if (!bh) {

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-08-08  3:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-07 18:19 ext4: buffer underrun in ext4_ext_split()? Roel Kluin
2009-08-07 18:50 ` Roel Kluin
2009-08-08  3:32 ` Theodore Tso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).