Re: [PATCH] afs: use BIT_ULL for shifting to fix integer overflow

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

 



On 30/08/2019 15:01, David Howells wrote:
> Colin King <colin.king@xxxxxxxxxxxxx> wrote:
> 
>> The expression 1 << nr_slots is evaluated with 32 bit integer arithmetic
>> and can overflow before it is widened.
> 
> If it does, it's an error on the part of the caller.  See the banner comment:
> 1 <= nr_slots <= 9.

Doh, totally missed that. My bad.

> 
> And, in any case, if nr_slots >= 64, using BIT_ULL wouldn't help...
> 
> David
> 





[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux