summaryrefslogtreecommitdiffstats
path: root/fs/sysfs
diff options
context:
space:
mode:
authorNikolay Borisov <nborisov@suse.com>2019-03-18 17:45:20 +0200
committerDavid Sterba <dsterba@suse.com>2019-03-19 14:12:36 +0100
commit139a56170de67101791d6e6c8e940c6328393fe9 (patch)
tree4ab775334ccbb2dbcdfa1c20e6e67569b7ab6721 /fs/sysfs
parent7ff2c2a1a71e83f74574b8001ea88deb3c166ad7 (diff)
downloadlinux-139a56170de67101791d6e6c8e940c6328393fe9.tar.bz2
btrfs: Avoid possible qgroup_rsv_size overflow in btrfs_calculate_inode_block_rsv_size
qgroup_rsv_size is calculated as the product of outstanding_extent * fs_info->nodesize. The product is calculated with 32 bit precision since both variables are defined as u32. Yet qgroup_rsv_size expects a 64 bit result. Avoid possible multiplication overflow by casting outstanding_extent to u64. Such overflow would in the worst case (64K nodesize) require more than 65536 extents, which is quite large and i'ts not likely that it would happen in practice. Fixes-coverity-id: 1435101 Fixes: ff6bc37eb7f6 ("btrfs: qgroup: Use independent and accurate per inode qgroup rsv") CC: stable@vger.kernel.org # 4.19+ Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/sysfs')
0 files changed, 0 insertions, 0 deletions