Greeting, FYI, we noticed UBSAN:array-index-out-of-bounds_in_fs/namespace.c due to commit (built with gcc-11): commit: 0fc58d2df77109ff6f18a334b1479e7b5fd9449e ("vfs: prepare for mount write barrier") https://github.com/amir73il/linux mnt_write_barrier in testcase: boot on test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 16G caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace): If you fix the issue, kindly add following tag | Reported-by: kernel test robot | Link: https://lore.kernel.org/oe-lkp/202211240919.3dafb6ca-oliver.sang@intel.com [ 0.690640][ T0] UBSAN: array-index-out-of-bounds in fs/namespace.c:223:19 [ 0.691494][ T0] index 2 is out of range for type 'int [2]' [ 0.692135][ T0] CPU: 0 PID: 0 Comm: swapper Not tainted 6.1.0-rc4-00019-g0fc58d2df771 #1 [ 0.693059][ T0] Call Trace: [ 0.693417][ T0] dump_stack_lvl (??:?) [ 0.693924][ T0] dump_stack (??:?) [ 0.694383][ T0] ubsan_epilogue (ubsan.c:?) [ 0.694919][ T0] __ubsan_handle_out_of_bounds (??:?) [ 0.695487][ T0] ? kstrdup (??:?) [ 0.695487][ T0] alloc_vfsmnt (namespace.c:?) [ 0.695487][ T0] vfs_create_mount (??:?) [ 0.695487][ T0] vfs_kern_mount (??:?) [ 0.695487][ T0] ? shmem_parse_one (shmem.c:?) [ 0.695487][ T0] kern_mount (??:?) [ 0.695487][ T0] shmem_init (??:?) [ 0.695487][ T0] mnt_init (??:?) [ 0.695487][ T0] ? files_init (??:?) [ 0.695487][ T0] vfs_caches_init (??:?) [ 0.695487][ T0] start_kernel (??:?) [ 0.695487][ T0] i386_start_kernel (??:?) [ 0.695487][ T0] startup_32_smp (??:?) [ 0.695491][ T0] ================================================================================ [ 0.699894][ T0] Last level iTLB entries: 4KB 0, 2MB 0, 4MB 0 [ 0.700578][ T0] Last level dTLB entries: 4KB 0, 2MB 0, 4MB 0, 1GB 0 [ 0.701319][ T0] CPU: Intel Xeon E312xx (Sandy Bridge) (family: 0x6, model: 0x2a, stepping: 0x1) To reproduce: # build kernel cd linux cp config-6.1.0-rc4-00019-g0fc58d2df771 .config make HOSTCC=gcc-11 CC=gcc-11 ARCH=i386 olddefconfig prepare modules_prepare bzImage modules make HOSTCC=gcc-11 CC=gcc-11 ARCH=i386 INSTALL_MOD_PATH= modules_install cd find lib/ | cpio -o -H newc --quiet | gzip > modules.cgz git clone https://github.com/intel/lkp-tests.git cd lkp-tests bin/lkp qemu -k -m modules.cgz job-script # job-script is attached in this email # if come across any failure that blocks the test, # please remove ~/.lkp and /lkp dir to run from a clean state. -- 0-DAY CI Kernel Test Service https://01.org/lkp