diff options
| author | Vegard Nossum <[email protected]> | 2016-06-30 15:53:46 +0000 |
|---|---|---|
| committer | Theodore Ts'o <[email protected]> | 2016-06-30 15:53:46 +0000 |
| commit | f70749ca42943faa4d4dcce46dfdcaadb1d0c4b6 (patch) | |
| tree | f4f3877c9b353fb99102c10f9ac200739bb94e97 /fs/jbd2/commit.c | |
| parent | jbd2: make journal y2038 safe (diff) | |
| download | kernel-f70749ca42943faa4d4dcce46dfdcaadb1d0c4b6.tar.gz kernel-f70749ca42943faa4d4dcce46dfdcaadb1d0c4b6.zip | |
ext4: check for extents that wrap around
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 <[email protected]>
Cc: [email protected]
Signed-off-by: Phil Turnbull <[email protected]>
Signed-off-by: Vegard Nossum <[email protected]>
Signed-off-by: Theodore Ts'o <[email protected]>
Diffstat (limited to 'fs/jbd2/commit.c')
0 files changed, 0 insertions, 0 deletions
