upstream boot error: KASAN: slab-out-of-bounds Read in deactivate_slab

Status: auto-obsoleted due to no activity on 2023/12/27 21:10
Subsystems: mm
[Documentation on labels]
First crash: 191d, last: 156d
Discussions (2)
Title Replies (including bot) Last reply
[syzbot] Monthly mm report (Sep 2023) 0 (1) 2023/09/11 10:07
[syzbot] [mm?] upstream boot error: KASAN: slab-out-of-bounds Read in deactivate_slab 0 (1) 2023/08/19 07:49

Sample crash report:
Booting Linux on physical CPU 0x0000000000 [0x000f0510]
Linux version 6.6.0-rc2-syzkaller-00018-g2cf0f7156238 (syzkaller@syzkaller) (aarch64-linux-gnu-gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #0 SMP PREEMPT now
random: crng init done
Machine model: linux,dummy-virt
efi: UEFI not found.
NUMA: No NUMA configuration found
NUMA: Faking a node at [mem 0x0000000040000000-0x00000000bfffffff]
NUMA: NODE_DATA [mem 0xbf9f4000-0xbf9f6fff]
Zone ranges:
  DMA      [mem 0x0000000040000000-0x00000000bfffffff]
  DMA32    empty
  Normal   empty
  Device   empty
Movable zone start for each node
Early memory node ranges
  node   0: [mem 0x0000000040000000-0x00000000bfffffff]
Initmem setup node 0 [mem 0x0000000040000000-0x00000000bfffffff]
cma: Reserved 32 MiB at 0x00000000bb800000 on node -1
psci: probing for conduit method from DT.
psci: PSCIv1.1 detected in firmware.
psci: Using standard PSCI v0.2 function IDs
psci: Trusted OS migration not required
psci: SMC Calling Convention v1.0
percpu: Embedded 22 pages/cpu s51336 r8192 d30584 u90112
Detected PIPT I-cache on CPU0
CPU features: detected: Address authentication (architected QARMA5 algorithm)
CPU features: detected: HCRX_EL2 register
CPU features: detected: Virtualization Host Extensions
CPU features: detected: Hardware dirty bit management
CPU features: detected: Memory Tagging Extension
CPU features: detected: Asymmetric MTE Tag Check Fault
CPU features: detected: Spectre-v4
MTE: enabled in synchronous mode at EL1
alternatives: applying boot alternatives
kasan: KernelAddressSanitizer initialized (hw-tags, mode=sync, vmalloc=on, stacktrace=on)
Kernel command line: root=/dev/vda console=ttyAMA0 
Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
Fallback order for Node 0: 0 
Built 1 zonelists, mobility grouping on.  Total pages: 516096
Policy zone: DMA
mem auto-init: stack:all(zero), heap alloc:on, heap free:off
stackdepot: allocating hash table via alloc_large_system_hash
stackdepot hash table entries: 1048576 (order: 11, 8388608 bytes, linear)
software IO TLB: area num 2.
software IO TLB: mapped [mem 0x00000000b6d00000-0x00000000bad00000] (64MB)
Memory: 1904632K/2097152K available (25280K kernel code, 2454K rwdata, 10152K rodata, 1408K init, 1185K bss, 159752K reserved, 32768K cma-reserved)
BUG: KASAN: slab-out-of-bounds in __ll_sc__cmpxchg_case_acq_32 arch/arm64/include/asm/atomic_ll_sc.h:284 [inline]
BUG: KASAN: slab-out-of-bounds in __cmpxchg_case_acq_32 arch/arm64/include/asm/cmpxchg.h:120 [inline]
BUG: KASAN: slab-out-of-bounds in __cmpxchg_acq arch/arm64/include/asm/cmpxchg.h:169 [inline]
BUG: KASAN: slab-out-of-bounds in raw_atomic_cmpxchg_acquire include/linux/atomic/atomic-arch-fallback.h:2044 [inline]
BUG: KASAN: slab-out-of-bounds in raw_atomic_try_cmpxchg_acquire include/linux/atomic/atomic-arch-fallback.h:2158 [inline]
BUG: KASAN: slab-out-of-bounds in atomic_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:1296 [inline]
BUG: KASAN: slab-out-of-bounds in queued_spin_lock include/asm-generic/qspinlock.h:111 [inline]
BUG: KASAN: slab-out-of-bounds in do_raw_spin_lock include/linux/spinlock.h:187 [inline]
BUG: KASAN: slab-out-of-bounds in __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
BUG: KASAN: slab-out-of-bounds in _raw_spin_lock_irqsave+0x5c/0x8c kernel/locking/spinlock.c:162
Read at addr f2ff000002c00000 by task swapper/0
Pointer tag: [f2], memory tag: [fa]

CPU: 0 PID: 0 Comm: swapper Not tainted 6.6.0-rc2-syzkaller-00018-g2cf0f7156238 #0
Hardware name: linux,dummy-virt (DT)
Call trace:
 dump_backtrace+0x94/0xec arch/arm64/kernel/stacktrace.c:233
 show_stack+0x18/0x24 arch/arm64/kernel/stacktrace.c:240
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x48/0x60 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:364 [inline]
 print_report+0x108/0x618 mm/kasan/report.c:475
 kasan_report+0x88/0xac mm/kasan/report.c:588
 report_tag_fault arch/arm64/mm/fault.c:334 [inline]
 do_tag_recovery arch/arm64/mm/fault.c:346 [inline]
 __do_kernel_fault+0x17c/0x1e8 arch/arm64/mm/fault.c:393
 do_bad_area arch/arm64/mm/fault.c:493 [inline]
 do_tag_check_fault+0x78/0x8c arch/arm64/mm/fault.c:770
 do_mem_abort+0x44/0x94 arch/arm64/mm/fault.c:846
 el1_abort+0x40/0x60 arch/arm64/kernel/entry-common.c:398
 el1h_64_sync_handler+0xd8/0xe4 arch/arm64/kernel/entry-common.c:458
 el1h_64_sync+0x64/0x68 arch/arm64/kernel/entry.S:586
 __ll_sc__cmpxchg_case_acq_32 arch/arm64/include/asm/atomic_ll_sc.h:284 [inline]
 __cmpxchg_case_acq_32 arch/arm64/include/asm/cmpxchg.h:120 [inline]
 __cmpxchg_acq arch/arm64/include/asm/cmpxchg.h:169 [inline]
 raw_atomic_cmpxchg_acquire include/linux/atomic/atomic-arch-fallback.h:2044 [inline]
 raw_atomic_try_cmpxchg_acquire include/linux/atomic/atomic-arch-fallback.h:2158 [inline]
 atomic_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:1296 [inline]
 queued_spin_lock include/asm-generic/qspinlock.h:111 [inline]
 do_raw_spin_lock include/linux/spinlock.h:187 [inline]
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
 _raw_spin_lock_irqsave+0x5c/0x8c kernel/locking/spinlock.c:162
 deactivate_slab+0x1f8/0x510 mm/slub.c:2570
 __flush_cpu_slab mm/slub.c:2778 [inline]
 bootstrap+0x8c/0x174 mm/slub.c:5006
 kmem_cache_init+0x144/0x1c8 mm/slub.c:5059
 mm_core_init+0x240/0x2d4 mm/mm_init.c:2780
 start_kernel+0x220/0x5fc init/main.c:928
 __primary_switched+0xb4/0xbc arch/arm64/kernel/head.S:523

Allocated by task 0:
 kasan_save_stack+0x3c/0x64 mm/kasan/common.c:45
 save_stack_info+0x38/0x118 mm/kasan/tags.c:104
 kasan_save_alloc_info+0x14/0x20 mm/kasan/tags.c:138
 __kasan_slab_alloc+0x94/0xcc mm/kasan/common.c:328
 kasan_slab_alloc include/linux/kasan.h:188 [inline]
 early_kmem_cache_node_alloc mm/slub.c:4276 [inline]
 init_kmem_cache_nodes mm/slub.c:4318 [inline]
 kmem_cache_open mm/slub.c:4557 [inline]
 __kmem_cache_create+0x388/0x688 mm/slub.c:5113
 create_boot_cache+0x70/0xb8 mm/slab_common.c:652
 kmem_cache_init+0xec/0x1c8 mm/slub.c:5045
 mm_core_init+0x240/0x2d4 mm/mm_init.c:2780
 start_kernel+0x220/0x5fc init/main.c:928
 __primary_switched+0xb4/0xbc arch/arm64/kernel/head.S:523

The buggy address belongs to the object at ffff000002c00000
 which belongs to the cache kmem_cache_node of size 64
The buggy address is located 0 bytes inside of
 64-byte region [ffff000002c00000, ffff000002c00040)

The buggy address belongs to the physical page:
page:(____ptrval____) refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x42c00
flags: 0x1ffc00000000800(slab|node=0|zone=0|lastcpupid=0x7ff|kasantag=0x0)
page_type: 0xffffffff()
raw: 01ffc00000000800 ffff8000823d6ae8 dead000000000100 dead000000000122
raw: 0000000000000000 0000000080400040 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff000002bffe00: f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 f0
 ffff000002bfff00: f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 f0
>ffff000002c00000: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
 ffff000002c00100: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
 ffff000002c00200: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
rcu: Preemptible hierarchical RCU implementation.
rcu: 	RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=2.
	Trampoline variant of Tasks RCU enabled.
	Tracing variant of Tasks RCU enabled.
rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
Root IRQ handler: gic_handle_irq
GIC: Using split EOI/Deactivate mode
GICv2m: range[mem 0x08020000-0x08020fff], SPI[80:143]
rcu: srcu_init: Setting srcu_struct sizes based on contention.
arch_timer: cp15 timer(s) running at 62.50MHz (phys).
clocksource: arch_sys_counter: mask: 0x1ffffffffffffff max_cycles: 0x1cd42e208c, max_idle_ns: 881590405314 ns
sched_clock: 57 bits at 63MHz, resolution 16ns, wraps every 4398046511096ns
kfence: initialized - using 2097152 bytes for 255 objects at 0x(____ptrval____)-0x(____ptrval____)
Console: colour dummy device 80x25
Calibrating delay loop (skipped), value calculated using timer frequency.. 125.00 BogoMIPS (lpj=625000)
pid_max: default: 32768 minimum: 301
LSM: initializing lsm=lockdown,capability,landlock,yama,safesetid,tomoyo,smack,integrity
landlock: Up and running.
Yama: becoming mindful.
TOMOYO Linux initialized
Smack:  Initializing.
Smack:  Netfilter enabled.
Smack:  IPv6 Netfilter enabled.
Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
Detected PIPT I-cache on CPU1
CPU1: Booted secondary processor 0x0000000001 [0x000f0510]

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/09/18 21:09 upstream 2cf0f7156238 0b6a67ac .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64-mte upstream boot error: KASAN: slab-out-of-bounds Read in deactivate_slab
2023/08/29 19:58 upstream bd6c11bc43c4 ce731e62 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64-mte upstream boot error: KASAN: slab-out-of-bounds Read in deactivate_slab
2023/08/18 08:54 upstream 0e8860d2125f 937e0ad7 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64-mte upstream boot error: KASAN: slab-out-of-bounds Read in deactivate_slab
2023/08/15 07:41 upstream 91aa6c412d7f 39990d51 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64-mte upstream boot error: KASAN: slab-out-of-bounds Read in deactivate_slab
* Struck through repros no longer work on HEAD.