[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160630155452.GH2028@thunk.org>
Date: Thu, 30 Jun 2016 11:54:52 -0400
From: Theodore Ts'o <tytso@....edu>
To: Vegard Nossum <vegard.nossum@...cle.com>
Cc: Phil Turnbull <phil.turnbull@...cle.com>,
linux-ext4@...r.kernel.org, Eryu Guan <guaneryu@...il.com>
Subject: Re: [PATCH] ext4: check for extents that wrap around
On Thu, Jun 30, 2016 at 12:34:48AM +0200, Vegard Nossum wrote:
> An extent with lblock = 4294967295 and len = 1 will pass the
> ext4_valid_extent() test:
>
> ext4_lblk_t last = lblock + len - 1;
>
> if (len == 0 || lblock > last)
> return 0;
>
> since last = 4294967295 + 1 - 1 = 4294967295. This would later trigger
> the BUG_ON(es->es_lblk + es->es_len < es->es_lblk) in ext4_es_end().
>
> We can simplify it by removing the - 1 altogether and changing the test
> to use lblock + len <= lblock, since now if len = 0, then lblock + 0 ==
> lblock and it fails, and if len > 0 then lblock + len > lblock in order
> to pass (i.e. it doesn't overflow).
>
> Fixes: 5946d0893 ("ext4: check for overlapping extents in ext4_valid_extent_entries()")
> Fixes: 2f974865f ("ext4: check for zero length extent explicitly")
> Cc: Eryu Guan <guaneryu@...il.com>
> Cc: stable@...r.kernel.org
> Signed-off-by: Phil Turnbull <phil.turnbull@...cle.com>
> Signed-off-by: Vegard Nossum <vegard.nossum@...cle.com>
Thanks, applied.
- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists