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]

 



Hi Srinivas,

On Tue, Dec 11, 2018 at 12:10 PM Srinivas Kandagatla
<srinivas.kandagatla@xxxxxxxxxx> wrote:
> 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.

Right, it has separate checks for signed/unsigned additions, but
both parameter types must have the same signedness, too.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[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