[Bug 1958770] Re: Aquantia GbE LAN driver causes UBSAN error during kernel boot
I'm not 100% sure if I loaded the new module correctly, but I believe that I did. Here are the steps I took to compile the module and load it, which resulted in the output of #21: git clone git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy linux-jammy cd linux-jammy/ uname -r git checkout Ubuntu-5.15.0-25.25 cd drivers/net/ethernet/aquantia/atlantic nano Makefile # added PWD to ccflags line nano aq_vec.c.patch nano aq_nic.c.patch patch < aq_vec.c.patch patch < aq_nic.c.patch nano aq_vec.c make -C /lib/modules/`uname -r`/build M=$PWD sudo modprobe -v -r atlantic sudo rmmod atlantic sudo rmmod macsec sudo cp atlantic.ko /lib/modules/5.15.0-25-generic/kernel/drivers/net/ethernet/aquantia/atlantic/ sudo modprobe -v atlantic sudo dmesg I have tried including stdio.h and adding a printf to verify the new module was indeed loaded, but that kept failing with "no such file" errors when trying to compile, even though I have build-essentials installed. I have tried compiling the module with the files from https://github.com/torvalds/linux/tree/master/drivers/net/ethernet/aquantia/atlantic, however that errors out with "implicit declaration of function ‘platform_get_ethdev_address’ [-Werror=implicit-function-declaration]". A quick google search revealed that this is supposedly a 'new' function which isn't present in 5.15.0 yet, though I might be wrong. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1958770 Title: Aquantia GbE LAN driver causes UBSAN error during kernel boot To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1958770/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1958770] Re: Aquantia GbE LAN driver causes UBSAN error during kernel boot
I'm gonna chime in too. I have applied both patches from #18 and #20 and recompiled the module, however I still get the UBSAN: array-index-out- of-bounds messsage. NIC seems to work though. I am not a programmer, so unfortunately I can't come up with a solution, but I am willing to test. Kernel: 5.15.0-25-generic MB: ASRock Fatal1ty X399 Professional Gaming NIC: Aquantia AQC107 ** Attachment added: "dmesg.log" https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1958770/+attachment/5583560/+files/dmesg.log -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1958770 Title: Aquantia GbE LAN driver causes UBSAN error during kernel boot To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1958770/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1958770] Re: Aquantia GbE LAN driver causes UBSAN error during kernel boot
Sorry. Like this? for (tc = 0U; tc < self->aq_nic_cfg.tcs; tc++) { for (i = 0U; self->aq_vecs > i; ++i) { aq_vec = self->aq_vec[i]; if (!aq_vec) break; data += count; count = aq_vec_get_sw_stats(aq_vec, tc, data); } } -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1958770 Title: Aquantia GbE LAN driver causes UBSAN error during kernel boot To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1958770/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1958770] Re: Aquantia GbE LAN driver causes UBSAN error during kernel boot
I have implemented your suggestion, so far no issues. I'm going to kick off my backup now and do some more testing later. ** Patch added: "aq_nic.c.patch" https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1958770/+attachment/5589366/+files/aq_nic.c.patch -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1958770 Title: Aquantia GbE LAN driver causes UBSAN error during kernel boot To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1958770/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1958770] Re: Aquantia GbE LAN driver causes UBSAN error during kernel boot
How would I go about doing so, while giving credit to bsdz and you? -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1958770 Title: Aquantia GbE LAN driver causes UBSAN error during kernel boot To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1958770/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1958770] Re: Aquantia GbE LAN driver causes UBSAN error during kernel boot
OK, so far everything seems to be working great. Performance is good, no UBSAN messages, no other abnormalities. I think we are good now. ** Patch added: "aq_nic.c.patch" https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1958770/+attachment/5589555/+files/aq_nic.c.patch -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1958770 Title: Aquantia GbE LAN driver causes UBSAN error during kernel boot To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1958770/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1958770] Re: Aquantia GbE LAN driver causes UBSAN error during kernel boot
Thank you @bsdz, compiles and works flawlessly since yesterday. UBSAN is happy, performance is as expected. @kaihengfeng, is this patch suitable for inclusion upstream? ** Patch added: "aq_nic.c.patch" https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1958770/+attachment/5589243/+files/aq_nic.c.patch ** Patch removed: "aq_nic.c.diff" https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1958770/+attachment/5588496/+files/aq_nic.c.diff -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1958770 Title: Aquantia GbE LAN driver causes UBSAN error during kernel boot To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1958770/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1958770] Re: Aquantia GbE LAN driver causes UBSAN error during kernel boot
I tried changing the function, now the module doesn't compile. EDIT: Sorry, forgot to close the curly bracket... -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1958770 Title: Aquantia GbE LAN driver causes UBSAN error during kernel boot To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1958770/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1958770] Re: Aquantia GbE LAN driver causes UBSAN error during kernel boot
I have successfully modified two of the mentioned three functions and tested the module, so far UBSAN does not complain anymore :) Unfdortunately I can't rewrite the third function, since it does not match the pattern (and I have no idea what I'm doing) for (tc = 0U; tc < self->aq_nic_cfg.tcs; tc++) { for (i = 0U, aq_vec = self->aq_vec[0]; aq_vec && self->aq_vecs > i; ++i, aq_vec = self->aq_vec[i]) { data += count; count = aq_vec_get_sw_stats(aq_vec, tc, data); } } I have included a diff for the other two functions. ** Patch added: "aq_nic.c.diff" https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1958770/+attachment/5588496/+files/aq_nic.c.diff -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1958770 Title: Aquantia GbE LAN driver causes UBSAN error during kernel boot To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1958770/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1958770] Re: Aquantia GbE LAN driver causes UBSAN error during kernel boot
Sorry for the delay, life happened... After mucking about with this for the past few days and not being able to get the module to compile on 5.15 for the life of me (always same error "implicit declaration of function ‘platform_get_ethdev_address’ [-Werror=implicit-function-declaration]"), I have decided to just build 5.18-rc6 out of desperation. I figured the changes should be included by now, though I'm not sure and don't know how to check... This is what I did: sudo apt install alien autoconf bison build-essential ccache fakeroot flex gawk git libattr1-dev libblkid-dev libdevmapper-dev libelf-dev libncurses5-dev libselinux-dev libssl-dev libtool libudev-dev linux-headers-$(uname -r) uuid-dev zlib1g-dev mkdir build cd build git clone git://git.launchpad.net/~ubuntu-kernel-test/ubuntu/+source/linux/+git/mainline-crack ubuntu_kernel cd ubuntu_kernel git checkout tags/v5.18-rc6 cp /boot/config-"$(uname -r)" .config yes '' | make oldconfig make prepare scripts cd .. git clone https://github.com/zfsonlinux/zfs.git cd zfs git checkout zfs-2.1.5-staging sh autogen.sh ./configure --prefix=/ --libdir=/lib --includedir=/usr/include --datarootdir=/usr/share --enable-linux-builtin=yes --with-linux=$HOME/build/ubuntu_kernel --with-linux-obj=$HOME/build/ubuntu_kernel ./copy-builtin $HOME/build/ubuntu_kernel cd ../ubuntu_kernel make menuconfig # include zfs scripts/config --set-str SYSTEM_TRUSTED_KEYS "" scripts/config --set-str CONFIG_SYSTEM_REVOCATION_KEYS "" make clean make -j 16 bindeb-pkg LOCALVERSION=-aq107-test cd .. sudo apt install ./linux-headers-5.18.0-rc6-aq107-test_5.18.0-rc6-aq107-test-1_amd64.deb ./linux-image-5.18.0-rc6-aq107-test_5.18.0-rc6-aq107-test-1_amd64.deb After a reboot I seem to get exactly the same error, stack trace is near the bottom of the log. What should I do now? -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1958770 Title: Aquantia GbE LAN driver causes UBSAN error during kernel boot To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1958770/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1958770] Re: Aquantia GbE LAN driver causes UBSAN error during kernel boot
** Attachment added: "dmesg.log" https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1958770/+attachment/5588060/+files/dmesg.log -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1958770 Title: Aquantia GbE LAN driver causes UBSAN error during kernel boot To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1958770/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs