diff options
author | David Sterba <dsterba@suse.com> | 2015-11-09 11:44:45 +0100 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2015-11-25 05:19:50 -0800 |
commit | 9dcbeed4d7e11e1dcf5e55475de3754f0855d1c2 (patch) | |
tree | 4f1418f234da7f11144e2d512b681f004926440a /include/linux/efi.h | |
parent | d5f2e33b92b10b8007be50b570a27e9bacfb4c3a (diff) | |
download | blackbird-op-linux-9dcbeed4d7e11e1dcf5e55475de3754f0855d1c2.tar.gz blackbird-op-linux-9dcbeed4d7e11e1dcf5e55475de3754f0855d1c2.zip |
btrfs: fix signed overflows in btrfs_sync_file
The calculation of range length in btrfs_sync_file leads to signed
overflow. This was caught by PaX gcc SIZE_OVERFLOW plugin.
https://forums.grsecurity.net/viewtopic.php?f=1&t=4284
The fsync call passes 0 and LLONG_MAX, the range length does not fit to
loff_t and overflows, but the value is converted to u64 so it silently
works as expected.
The minimal fix is a typecast to u64, switching functions to take
(start, end) instead of (start, len) would be more intrusive.
Coccinelle script found that there's one more opencoded calculation of
the length.
<smpl>
@@
loff_t start, end;
@@
* end - start
</smpl>
CC: stable@vger.kernel.org
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'include/linux/efi.h')
0 files changed, 0 insertions, 0 deletions