Re: 4.5.1: UBSAN: Undefined behaviour in ./arch/x86/include/asm/atomic.h:156:9

2016-04-21 Thread Greg KH
On Thu, Apr 21, 2016 at 01:17:19PM +0200, Martin MOKREJŠ wrote:
> Greg KH wrote:
> > On Thu, Apr 21, 2016 at 11:18:16AM +0200, Martin MOKREJŠ wrote:
> > > Hi Greg,
> > > 
> > > thank you for your answer.
> > > 
> > > Greg KH wrote:
> > > > On Thu, Apr 21, 2016 at 12:22:49AM +0200, Martin MOKREJŠ wrote:
> > > > > Hi,
> > > > >   I am not certain to to forward this to, so I am trying linux-usb 
> > > > > and ext4. Please add relevant people/lists, thank you.
> > > > > 
> > > > > # dmesg | grep "UBSAN: Undefined behaviour"
> > > > > [2.638843] UBSAN: Undefined behaviour in 
> > > > > drivers/usb/host/ehci-hub.c:873:47
> > > > > [8.553620] UBSAN: Undefined behaviour in fs/ext4/mballoc.c:2612:15
> > > > > [   25.341048] UBSAN: Undefined behaviour in fs/ext4/mballoc.c:1274:11
> > > > > [   41.460542] UBSAN: Undefined behaviour in 
> > > > > ./arch/x86/include/asm/atomic.h:156:9
> > > > > #
> > > > > 
> > > > > Full dmesg is attached.
> > > > > 
> > > > > Hope this helps,
> > > > > Martin
> > > > 
> > > > > [0.00] Linux version 4.5.1-default-pciehp (root@vostro) (gcc 
> > > > > version 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5) ) #1 SMP Thu Apr 14 
> > > > > 14:17:48 CEST 2016
> > > > 
> > > > Please try 4.6-rc4, a number of UBSAN issues have been fixed there.
> > > 
> > > They are still present:
> > > 
> > > # dmesg | grep "UBSAN: Undefined behaviour"
> > > [3.113405] UBSAN: Undefined behaviour in 
> > > drivers/usb/host/ehci-hub.c:877:47
> > > [5.678949] UBSAN: Undefined behaviour in fs/ext4/mballoc.c:2619:15
> > > [   18.345599] UBSAN: Undefined behaviour in fs/ext4/mballoc.c:1281:11
> > > [   34.544363] UBSAN: Undefined behaviour in 
> > > ./arch/x86/include/asm/atomic.h:156:9
> > 
> > Ah, sorry about that, turns out this is a bug in the tool, not in the
> > code, see the thread from a few weeks ago in the linux-usb archives with
> > the subject:
> > Subject: function ehci_hub_control in ehci-hub.c
> > for all of the details.
> 
> Thank you. I am not a programmer so I only infer from this thread I should 
> disable
> the UBSAN in .config. The kernel code is technically correct but triggers 
> false alarm.
> Maybe the UBSAN could have a whitelist of falsely matching locations?
> 
> https://www.mail-archive.com/linux-usb@vger.kernel.org/msg72438.html

It probably should be fixed to not report false things like this.

> Did anybody check the ext4 code or is it also just believed the UBSAN 
> complaint is
> just broken and code changes are not necessary?

I'm not an ext4 developer, I'll leave that to them  :)

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


Re: 4.5.1: UBSAN: Undefined behaviour in ./arch/x86/include/asm/atomic.h:156:9

2016-04-21 Thread Martin MOKREJŠ

Greg KH wrote:

On Thu, Apr 21, 2016 at 11:18:16AM +0200, Martin MOKREJŠ wrote:

Hi Greg,

thank you for your answer.

Greg KH wrote:

On Thu, Apr 21, 2016 at 12:22:49AM +0200, Martin MOKREJŠ wrote:

Hi,
  I am not certain to to forward this to, so I am trying linux-usb and ext4. 
Please add relevant people/lists, thank you.

# dmesg | grep "UBSAN: Undefined behaviour"
[2.638843] UBSAN: Undefined behaviour in drivers/usb/host/ehci-hub.c:873:47
[8.553620] UBSAN: Undefined behaviour in fs/ext4/mballoc.c:2612:15
[   25.341048] UBSAN: Undefined behaviour in fs/ext4/mballoc.c:1274:11
[   41.460542] UBSAN: Undefined behaviour in 
./arch/x86/include/asm/atomic.h:156:9
#

Full dmesg is attached.

Hope this helps,
Martin



[0.00] Linux version 4.5.1-default-pciehp (root@vostro) (gcc version 
5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5) ) #1 SMP Thu Apr 14 14:17:48 CEST 2016


Please try 4.6-rc4, a number of UBSAN issues have been fixed there.


They are still present:

# dmesg | grep "UBSAN: Undefined behaviour"
[3.113405] UBSAN: Undefined behaviour in drivers/usb/host/ehci-hub.c:877:47
[5.678949] UBSAN: Undefined behaviour in fs/ext4/mballoc.c:2619:15
[   18.345599] UBSAN: Undefined behaviour in fs/ext4/mballoc.c:1281:11
[   34.544363] UBSAN: Undefined behaviour in 
./arch/x86/include/asm/atomic.h:156:9


Ah, sorry about that, turns out this is a bug in the tool, not in the
code, see the thread from a few weeks ago in the linux-usb archives with
the subject:
Subject: function ehci_hub_control in ehci-hub.c
for all of the details.


Thank you. I am not a programmer so I only infer from this thread I should 
disable
the UBSAN in .config. The kernel code is technically correct but triggers false 
alarm.
Maybe the UBSAN could have a whitelist of falsely matching locations?

https://www.mail-archive.com/linux-usb@vger.kernel.org/msg72438.html

Did anybody check the ext4 code or is it also just believed the UBSAN complaint 
is
just broken and code changes are not necessary?
Martin
--
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: 4.5.1: UBSAN: Undefined behaviour in ./arch/x86/include/asm/atomic.h:156:9

2016-04-21 Thread Greg KH
On Thu, Apr 21, 2016 at 11:18:16AM +0200, Martin MOKREJŠ wrote:
> Hi Greg,
> 
> thank you for your answer.
> 
> Greg KH wrote:
> > On Thu, Apr 21, 2016 at 12:22:49AM +0200, Martin MOKREJŠ wrote:
> > > Hi,
> > >   I am not certain to to forward this to, so I am trying linux-usb and 
> > > ext4. Please add relevant people/lists, thank you.
> > > 
> > > # dmesg | grep "UBSAN: Undefined behaviour"
> > > [2.638843] UBSAN: Undefined behaviour in 
> > > drivers/usb/host/ehci-hub.c:873:47
> > > [8.553620] UBSAN: Undefined behaviour in fs/ext4/mballoc.c:2612:15
> > > [   25.341048] UBSAN: Undefined behaviour in fs/ext4/mballoc.c:1274:11
> > > [   41.460542] UBSAN: Undefined behaviour in 
> > > ./arch/x86/include/asm/atomic.h:156:9
> > > #
> > > 
> > > Full dmesg is attached.
> > > 
> > > Hope this helps,
> > > Martin
> > 
> > > [0.00] Linux version 4.5.1-default-pciehp (root@vostro) (gcc 
> > > version 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5) ) #1 SMP Thu Apr 14 14:17:48 
> > > CEST 2016
> > 
> > Please try 4.6-rc4, a number of UBSAN issues have been fixed there.
> 
> They are still present:
> 
> # dmesg | grep "UBSAN: Undefined behaviour"
> [3.113405] UBSAN: Undefined behaviour in 
> drivers/usb/host/ehci-hub.c:877:47
> [5.678949] UBSAN: Undefined behaviour in fs/ext4/mballoc.c:2619:15
> [   18.345599] UBSAN: Undefined behaviour in fs/ext4/mballoc.c:1281:11
> [   34.544363] UBSAN: Undefined behaviour in 
> ./arch/x86/include/asm/atomic.h:156:9

Ah, sorry about that, turns out this is a bug in the tool, not in the
code, see the thread from a few weeks ago in the linux-usb archives with
the subject:
Subject: function ehci_hub_control in ehci-hub.c
for all of the details.

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


Re: 4.5.1: UBSAN: Undefined behaviour in ./arch/x86/include/asm/atomic.h:156:9

2016-04-21 Thread Martin MOKREJŠ

Hi Greg,

thank you for your answer.

Greg KH wrote:

On Thu, Apr 21, 2016 at 12:22:49AM +0200, Martin MOKREJŠ wrote:

Hi,
  I am not certain to to forward this to, so I am trying linux-usb and ext4. 
Please add relevant people/lists, thank you.

# dmesg | grep "UBSAN: Undefined behaviour"
[2.638843] UBSAN: Undefined behaviour in drivers/usb/host/ehci-hub.c:873:47
[8.553620] UBSAN: Undefined behaviour in fs/ext4/mballoc.c:2612:15
[   25.341048] UBSAN: Undefined behaviour in fs/ext4/mballoc.c:1274:11
[   41.460542] UBSAN: Undefined behaviour in 
./arch/x86/include/asm/atomic.h:156:9
#

Full dmesg is attached.

Hope this helps,
Martin



[0.00] Linux version 4.5.1-default-pciehp (root@vostro) (gcc version 
5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5) ) #1 SMP Thu Apr 14 14:17:48 CEST 2016


Please try 4.6-rc4, a number of UBSAN issues have been fixed there.


They are still present:

# dmesg | grep "UBSAN: Undefined behaviour"
[3.113405] UBSAN: Undefined behaviour in drivers/usb/host/ehci-hub.c:877:47
[5.678949] UBSAN: Undefined behaviour in fs/ext4/mballoc.c:2619:15
[   18.345599] UBSAN: Undefined behaviour in fs/ext4/mballoc.c:1281:11
[   34.544363] UBSAN: Undefined behaviour in 
./arch/x86/include/asm/atomic.h:156:9
#

Updated dmesg is attached.
Martin
[0.00] Linux version 4.6.0-rc4-default-pciehp (root@vostro) (gcc 
version 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5) ) #1 SMP Thu Apr 21 10:24:31 CEST 
2016
[0.00] Command line: BOOT_IMAGE=/boot/vmlinuz-4.6-rc4 root=/dev/sda5 ro 
slub_debug=AFPZ pciehp.pciehp_debug=1 pciehp_debug=1 intel_idle.max_cstate=c3 
i915.i915_enable_rc6=1 usbcore.autosuspend=-1
[0.00] x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]:  256
[0.00] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point 
registers'
[0.00] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[0.00] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[0.00] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, 
using 'standard' format.
[0.00] x86/fpu: Using 'eager' FPU context switches.
[0.00] e820: BIOS-provided physical RAM map:
[0.00] BIOS-e820: [mem 0x-0x0009d3ff] usable
[0.00] BIOS-e820: [mem 0x0009d400-0x0009] reserved
[0.00] BIOS-e820: [mem 0x000e-0x000f] reserved
[0.00] BIOS-e820: [mem 0x0010-0x1fff] usable
[0.00] BIOS-e820: [mem 0x2000-0x201f] reserved
[0.00] BIOS-e820: [mem 0x2020-0x3fff] usable
[0.00] BIOS-e820: [mem 0x4000-0x401f] reserved
[0.00] BIOS-e820: [mem 0x4020-0xda4e4fff] usable
[0.00] BIOS-e820: [mem 0xda4e5000-0xda527fff] ACPI NVS
[0.00] BIOS-e820: [mem 0xda528000-0xda792fff] usable
[0.00] BIOS-e820: [mem 0xda793000-0xda966fff] reserved
[0.00] BIOS-e820: [mem 0xda967000-0xdaa88fff] usable
[0.00] BIOS-e820: [mem 0xdaa89000-0xdad67fff] reserved
[0.00] BIOS-e820: [mem 0xdad68000-0xdafe7fff] ACPI NVS
[0.00] BIOS-e820: [mem 0xdafe8000-0xdaff] ACPI data
[0.00] BIOS-e820: [mem 0xdb80-0xdf9f] reserved
[0.00] BIOS-e820: [mem 0xf800-0xfbff] reserved
[0.00] BIOS-e820: [mem 0xfec0-0xfec00fff] reserved
[0.00] BIOS-e820: [mem 0xfed0-0xfed03fff] reserved
[0.00] BIOS-e820: [mem 0xfed1c000-0xfed1] reserved
[0.00] BIOS-e820: [mem 0xfee0-0xfee00fff] reserved
[0.00] BIOS-e820: [mem 0xff00-0x] reserved
[0.00] BIOS-e820: [mem 0x0001-0x00041fdf] usable
[0.00] NX (Execute Disable) protection: active
[0.00] SMBIOS 2.6 present.
[0.00] DMI: Dell Inc. Vostro 3550/, BIOS A12 02/18/2014
[0.00] e820: update [mem 0x-0x0fff] usable ==> reserved
[0.00] e820: remove [mem 0x000a-0x000f] usable
[0.00] e820: last_pfn = 0x41fe00 max_arch_pfn = 0x4
[0.00] MTRR default type: uncachable
[0.00] MTRR fixed ranges enabled:
[0.00]   0-9 write-back
[0.00]   A-B uncachable
[0.00]   C-C write-protect
[0.00]   D-E7FFF uncachable
[0.00]   E8000-F write-protect
[0.00] MTRR variable ranges enabled:
[0.00]   0 base 0 mask C write-back
[0.00]   1 base 4 mask FE000 write-back
[0.00]   2 base 0DB80 mask FFF80 uncachable
[0.00]   3 base 0DC00 mask FFC00 uncachable
[0.00]   4 base 0E000 mask FE000 uncachable
[0.00]   5 

Re: 4.5.1: UBSAN: Undefined behaviour in ./arch/x86/include/asm/atomic.h:156:9

2016-04-20 Thread Greg KH
On Thu, Apr 21, 2016 at 12:22:49AM +0200, Martin MOKREJŠ wrote:
> Hi,
>   I am not certain to to forward this to, so I am trying linux-usb and ext4. 
> Please add relevant people/lists, thank you.
> 
> # dmesg | grep "UBSAN: Undefined behaviour"
> [2.638843] UBSAN: Undefined behaviour in 
> drivers/usb/host/ehci-hub.c:873:47
> [8.553620] UBSAN: Undefined behaviour in fs/ext4/mballoc.c:2612:15
> [   25.341048] UBSAN: Undefined behaviour in fs/ext4/mballoc.c:1274:11
> [   41.460542] UBSAN: Undefined behaviour in 
> ./arch/x86/include/asm/atomic.h:156:9
> #
> 
> Full dmesg is attached.
> 
> Hope this helps,
> Martin

> [0.00] Linux version 4.5.1-default-pciehp (root@vostro) (gcc version 
> 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5) ) #1 SMP Thu Apr 14 14:17:48 CEST 2016

Please try 4.6-rc4, a number of UBSAN issues have been fixed there.

thansk,

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


4.5.1: UBSAN: Undefined behaviour in ./arch/x86/include/asm/atomic.h:156:9

2016-04-20 Thread Martin MOKREJŠ

Hi,
  I am not certain to to forward this to, so I am trying linux-usb and ext4. 
Please add relevant people/lists, thank you.

# dmesg | grep "UBSAN: Undefined behaviour"
[2.638843] UBSAN: Undefined behaviour in drivers/usb/host/ehci-hub.c:873:47
[8.553620] UBSAN: Undefined behaviour in fs/ext4/mballoc.c:2612:15
[   25.341048] UBSAN: Undefined behaviour in fs/ext4/mballoc.c:1274:11
[   41.460542] UBSAN: Undefined behaviour in 
./arch/x86/include/asm/atomic.h:156:9
#

Full dmesg is attached.

Hope this helps,
Martin
[0.00] Linux version 4.5.1-default-pciehp (root@vostro) (gcc version 
5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5) ) #1 SMP Thu Apr 14 14:17:48 CEST 2016
[0.00] Command line: BOOT_IMAGE=/boot/vmlinuz-4.5.1 root=/dev/sda5 ro 
slub_debug=AFPZ pciehp.pciehp_debug=1 pciehp_debug=1 intel_idle.max_cstate=c3 
i915.i915_enable_rc6=1 usbcore.autosuspend=-1
[0.00] x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]:  256
[0.00] x86/fpu: Supporting XSAVE feature 0x01: 'x87 floating point 
registers'
[0.00] x86/fpu: Supporting XSAVE feature 0x02: 'SSE registers'
[0.00] x86/fpu: Supporting XSAVE feature 0x04: 'AVX registers'
[0.00] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, 
using 'standard' format.
[0.00] x86/fpu: Using 'eager' FPU context switches.
[0.00] e820: BIOS-provided physical RAM map:
[0.00] BIOS-e820: [mem 0x-0x0009d3ff] usable
[0.00] BIOS-e820: [mem 0x0009d400-0x0009] reserved
[0.00] BIOS-e820: [mem 0x000e-0x000f] reserved
[0.00] BIOS-e820: [mem 0x0010-0x1fff] usable
[0.00] BIOS-e820: [mem 0x2000-0x201f] reserved
[0.00] BIOS-e820: [mem 0x2020-0x3fff] usable
[0.00] BIOS-e820: [mem 0x4000-0x401f] reserved
[0.00] BIOS-e820: [mem 0x4020-0xda4e4fff] usable
[0.00] BIOS-e820: [mem 0xda4e5000-0xda527fff] ACPI NVS
[0.00] BIOS-e820: [mem 0xda528000-0xda792fff] usable
[0.00] BIOS-e820: [mem 0xda793000-0xda966fff] reserved
[0.00] BIOS-e820: [mem 0xda967000-0xdaa88fff] usable
[0.00] BIOS-e820: [mem 0xdaa89000-0xdad67fff] reserved
[0.00] BIOS-e820: [mem 0xdad68000-0xdafe7fff] ACPI NVS
[0.00] BIOS-e820: [mem 0xdafe8000-0xdaff] ACPI data
[0.00] BIOS-e820: [mem 0xdb80-0xdf9f] reserved
[0.00] BIOS-e820: [mem 0xf800-0xfbff] reserved
[0.00] BIOS-e820: [mem 0xfec0-0xfec00fff] reserved
[0.00] BIOS-e820: [mem 0xfed0-0xfed03fff] reserved
[0.00] BIOS-e820: [mem 0xfed1c000-0xfed1] reserved
[0.00] BIOS-e820: [mem 0xfee0-0xfee00fff] reserved
[0.00] BIOS-e820: [mem 0xff00-0x] reserved
[0.00] BIOS-e820: [mem 0x0001-0x00041fdf] usable
[0.00] NX (Execute Disable) protection: active
[0.00] SMBIOS 2.6 present.
[0.00] DMI: Dell Inc. Vostro 3550/, BIOS A12 02/18/2014
[0.00] e820: update [mem 0x-0x0fff] usable ==> reserved
[0.00] e820: remove [mem 0x000a-0x000f] usable
[0.00] e820: last_pfn = 0x41fe00 max_arch_pfn = 0x4
[0.00] MTRR default type: uncachable
[0.00] MTRR fixed ranges enabled:
[0.00]   0-9 write-back
[0.00]   A-B uncachable
[0.00]   C-C write-protect
[0.00]   D-E7FFF uncachable
[0.00]   E8000-F write-protect
[0.00] MTRR variable ranges enabled:
[0.00]   0 base 0 mask C write-back
[0.00]   1 base 4 mask FE000 write-back
[0.00]   2 base 0DB80 mask FFF80 uncachable
[0.00]   3 base 0DC00 mask FFC00 uncachable
[0.00]   4 base 0E000 mask FE000 uncachable
[0.00]   5 base 41FE0 mask FFFE0 uncachable
[0.00]   6 disabled
[0.00]   7 disabled
[0.00]   8 disabled
[0.00]   9 disabled
[0.00] x86/PAT: Configuration [0-7]: WB  WC  UC- UC  WB  WC  UC- WT  
[0.00] e820: update [mem 0xdb80-0x] usable ==> reserved
[0.00] e820: last_pfn = 0xdaa89 max_arch_pfn = 0x4
[0.00] Base memory trampoline at [88097000] 97000 size 24576
[0.00] reserving inaccessible SNB gfx pages
[0.00] BRK [0x046ab000, 0x046abfff] PGTABLE
[0.00] BRK [0x046ac000, 0x046acfff] PGTABLE
[0.00] BRK [0x046ad000, 0x046adfff] PGTABLE
[0.00] BRK [0x046ae000, 0x046aefff] PGTABLE
[0.00] BRK [0x046af000, 0x046a] PGTABLE
[