For those who don't know, UBSAN is Undefined Behavior Address Sanitizer, and it places a whole bunch of checks in a compiled piece of code to detect mistakes, such as out-of-bounds access and various other operations which aren't supposed to happen in the code. When I program stuff I've used UBSAN before to catch bugs, but I definitely don't compile with it on most of the times, and would never think of doing so for a release build.
And yet, I had a crash on my computer which, I think, tell me if I'm wrong, would seem to indicate that the Linux kernel is running with UBSAN on? ie., was compiled with UBSAN turned on.
Here is part of the crash log (journalctl) from my system. It is Linux Mint 22.2 Cinnamon, kernel version 6.8.0-87-generic:
Nov 27 09:35:26 kernel: Bluetooth: hci0: Opcode 0x0c03 failed: -110
Nov 27 09:35:28 lightdm[1836]: gkr-pam: couldn't unlock the login keyring.
Nov 27 09:35:30 systemd[1]: Failed to start casper-md5check.service - casper-md5check Verify Live ISO checksums.
Nov 27 09:35:34 lightdm[1989]: gkr-pam: unable to locate daemon control file
Nov 27 09:35:34 systemd[2044]: Failed to start fluidsynth.service - FluidSynth Daemon.
Nov 27 09:38:17 kernel: UBSAN: array-index-out-of-bounds in /var/lib/dkms/8812au/5.6.4.2_35491.20191025/build/core/rtw_wlan_util.c:1905:48
Nov 27 09:38:17 kernel: index 1 is out of range for type 'u8 [1]'
Nov 27 09:38:17 kernel: UBSAN: array-index-out-of-bounds in /var/lib/dkms/8812au/5.6.4.2_35491.20191025/build/core/rtw_wlan_util.c:1910:75
Nov 27 09:38:17 kernel: index 2 is out of range for type 'u8 [1]'
Nov 27 09:38:17 kernel: UBSAN: array-index-out-of-bounds in /var/lib/dkms/8812au/5.6.4.2_35491.20191025/build/core/rtw_wlan_util.c:1916:76
Nov 27 09:38:17 kernel: index 2 is out of range for type 'u8 [1]'
Nov 27 09:38:17 kernel: UBSAN: array-index-out-of-bounds in /var/lib/dkms/8812au/5.6.4.2_35491.20191025/build/os_dep/linux/ioctl_cfg80211.c:1682:110
Nov 27 09:38:17 kernel: index 16 is out of range for type 'u8 [*]'
Nov 27 09:38:17 kernel: UBSAN: array-index-out-of-bounds in /var/lib/dkms/8812au/5.6.4.2_35491.20191025/build/os_dep/linux/ioctl_cfg80211.c:1683:110
Nov 27 09:38:17 kernel: index 24 is out of range for type 'u8 [*]'
Why is showing UBSAN? I thought that only happens when something is compiled with UBSAN turned on. Are Release Linux kernels compiled with UBSAN on?