Re: [PATCH] btrfs: Check superblock csum type to avoid 0 division or array overflow.

2015-04-23 Thread Qu Wenruo
Original Message Subject: Re: [PATCH] btrfs: Check superblock csum type to avoid 0 division or array overflow. From: David Sterba To: Qu Wenruo Date: 2015年04月24日 00:16 On Thu, Apr 23, 2015 at 09:31:21AM +0800, Qu Wenruo wrote: Current btrfs only support CRC32 checksum

Re: [PATCH] btrfs: Check superblock csum type to avoid 0 division or array overflow.

2015-04-23 Thread David Sterba
On Thu, Apr 23, 2015 at 09:31:21AM +0800, Qu Wenruo wrote: > Current btrfs only support CRC32 checksum, and if csum_type is 1, we > will get 0 csum size, causing 0 division later destroy the whole kernel. > Or csum_type is later than 1, we will get data from other random memory > causing more probl

[PATCH] btrfs: Check superblock csum type to avoid 0 division or array overflow.

2015-04-22 Thread Qu Wenruo
Current btrfs only support CRC32 checksum, and if csum_type is 1, we will get 0 csum size, causing 0 division later destroy the whole kernel. Or csum_type is later than 1, we will get data from other random memory causing more problem. So check csum_type in btrfs_check_super_valid() to avoid such