Re: [PATCH v3] nvmem: check invalid number of bytes in nvmem_{read,write}()

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

 





On 11/12/18 11:06, Geert Uytterhoeven wrote:
I was trying with arm32 toolchain and compiler happy. Now tried with Arm64 toolchain, it provides a warning and the below typecast fixed the issue.
if (unlikely(check_add_overflow(bytes, (size_t)offset, &new_bytes)))

Does typecasting to (size_t)  fixed the issue in your environment? Please let  me know.
That's a side-effect of offset not being loff_t...
check_add_overflow will expect all the params to be of same type, so changing to loff_t will not help too.


I think that should be fixed first, else you will forget about
removing the cast later
Yes, I agree.

("casts are evil").



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux