loop7: detected capacity change from 0 to 16
EXT4-fs (loop7): bad geometry: block count 64 exceeds size of device (2 blocks)
==================================================================
BUG: KASAN: slab-use-after-free in xfrm_alloc_spi+0xf67/0x1210
Read of size 4 at addr ffff88800a160944 by task syz-executor.4/5832
CPU: 1 UID: 0 PID: 5832 Comm: syz-executor.4 Not tainted 6.16.0-next-20250805 #1 PREEMPT(voluntary)
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
Call Trace:
dump_stack_lvl+0xca/0x120
print_report+0xcb/0x610
kasan_report+0xca/0x100
xfrm_alloc_spi+0xf67/0x1210
xfrm_alloc_userspi+0x607/0xbb0
xfrm_user_rcv_msg+0x459/0xa00
netlink_rcv_skb+0x147/0x430
xfrm_netlink_rcv+0x74/0x90
netlink_unicast+0x5a7/0x870
netlink_sendmsg+0x8ac/0xd80
____sys_sendmsg+0xa67/0xc20
___sys_sendmsg+0x10f/0x1b0
__sys_sendmsg+0x150/0x200
do_syscall_64+0xbf/0x360
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fe82469db19
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fe821c13188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007fe8247b0f60 RCX: 00007fe82469db19
RDX: 0000000000000000 RSI: 0000000020000400 RDI: 0000000000000003
RBP: 00007fe8246f7f6d R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fff9235ff2f R14: 00007fe821c13300 R15: 0000000000022000
Allocated by task 5826:
kasan_save_stack+0x24/0x50
kasan_save_track+0x14/0x30
__kasan_slab_alloc+0x59/0x70
kmem_cache_alloc_noprof+0x13c/0x3d0
xfrm_state_alloc+0x25/0x600
xfrm_add_acquire+0x103/0xc30
xfrm_user_rcv_msg+0x459/0xa00
netlink_rcv_skb+0x147/0x430
xfrm_netlink_rcv+0x74/0x90
netlink_unicast+0x5a7/0x870
netlink_sendmsg+0x8ac/0xd80
____sys_sendmsg+0xa67/0xc20
___sys_sendmsg+0x10f/0x1b0
__sys_sendmsg+0x150/0x200
do_syscall_64+0xbf/0x360
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Freed by task 5826:
kasan_save_stack+0x24/0x50
kasan_save_track+0x14/0x30
kasan_save_free_info+0x3a/0x60
__kasan_slab_free+0x3f/0x50
kmem_cache_free+0x2a1/0x460
xfrm_add_acquire+0x936/0xc30
xfrm_user_rcv_msg+0x459/0xa00
netlink_rcv_skb+0x147/0x430
xfrm_netlink_rcv+0x74/0x90
netlink_unicast+0x5a7/0x870
netlink_sendmsg+0x8ac/0xd80
____sys_sendmsg+0xa67/0xc20
___sys_sendmsg+0x10f/0x1b0
__sys_sendmsg+0x150/0x200
do_syscall_64+0xbf/0x360
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff88800a160880
which belongs to the cache xfrm_state of size 920
The buggy address is located 196 bytes inside of
freed 920-byte region [ffff88800a160880, ffff88800a160c18)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88800a160cc0 pfn:0xa160
head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0x100000000000040(head|node=0|zone=1)
page_type: f5(slab)
raw: 0100000000000040 ffff88800a6f5000 dead000000000122 0000000000000000
raw: ffff88800a160cc0 00000000800f000c 00000000f5000000 0000000000000000
head: 0100000000000040 ffff88800a6f5000 dead000000000122 0000000000000000
head: ffff88800a160cc0 00000000800f000c 00000000f5000000 0000000000000000
head: 0100000000000002 ffffea0000285801 00000000ffffffff 00000000ffffffff
head: ffff88800a161de0 0000000000000000 00000000ffffffff 0000000000000004
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff88800a160800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88800a160880: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88800a160900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88800a160980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88800a160a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] SMP KASAN NOPTI
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 1 UID: 0 PID: 5832 Comm: syz-executor.4 Tainted: G B 6.16.0-next-20250805 #1 PREEMPT(voluntary)
Tainted: [B]=BAD_PAGE
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
RIP: 0010:xfrm_alloc_spi+0xb62/0x1210
Code: 89 f2 48 c1 ea 03 80 3c 02 00 0f 85 e9 05 00 00 48 8b 44 24 28 4c 8b 68 30 48 b8 00 00 00 00 00 fc ff df 4c 89 ea 48 c1 ea 03 <80> 3c 02 00 0f 85 b8 05 00 00 4c 89 e2 49 89 6d 00 48 b8 00 00 00
RSP: 0018:ffff888016087338 EFLAGS: 00010256
RAX: dffffc0000000000 RBX: ffff88800a160880 RCX: ffffffff841ccd86
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88800a1608b0
RBP: ffff88800a161128 R08: 0000000000000001 R09: fffffbfff0f10c90
R10: 0000000000000000 R11: 0000000000000001 R12: ffff88800a1608b0
R13: 0000000000000000 R14: ffff88800a161130 R15: 0000000000000000
FS: 00007fe821c13700(0000) GS:ffff8880e56e5000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f859f149018 CR3: 000000000d782000 CR4: 0000000000350ef0
Call Trace:
xfrm_alloc_userspi+0x607/0xbb0
xfrm_user_rcv_msg+0x459/0xa00
netlink_rcv_skb+0x147/0x430
xfrm_netlink_rcv+0x74/0x90
netlink_unicast+0x5a7/0x870
netlink_sendmsg+0x8ac/0xd80
____sys_sendmsg+0xa67/0xc20
___sys_sendmsg+0x10f/0x1b0
__sys_sendmsg+0x150/0x200
do_syscall_64+0xbf/0x360
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fe82469db19
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fe821c13188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007fe8247b0f60 RCX: 00007fe82469db19
RDX: 0000000000000000 RSI: 0000000020000400 RDI: 0000000000000003
RBP: 00007fe8246f7f6d R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fff9235ff2f R14: 00007fe821c13300 R15: 0000000000022000
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:xfrm_alloc_spi+0xb62/0x1210
Code: 89 f2 48 c1 ea 03 80 3c 02 00 0f 85 e9 05 00 00 48 8b 44 24 28 4c 8b 68 30 48 b8 00 00 00 00 00 fc ff df 4c 89 ea 48 c1 ea 03 <80> 3c 02 00 0f 85 b8 05 00 00 4c 89 e2 49 89 6d 00 48 b8 00 00 00
RSP: 0018:ffff888016087338 EFLAGS: 00010256
RAX: dffffc0000000000 RBX: ffff88800a160880 RCX: ffffffff841ccd86
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88800a1608b0
RBP: ffff88800a161128 R08: 0000000000000001 R09: fffffbfff0f10c90
R10: 0000000000000000 R11: 0000000000000001 R12: ffff88800a1608b0
R13: 0000000000000000 R14: ffff88800a161130 R15: 0000000000000000
FS: 00007fe821c13700(0000) GS:ffff8880e56e5000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f859f149018 CR3: 000000000d782000 CR4: 0000000000350ef0
----------------
Code disassembly (best guess):
0: 89 f2 mov %esi,%edx
2: 48 c1 ea 03 shr $0x3,%rdx
6: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1)
a: 0f 85 e9 05 00 00 jne 0x5f9
10: 48 8b 44 24 28 mov 0x28(%rsp),%rax
15: 4c 8b 68 30 mov 0x30(%rax),%r13
19: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
20: fc ff df
23: 4c 89 ea mov %r13,%rdx
26: 48 c1 ea 03 shr $0x3,%rdx
* 2a: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) <-- trapping instruction
2e: 0f 85 b8 05 00 00 jne 0x5ec
34: 4c 89 e2 mov %r12,%rdx
37: 49 89 6d 00 mov %rbp,0x0(%r13)
3b: 48 rex.W
3c: b8 .byte 0xb8
3d: 00 00 add %al,(%rax)