Re: UBSAN: Undefined behaviour in drivers/usb/core/devio.c:1517:25

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

 



On Tue, Jan 26, 2016 at 07:03:39PM +0300, Andrey Ryabinin wrote:
> On 01/26/2016 06:25 PM, Alan Stern wrote:
> > On Tue, 26 Jan 2016, Chris Bainbridge wrote:
> > 
> >> Booting 4.5.0-rc1 with new UBSAN checker enabled:
> >>
> >> [    4.556968] ================================================================================
> >> [    4.556972] UBSAN: Undefined behaviour in drivers/usb/core/devio.c:1517:25
> >> [    4.556975] shift exponent -1 is negative
> > 
> > Does a left shift by a negative amount matter if the result isn't used?
> > 
> 
> By definition, any code with undefined behavior could do anything.

But in reality, we are ok here, gcc isn't that foolish.

> But in practice, undefined shift just leads to undefined result of shift operation
> (it depends on operands and architecture).

But if we don't use the value...

Anyway, please send a patch if you wish this issue to be fixed and we
can discuss it that way.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux