Re: UBSAN: shift-out-of-bounds in get_init_ra_size()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 21/10/2020 13:23, Matthew Wilcox wrote:
> -	unsigned long newsize = roundup_pow_of_two(size);
> +	unsigned long newsize = size ? roundup_pow_of_two(size) : size;
> 
> would fix the ubsan splat.  Or maybe you should stop passing 0 to
> get_init_ra_size()?  ;-)

You're right. Let's do both ;-). Fix btrfs to stop passing in 0 and
get_init_ra_size() to not call roundup_pow_of_two() with 0.





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux