pop-os / linux

Pop!_OS fork of https://launchpad.net/ubuntu/+source/linux
Other
110 stars 13 forks source link

UBSAN: shift exponent 4294967295 is too large for 32-bit type 'int' (after kernel 6.2.0 upgrade) #233

Closed ziprasidone146939277 closed 1 year ago

ziprasidone146939277 commented 1 year ago

Recently I've update to kernel 6.2.0. (6.2.0-76060200-generic) The upgrade process itself appeared to be OK; except for some warnings about Wireguard kernel module. (sorry I did not save the apt upgrade output)

Then started to see this in dmesg after reboot. I don't know what this does exactly means and what can will cause:

[Mon Mar  6 20:18:29 2023] ================================================================================
[Mon Mar  6 20:18:29 2023] UBSAN: shift-out-of-bounds in /build/linux-xT8vcZ/linux-6.2.0/drivers/mtd/spi-nor/core.c:2026:24
[Mon Mar  6 20:18:29 2023] shift exponent 4294967295 is too large for 32-bit type 'int'
[Mon Mar  6 20:18:29 2023] CPU: 4 PID: 503 Comm: systemd-udevd Tainted: P           OE      6.2.0-76060200-generic #202302191831~1677858327~22.04~3cea1be
[Mon Mar  6 20:18:29 2023] Hardware name: System76 Oryx Pro/Oryx Pro, BIOS 2022-07-20_ae6aa72 07/20/2022
[Mon Mar  6 20:18:29 2023] Call Trace:
[Mon Mar  6 20:18:29 2023]  <TASK>
[Mon Mar  6 20:18:29 2023]  show_stack+0x4e/0x61
[Mon Mar  6 20:18:29 2023]  dump_stack_lvl+0x4a/0x6f
[Mon Mar  6 20:18:29 2023]  dump_stack+0x10/0x18
[Mon Mar  6 20:18:29 2023]  ubsan_epilogue+0x9/0x3a
[Mon Mar  6 20:18:29 2023]  __ubsan_handle_shift_out_of_bounds.cold+0x61/0xef
[Mon Mar  6 20:18:29 2023]  spi_nor_set_erase_type.cold+0x16/0x1e [spi_nor]
[Mon Mar  6 20:18:29 2023]  spi_nor_parse_4bait+0x270/0x380 [spi_nor]
[Mon Mar  6 20:18:29 2023]  spi_nor_parse_sfdp+0x47f/0x610 [spi_nor]
[Mon Mar  6 20:18:29 2023]  spi_nor_sfdp_init_params_deprecated+0x46/0xc0 [spi_nor]
[Mon Mar  6 20:18:29 2023]  ? __pfx_spi_nor_sr1_bit6_quad_enable+0x10/0x10 [spi_nor]
[Mon Mar  6 20:18:29 2023]  ? __pfx_spi_nor_set_4byte_addr_mode+0x10/0x10 [spi_nor]
[Mon Mar  6 20:18:29 2023]  spi_nor_init_params+0x1d8/0x200 [spi_nor]
[Mon Mar  6 20:18:29 2023]  spi_nor_scan+0x204/0x590 [spi_nor]
[Mon Mar  6 20:18:29 2023]  spi_nor_probe+0xa2/0x330 [spi_nor]
[Mon Mar  6 20:18:29 2023]  ? _raw_spin_lock_irqsave+0xe/0x20
[Mon Mar  6 20:18:29 2023]  ? devres_add+0x6f/0xf0
[Mon Mar  6 20:18:29 2023]  spi_mem_probe+0x7b/0xd0
[Mon Mar  6 20:18:29 2023]  spi_probe+0x58/0xa0
[Mon Mar  6 20:18:29 2023]  really_probe+0xf6/0x3b0
[Mon Mar  6 20:18:29 2023]  ? pm_runtime_barrier+0x55/0xa0
[Mon Mar  6 20:18:29 2023]  __driver_probe_device+0x8c/0x1a0
[Mon Mar  6 20:18:29 2023]  driver_probe_device+0x24/0xd0
[Mon Mar  6 20:18:29 2023]  __driver_attach+0x10b/0x210
[Mon Mar  6 20:18:29 2023]  ? __pfx___driver_attach+0x10/0x10
[Mon Mar  6 20:18:29 2023]  bus_for_each_dev+0x8d/0xe0
[Mon Mar  6 20:18:29 2023]  driver_attach+0x1e/0x30
[Mon Mar  6 20:18:29 2023]  bus_add_driver+0x1d0/0x220
[Mon Mar  6 20:18:29 2023]  driver_register+0x8f/0x100
[Mon Mar  6 20:18:29 2023]  __spi_register_driver+0x97/0xe0
[Mon Mar  6 20:18:29 2023]  ? __pfx_init_module+0x10/0x10 [spi_nor]
[Mon Mar  6 20:18:29 2023]  spi_mem_driver_register_with_owner+0x2f/0x40
[Mon Mar  6 20:18:29 2023]  spi_nor_driver_init+0x1c/0xff0 [spi_nor]
[Mon Mar  6 20:18:29 2023]  do_one_initcall+0x5b/0x250
[Mon Mar  6 20:18:29 2023]  do_init_module+0x50/0x210
[Mon Mar  6 20:18:29 2023]  load_module+0xb43/0xc30
[Mon Mar  6 20:18:29 2023]  __do_sys_finit_module+0xc4/0x140
[Mon Mar  6 20:18:29 2023]  ? __do_sys_finit_module+0xc4/0x140
[Mon Mar  6 20:18:29 2023]  __x64_sys_finit_module+0x18/0x30
[Mon Mar  6 20:18:29 2023]  do_syscall_64+0x58/0x90
[Mon Mar  6 20:18:29 2023]  ? irqentry_exit_to_user_mode+0x9/0x20
[Mon Mar  6 20:18:29 2023]  ? irqentry_exit+0x43/0x50
[Mon Mar  6 20:18:29 2023]  ? sysvec_call_function+0x4b/0xd0
[Mon Mar  6 20:18:29 2023]  entry_SYSCALL_64_after_hwframe+0x72/0xdc
[Mon Mar  6 20:18:29 2023] RIP: 0033:0x7f5ccff1ea3d
[Mon Mar  6 20:18:29 2023] Code: 5b 41 5c c3 66 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d c3 a3 0f 00 f7 d8 64 89 01 48
[Mon Mar  6 20:18:29 2023] RSP: 002b:00007fff85ab1158 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[Mon Mar  6 20:18:29 2023] RAX: ffffffffffffffda RBX: 0000557e0bb69a50 RCX: 00007f5ccff1ea3d
[Mon Mar  6 20:18:29 2023] RDX: 0000000000000000 RSI: 00007f5cd0224441 RDI: 000000000000000f
[Mon Mar  6 20:18:29 2023] RBP: 0000000000020000 R08: 0000000000000000 R09: 0000000000000002
[Mon Mar  6 20:18:29 2023] R10: 000000000000000f R11: 0000000000000246 R12: 00007f5cd0224441
[Mon Mar  6 20:18:29 2023] R13: 0000557e0bc56d60 R14: 0000557e0bb4ebf0 R15: 0000557e0bc561a0
[Mon Mar  6 20:18:29 2023]  </TASK>
[Mon Mar  6 20:18:29 2023] ================================================================================
ziprasidone146939277 commented 1 year ago

It seems that this commit fixes it https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f0f0cfdc3a024e21161714f2e05f0df3b84d42ad

I wonder if meanwhile, this is harmless.

ziprasidone146939277 commented 1 year ago

Should this PR #241 resolve this? If that is the case; this should be closed.

ziprasidone146939277 commented 1 year ago

Thank You very much. As I reported this, I confirm (I think that I should to) that the PR 241, made that messages about UBSAN in dmesg disappeared. Sorry for the delay.

dmesg.log