UBSAN: Undefined behaviour in drivers/edac/i5000_edac.c:956:20

From: Meelis Roos
Date: Mon May 16 2016 - 09:42:16 EST


Got these 2 warnings from UBSAN about i5000 edac. UBSAN has returned
fals positives too so I do not know if these are real, but I better
report them.

[ 2.609406] ================================================================================
[ 2.609713] UBSAN: Undefined behaviour in drivers/edac/i5000_edac.c:956:20
[ 2.609895] index 4 is out of range for type 'u16 [4]'
[ 2.610074] CPU: 1 PID: 1278 Comm: systemd-udevd Not tainted 4.6.0 #40
[ 2.610254] Hardware name: IBM IBM System x3550 -[7978E2G]-/System Planar, BIOS -[GFE149BUS-1.17]- 02/14/2011
[ 2.610567] ffff88013ae417ac ffffffff8141018d 0000000000000001 ffff8800bb34baf8
[ 2.611047] 0000000000000004 ffffffff81463149 ffffffffa007c600 ffffffff814637e2
[ 2.611525] 0000000000000202 0000000000000034 0000000000000fe8 ffff8800bb135023
[ 2.612005] Call Trace:
[ 2.612186] [<ffffffff8141018d>] ? dump_stack+0x47/0x6a
[ 2.613090] [<ffffffff81463149>] ? ubsan_epilogue+0x9/0x40
[ 2.613090] [<ffffffff814637e2>] ? __ubsan_handle_out_of_bounds+0x62/0x70
[ 2.613090] [<ffffffffa007a909>] ? i5000_init_one+0xe59/0x11a3 [i5000_edac]
[ 2.613090] [<ffffffff812d1244>] ? kernfs_add_one+0x164/0x1e0
[ 2.613090] [<ffffffff81479fe8>] ? pci_device_probe+0xa8/0x150
[ 2.613090] [<ffffffff8159a774>] ? driver_probe_device+0x104/0x380
[ 2.613090] [<ffffffff8159aa97>] ? __driver_attach+0xa7/0xe0
[ 2.613090] [<ffffffff8159a9f0>] ? driver_probe_device+0x380/0x380
[ 2.613090] [<ffffffff81597d73>] ? bus_for_each_dev+0x63/0xb0
[ 2.613090] [<ffffffff8159975f>] ? bus_add_driver+0x14f/0x2a0
[ 2.613090] [<ffffffffa0087000>] ? 0xffffffffa0087000
[ 2.613090] [<ffffffff8159b577>] ? driver_register+0x67/0x110
[ 2.613090] [<ffffffffa008702d>] ? i5000_init+0x2d/0x1000 [i5000_edac]
[ 2.613090] [<ffffffff810003b3>] ? do_one_initcall+0x93/0x230
[ 2.613090] [<ffffffff811e2f5a>] ? free_vmap_area_noflush+0x3a/0xb0
[ 2.613090] [<ffffffff8117fada>] ? do_init_module+0x8b/0x261
[ 2.613090] [<ffffffff8114068b>] ? load_module+0x1d2b/0x2e40
[ 2.613090] [<ffffffff8113d620>] ? resolve_symbol_wait+0x130/0x130
[ 2.613090] [<ffffffff811d8dee>] ? do_mmap+0x3ce/0x570
[ 2.613090] [<ffffffff81223d5f>] ? kernel_read_file_from_fd+0x3f/0x70
[ 2.613090] [<ffffffff81141952>] ? SYSC_finit_module+0xa2/0xb0
[ 2.613090] [<ffffffff81801b1b>] ? entry_SYSCALL_64_fastpath+0x13/0x8f
[ 2.613090] ================================================================================
[ 2.619880] ================================================================================
[ 2.620186] UBSAN: Undefined behaviour in drivers/edac/i5000_edac.c:958:20
[ 2.620365] index 4 is out of range for type 'u16 [4]'
[ 2.620542] CPU: 1 PID: 1278 Comm: systemd-udevd Not tainted 4.6.0 #40
[ 2.620721] Hardware name: IBM IBM System x3550 -[7978E2G]-/System Planar, BIOS -[GFE149BUS-1.17]- 02/14/2011
[ 2.621029] ffff88013ae417ac ffffffff8141018d 0000000000000001 ffff8800bb34baf8
[ 2.621508] 0000000000000004 ffffffff81463149 ffffffffa007c5c0 ffffffff814637e2
[ 2.621986] 0000000000000202 0000000000000034 0000000000000fe8 ffff8800bb135023
[ 2.622467] Call Trace:
[ 2.622640] [<ffffffff8141018d>] ? dump_stack+0x47/0x6a
[ 2.622818] [<ffffffff81463149>] ? ubsan_epilogue+0x9/0x40
[ 2.622998] [<ffffffff814637e2>] ? __ubsan_handle_out_of_bounds+0x62/0x70
[ 2.623180] [<ffffffffa007ab61>] ? i5000_init_one+0x10b1/0x11a3 [i5000_edac]
[ 2.623362] [<ffffffff812d1244>] ? kernfs_add_one+0x164/0x1e0
[ 2.623543] [<ffffffff81479fe8>] ? pci_device_probe+0xa8/0x150
[ 2.623723] [<ffffffff8159a774>] ? driver_probe_device+0x104/0x380
[ 2.623868] [<ffffffff8159aa97>] ? __driver_attach+0xa7/0xe0
[ 2.623868] [<ffffffff8159a9f0>] ? driver_probe_device+0x380/0x380
[ 2.623868] [<ffffffff81597d73>] ? bus_for_each_dev+0x63/0xb0
[ 2.623868] [<ffffffff8159975f>] ? bus_add_driver+0x14f/0x2a0
[ 2.623868] [<ffffffffa0087000>] ? 0xffffffffa0087000
[ 2.623868] [<ffffffff8159b577>] ? driver_register+0x67/0x110
[ 2.623868] [<ffffffffa008702d>] ? i5000_init+0x2d/0x1000 [i5000_edac]
[ 2.623868] [<ffffffff810003b3>] ? do_one_initcall+0x93/0x230
[ 2.623868] [<ffffffff811e2f5a>] ? free_vmap_area_noflush+0x3a/0xb0
[ 2.623868] [<ffffffff8117fada>] ? do_init_module+0x8b/0x261
[ 2.623868] [<ffffffff8114068b>] ? load_module+0x1d2b/0x2e40
[ 2.623868] [<ffffffff8113d620>] ? resolve_symbol_wait+0x130/0x130
[ 2.623868] [<ffffffff811d8dee>] ? do_mmap+0x3ce/0x570
[ 2.623868] [<ffffffff81223d5f>] ? kernel_read_file_from_fd+0x3f/0x70
[ 2.623868] [<ffffffff81141952>] ? SYSC_finit_module+0xa2/0xb0
[ 2.623868] [<ffffffff81801b1b>] ? entry_SYSCALL_64_fastpath+0x13/0x8f
[ 2.623868] ================================================================================


--
Meelis Roos (mroos@xxxxxxxx)