Re: UBSAN: Undefined behaviour in net/ipv4/fib_trie.c:1397:22 and UBSAN: Undefined behaviour in ./arch/x86/include/asm/atomic.h:156:2

2 messages, 2 authors, 2016-01-28 · open the first message on its own page

Re: UBSAN: Undefined behaviour in net/ipv4/fib_trie.c:1397:22 and UBSAN: Undefined behaviour in ./arch/x86/include/asm/atomic.h:156:2

From: Eric Dumazet <hidden>
Date: 2016-01-26 21:36:23

On Tue, 2016-01-26 at 20:45 +0100, Toralf Förster wrote:
at a 32 nbit KVM image of a Gentoo Linux runniogn v4.5-rc1 - attached is /var/log/messages
Jan 26 20:40:04 n22kvm-clone kernel: ================================================================================
Jan 26 20:40:04 n22kvm-clone kernel: UBSAN: Undefined behaviour in net/ipv4/fib_trie.c:1397:22
Jan 26 20:40:04 n22kvm-clone kernel: shift exponent 32 is too large for 32-bit type 'long unsigned int'
Jan 26 20:40:04 n22kvm-clone kernel: CPU: 1 PID: 2050 Comm: dhcpcd Not tainted 4.5.0-rc1 #1
Jan 26 20:40:04 n22kvm-clone kernel: Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.8.2-0-g33fbe13 by qemu-project.org 04/01/2014

Thanks for the report.

CC netdev and Alexander

Commit 79e5ad2ceb006
("fib_trie: Remove leaf_info ")

Re: UBSAN: Undefined behaviour in net/ipv4/fib_trie.c:1397:22 and UBSAN: Undefined behaviour in ./arch/x86/include/asm/atomic.h:156:2

From: Alexander Duyck <hidden>
Date: 2016-01-28 17:15:12

On Tue, Jan 26, 2016 at 1:36 PM, Eric Dumazet [off-list ref] wrote:
On Tue, 2016-01-26 at 20:45 +0100, Toralf Förster wrote:
quoted
at a 32 nbit KVM image of a Gentoo Linux runniogn v4.5-rc1 - attached is /var/log/messages
Jan 26 20:40:04 n22kvm-clone kernel: ================================================================================
Jan 26 20:40:04 n22kvm-clone kernel: UBSAN: Undefined behaviour in net/ipv4/fib_trie.c:1397:22
Jan 26 20:40:04 n22kvm-clone kernel: shift exponent 32 is too large for 32-bit type 'long unsigned int'
Jan 26 20:40:04 n22kvm-clone kernel: CPU: 1 PID: 2050 Comm: dhcpcd Not tainted 4.5.0-rc1 #1
Jan 26 20:40:04 n22kvm-clone kernel: Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.8.2-0-g33fbe13 by qemu-project.org 04/01/2014

Thanks for the report.

CC netdev and Alexander

Commit 79e5ad2ceb006
("fib_trie: Remove leaf_info ")
I looked over the line in question, it is an issue where we are doing
the shift and then sanitizing for the undefined result after the fact.
I'll see about submitting a patch to address this.

- Alex
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help