Re: [PATCH] x86/ioremap: tighten integer overflow checking

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

 




On Thu, Oct 25, 2018 at 08:28:44AM +0200, Juergen Gross wrote:
> On 25/10/2018 08:16, Dan Carpenter wrote:
> > The current check is a bit off in the case where "phys_addr + size"
> > wraps to zero because then "last_addr" is set to ULONG_MAX which is >=
> > phys_addr.
> 
> And -2 would be okay?
> 

If you see any patches from me it's static checker stuff...

I guess the original is actually fine because the -1 re-wraps back to
what we wanted it to be.  We also do verify that size is correct in
__ioremap_check_mem() so I can't see a problem here after all.

regards,
dan carpenter




[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