Re: [Bug 112171] UBSAN: Undefined behaviour in drivers/usb/host/ehci-hub.c:873:47

2016-02-18 Thread Alan Stern
On Tue, 9 Feb 2016, Yaroslav Molochko wrote:

> After upgrade to  4.5.0-rc3 I've got following stack trace, never seen
> that before:
> 
> Feb 08 22:58:56 x kernel: UBSAN: Undefined behaviour in
> drivers/usb/host/ehci-hub.c:873:47
> Feb 08 22:58:56 x kernel: index -1 is out of range for type 'u32 [1]'
> Feb 08 22:58:56 x kernel: CPU: 0 PID: 1 Comm: swapper/0 Not tainted
> 4.5.0-rc3 #98
> Feb 08 22:58:56 x kernel: Hardware name: LENOVO 20BSCTO1WW/20BSCTO1WW,
> BIOS N14ET32W (1.10 ) 08/13/2015
> Feb 08 22:58:56 x kernel:   84b750fa
> 880224deb358 81832ca4
> Feb 08 22:58:56 x kernel:   84b750fa
> 880224deb380 
> Feb 08 22:58:56 x kernel:  880224deb370 818a6360
> 833ea920 880224deb3c8
> Feb 08 22:58:56 x kernel: Call Trace:
> Feb 08 22:58:56 x kernel:  [] dump_stack+0xaf/0x10c
> Feb 08 22:58:56 x kernel:  [] ubsan_epilogue+0x14/0x56
> Feb 08 22:58:56 x kernel:  []
> __ubsan_handle_out_of_bounds+0x86/0xb3
> Feb 08 22:58:56 x kernel:  [] ehci_hub_control+0xcf/0x141e

I have no idea why this didn't show up earlier.  In any case it doesn't 
matter; the -1 index is part of an address calculation for a pointer 
that doesn't get used in this pathway.

This seems to be a common problem with UBSAN.  It spots invalid or 
questionable calculations in situations where they make no difference 
because the results don't get used.

Alan Stern

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


Re: [Bug 112171] UBSAN: Undefined behaviour in drivers/usb/host/ehci-hub.c:873:47

2016-02-09 Thread Greg KH
On Tue, Feb 09, 2016 at 12:41:37PM +0800, Yaroslav Molochko wrote:
> After upgrade to  4.5.0-rc3 I've got following stack trace, never seen
> that before:
> 
> Feb 08 22:58:56 x kernel: UBSAN: Undefined behaviour in
> drivers/usb/host/ehci-hub.c:873:47

Try turning off ubsan if you aren't using it to try to find bugs in the
kernel.  If you do want to use it to find bugs, please send a patch to
resolve this reported issue, if it really is an issue...

thanks,

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