Comment 16 for bug 1958770

Revision history for this message
bsdz (blairuk) wrote :

This doesn't seem to resolve it for me. It's been a long time since I recompiled kernel modules, these are the steps I took:

# module compile instructions from https://wiki.ubuntu.com/Kernel/SourceCode

$ uname -r
5.15.0-18-generic
$ git clone git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy linux-jammy
$ cd linux-jammy
$ git checkout Ubuntu-5.15.0-18.18
$ cd drivers/net/ethernet/aquantia/atlantic
# edit Makefile and add fq path to Include:
# ccflags-y += -I$(srctree)/$(src) -I/blahblah/linux-jammy/drivers/net/ethernet/aquantia/atlantic
$ make -C /lib/modules/`uname -r`/build M=$PWD
...
$ sudo modprobe -v -r atlantic
rmmod atlantic
rmmod macsec
$ sudo cp atlantic.ko /lib/modules/5.15.0-18-generic/kernel/drivers/net/ethernet/aquantia/atlantic/
$ sudo modprobe -v atlantic
insmod /lib/modules/5.15.0-18-generic/kernel/drivers/net/macsec.ko
insmod /lib/modules/5.15.0-18-generic/kernel/drivers/net/ethernet/aquantia/atlantic/atlantic.ko
$ sudo dmesg
14218.647296] ================================================================================
[14218.647297] UBSAN: array-index-out-of-bounds in /blahblah/linux-jammy/drivers/net/ethernet/aquantia/atlantic/aq_nic.c:515:49
[14218.647299] index 8 is out of range for type 'aq_vec_s *[8]'
[14218.647300] CPU: 4 PID: 2680 Comm: NetworkManager Tainted: P OE 5.15.0-18-generic #18-Ubuntu
[14218.647301] Hardware name: Gigabyte Technology Co., Ltd. X399 AORUS XTREME/X399 AORUS XTREME-CF, BIOS F5 12/11/2019
[14218.647302] Call Trace:
[14218.647302] <TASK>
[14218.647303] show_stack+0x52/0x58
[14218.647304] dump_stack_lvl+0x4a/0x5f
[14218.647306] dump_stack+0x10/0x12
[14218.647307] ubsan_epilogue+0x9/0x45
[14218.647308] __ubsan_handle_out_of_bounds.cold+0x44/0x49
[14218.647309] ? aq_vec_ring_free+0x80/0x80 [atlantic]
[14218.647316] aq_nic_start+0x3c3/0x3d0 [atlantic]
[14218.647322] aq_ndev_open+0x49/0x70 [atlantic]
[14218.647329] __dev_open+0xf3/0x1c0
[14218.647331] __dev_change_flags+0x1a3/0x220
[14218.647332] ? __nla_validate_parse+0x14b/0x1a0
[14218.647334] dev_change_flags+0x26/0x60
[14218.647335] do_setlink+0x28a/0xc50
[14218.647337] ? inet6_set_link_af+0x4e/0xb0
[14218.647338] ? cpumask_next+0x23/0x30
[14218.647340] ? __nla_validate_parse+0x4c/0x1a0
[14218.647341] ? __snmp6_fill_stats64.constprop.0+0x121/0x150
[14218.647342] __rtnl_newlink+0x608/0xa10
[14218.647344] ? __nla_reserve+0x41/0x50
[14218.647345] ? skb_free_head+0x68/0x80
[14218.647347] ? cpumask_next_and+0x24/0x30
[14218.647348] ? update_sg_lb_stats+0x7c/0x4f0
[14218.647349] ? cpufreq_driver_resolve_freq+0x10/0x20
[14218.647351] ? get_next_freq+0x65/0x90
[14218.647352] ? sugov_get_util+0x77/0xa0
[14218.647353] ? sugov_update_single_freq+0xf1/0x220
[14218.647354] ? sugov_exit+0xb0/0xb0
[14218.647357] ? kmem_cache_alloc_trace+0x19e/0x2e0
[14218.647359] rtnl_newlink+0x49/0x70
[14218.647360] rtnetlink_rcv_msg+0x15d/0x400
[14218.647362] ? rtnl_calcit.isra.0+0x130/0x130
[14218.647363] netlink_rcv_skb+0x55/0x100
[14218.647365] rtnetlink_rcv+0x15/0x20
[14218.647366] netlink_unicast+0x21d/0x330
[14218.647367] netlink_sendmsg+0x24c/0x4c0
[14218.647369] sock_sendmsg+0x65/0x70
[14218.647370] ____sys_sendmsg+0x24e/0x290
[14218.647372] ? import_iovec+0x31/0x40
[14218.647374] ? sendmsg_copy_msghdr+0x7b/0xa0
[14218.647375] ? rtnl_unlock+0xe/0x10
[14218.647376] ___sys_sendmsg+0x81/0xc0
[14218.647378] ? kvfree+0x2a/0x30
[14218.647380] ? proc_sys_call_handler+0x1c9/0x290
[14218.647381] ? __fget_files+0xa3/0xd0
[14218.647383] ? __fget_light+0x32/0x80
[14218.647384] __sys_sendmsg+0x62/0xb0
[14218.647386] __x64_sys_sendmsg+0x1d/0x20
[14218.647388] do_syscall_64+0x5c/0xc0
[14218.647389] ? exit_to_user_mode_prepare+0x37/0xb0
[14218.647391] ? syscall_exit_to_user_mode+0x27/0x50
[14218.647392] ? __do_sys_gettid+0x1b/0x20
[14218.647394] ? do_syscall_64+0x69/0xc0
[14218.647395] ? exit_to_user_mode_loop+0x10d/0x160
[14218.647396] ? exit_to_user_mode_prepare+0x37/0xb0
[14218.647398] ? syscall_exit_to_user_mode+0x27/0x50
[14218.647399] ? __do_sys_gettid+0x1b/0x20
[14218.647400] ? do_syscall_64+0x69/0xc0
[14218.647401] ? exit_to_user_mode_prepare+0x37/0xb0
[14218.647403] ? syscall_exit_to_user_mode+0x27/0x50
[14218.647404] ? __x64_sys_close+0x11/0x40
[14218.647406] ? do_syscall_64+0x69/0xc0
[14218.647407] ? __do_sys_gettid+0x1b/0x20
[14218.647408] ? do_syscall_64+0x69/0xc0
[14218.647409] ? sysvec_apic_timer_interrupt+0x4e/0x90
[14218.647410] ? asm_sysvec_apic_timer_interrupt+0xa/0x20
[14218.647412] entry_SYSCALL_64_after_hwframe+0x44/0xae
[14218.647413] RIP: 0033:0x7efccf117ccd
[14218.647414] Code: 28 89 54 24 1c 48 89 74 24 10 89 7c 24 08 e8 ba 8d f6 ff 8b 54 24 1c 48 8b 74 24 10 41 89 c0 8b 7c 24 08 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 33 44 89 c7 48 89 44 24 08 e8 fe 8d f6 ff 48
[14218.647415] RSP: 002b:00007ffe6ee42d70 EFLAGS: 00000293 ORIG_RAX: 000000000000002e
[14218.647417] RAX: ffffffffffffffda RBX: 00000000000000f5 RCX: 00007efccf117ccd
[14218.647418] RDX: 0000000000000000 RSI: 00007ffe6ee42db0 RDI: 000000000000000c
[14218.647419] RBP: 000055d5609c6040 R08: 0000000000000000 R09: 0000000000000000
[14218.647419] R10: 0000000000000000 R11: 0000000000000293 R12: 00007efcb4005500
[14218.647420] R13: 00007ffe6ee42f00 R14: 0000000000000000 R15: 0000000000000000
[14218.647422] </TASK>
[14218.647422] ================================================================================

(some steps might be missed, eg I had to play around with module signing too as well as run depmod shell script).

Admittedly, I could be missing something.