2009-08-07 18:16:14

by Roel Kluin

[permalink] [raw]
Subject: ext4: buffer underrun in ext4_ext_split()?

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

Signed-off-by: Roel Kluin <[email protected]>
---
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) {


2009-08-07 18:47:04

by Roel Kluin

[permalink] [raw]
Subject: Re: ext4: buffer underrun in ext4_ext_split()?

Op 07-08-09 20:19, Roel Kluin schreef:
> If `depth' is less or equal to `at', a buffer underrun occurs

s/underrun/overflow/g

2009-08-08 03:32:13

by Theodore Ts'o

[permalink] [raw]
Subject: Re: ext4: buffer underrun in ext4_ext_split()?

On Fri, Aug 07, 2009 at 08:19:49PM +0200, Roel Kluin wrote:
> If `depth' is less or equal to `at', a buffer underrun occurs
>
> Signed-off-by: Roel Kluin <[email protected]>
> ---
> I am not sure whether this is possible.

I'm pretty sure this could never happen. ext4_ext_split is only
called from one place, and only when the leaf node is full.

- Ted