lkml.org 
[lkml]   [2016]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: UBSAN whinge in ihci-hub.c
From
Date
On Wed, 2016-05-18 at 10:40 +0300, Andrey Ryabinin wrote:
> 2016-05-18 1:16 GMT+03:00 Greg Kroah-Hartman <gregkh@linuxfoundation.org>:
> > On Tue, May 17, 2016 at 05:52:40PM -0400, Valdis Kletnieks wrote:
> >> So, not content in the amount of breakage I generate already, I
> >> compiled with UBSAN enabled...
> >>
> >> The immediately relevant part:
> >>
> >> [ 2.418576] ================================================================================
> >> [ 2.418579] UBSAN: Undefined behaviour in drivers/usb/host/ehci-hub.c:877:47
> >> [ 2.418582] index -1 is out of range for type 'u32 [1]'
> >
> > <snip>
> >
> > It's a known bug in ubsan,
>
> It's not a bug. int *p = &a[-1] is undefined behavior. It doesn't
> matter whether that pointer dereferenced or not.

That is a bold statement. Pointer arithmetic is defined. How can
the computation of an address be undefined behavior while it is
not used?

Regards
Oliver


\
 
 \ /
  Last update: 2016-05-18 11:01    [W:0.489 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site