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

2018-10-29 Thread Thomas Gleixner
Dan, On Thu, 25 Oct 2018, 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. > > Signed-off-by: Dan Carpenter > --- > arch/x86/mm/ioremap.c | 4 ++-- > 1 file changed,

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

2018-10-25 Thread Dan Carpenter
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?

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

2018-10-24 Thread Juergen Gross
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? For 32-bit systems I believe ULONG_MAX is a perfectly valid physical address.