RBP: 00007fa0842e61d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000002
R13: 00007fff19bf538f R14: 00007fa0842e6300 R15: 0000000000022000
==================================================================
BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:101 [inline]
BUG: KASAN: use-after-free in atomic_fetch_sub_release include/linux/atomic/atomic-instrumented.h:167 [inline]
BUG: KASAN: use-after-free in __refcount_sub_and_test include/linux/refcount.h:272 [inline]
BUG: KASAN: use-after-free in __refcount_dec_and_test include/linux/refcount.h:315 [inline]
BUG: KASAN: use-after-free in refcount_dec_and_test include/linux/refcount.h:333 [inline]
BUG: KASAN: use-after-free in kref_put include/linux/kref.h:64 [inline]
BUG: KASAN: use-after-free in anon_vma_name_put include/linux/mm_inline.h:365 [inline]
BUG: KASAN: use-after-free in free_anon_vma_name include/linux/mm_inline.h:396 [inline]
BUG: KASAN: use-after-free in vm_area_free_no_check+0x7e/0x130 kernel/fork.c:405
Write of size 4 at addr ffff8881117f8749 by task syz-executor.2/17809
CPU: 0 PID: 17809 Comm: syz-executor.2 Not tainted 5.15.106-syzkaller-00249-g19c0ed55a470 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106
print_address_description+0x87/0x3b0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:427 [inline]
kasan_report+0x179/0x1c0 mm/kasan/report.c:444
kasan_check_range+0x293/0x2a0 mm/kasan/generic.c:189
__kasan_check_write+0x14/0x20 mm/kasan/shadow.c:37
instrument_atomic_read_write include/linux/instrumented.h:101 [inline]
atomic_fetch_sub_release include/linux/atomic/atomic-instrumented.h:167 [inline]
__refcount_sub_and_test include/linux/refcount.h:272 [inline]
__refcount_dec_and_test include/linux/refcount.h:315 [inline]
refcount_dec_and_test include/linux/refcount.h:333 [inline]
kref_put include/linux/kref.h:64 [inline]
anon_vma_name_put include/linux/mm_inline.h:365 [inline]
free_anon_vma_name include/linux/mm_inline.h:396 [inline]
vm_area_free_no_check+0x7e/0x130 kernel/fork.c:405
vm_area_free kernel/fork.c:418 [inline]
dup_mmap kernel/fork.c:680 [inline]
dup_mm+0xd73/0x12c0 kernel/fork.c:1513
copy_mm+0x107/0x1b0 kernel/fork.c:1565
copy_process+0x12bc/0x3260 kernel/fork.c:2256
kernel_clone+0x21e/0x9e0 kernel/fork.c:2659
__do_sys_clone kernel/fork.c:2785 [inline]
__se_sys_clone kernel/fork.c:2769 [inline]
__x64_sys_clone+0x23f/0x290 kernel/fork.c:2769
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7fa085573169
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fa0842e6118 EFLAGS: 00000206 ORIG_RAX: 0000000000000038
RAX: ffffffffffffffda RBX: 00007fa085692f80 RCX: 00007fa085573169
RDX: 0000000000000000 RSI: 0000000020000000 RDI: 0000000060000200
RBP: 00007fa0842e61d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000002
R13: 00007fff19bf538f R14: 00007fa0842e6300 R15: 0000000000022000
Allocated by task 17760:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:45 [inline]
set_alloc_info mm/kasan/common.c:433 [inline]
__kasan_slab_alloc+0xb1/0xe0 mm/kasan/common.c:466
kasan_slab_alloc include/linux/kasan.h:217 [inline]
slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:550
slab_alloc_node mm/slub.c:3238 [inline]
slab_alloc mm/slub.c:3246 [inline]
kmem_cache_alloc+0xf5/0x200 mm/slub.c:3251
vm_area_dup+0x26/0x230 kernel/fork.c:367
dup_mmap kernel/fork.c:600 [inline]
dup_mm+0x81b/0x12c0 kernel/fork.c:1513
copy_mm+0x107/0x1b0 kernel/fork.c:1565
copy_process+0x12bc/0x3260 kernel/fork.c:2256
kernel_clone+0x21e/0x9e0 kernel/fork.c:2659
__do_sys_clone kernel/fork.c:2785 [inline]
__se_sys_clone kernel/fork.c:2769 [inline]
__x64_sys_clone+0x23f/0x290 kernel/fork.c:2769
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
Freed by task 13:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:45
kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370
____kasan_slab_free+0x126/0x160 mm/kasan/common.c:365
__kasan_slab_free+0x11/0x20 mm/kasan/common.c:373
kasan_slab_free include/linux/kasan.h:193 [inline]
slab_free_hook mm/slub.c:1723 [inline]
slab_free_freelist_hook+0xbd/0x190 mm/slub.c:1749
slab_free mm/slub.c:3517 [inline]
kmem_cache_free+0x116/0x2e0 mm/slub.c:3533
__free_vm_area_struct+0x1c/0x20 kernel/fork.c:389
rcu_do_batch+0x57a/0xc10 kernel/rcu/tree.c:2509
rcu_core+0x517/0x1020 kernel/rcu/tree.c:2749
rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2762
__do_softirq+0x26d/0x5bf kernel/softirq.c:565
Last potentially related work creation:
kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38
__kasan_record_aux_stack+0xd3/0xf0 mm/kasan/generic.c:348
kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358
__call_rcu kernel/rcu/tree.c:2993 [inline]
call_rcu+0x133/0x12a0 kernel/rcu/tree.c:3073
free_vm_area_struct kernel/fork.c:394 [inline]
vm_area_free_no_check+0xff/0x130 kernel/fork.c:408
vm_area_free+0x53/0x60 kernel/fork.c:418
remove_vma mm/mmap.c:190 [inline]
exit_mmap+0x50d/0x6f0 mm/mmap.c:3217
__mmput+0x95/0x310 kernel/fork.c:1171
mmput+0x5b/0x170 kernel/fork.c:1194
exit_mm kernel/exit.c:551 [inline]
do_exit+0xbb4/0x2b60 kernel/exit.c:862
do_group_exit+0x141/0x310 kernel/exit.c:997
get_signal+0x7a3/0x1630 kernel/signal.c:2891
arch_do_signal_or_restart+0xbd/0x1680 arch/x86/kernel/signal.c:865
handle_signal_work kernel/entry/common.c:148 [inline]
exit_to_user_mode_loop+0xa0/0xe0 kernel/entry/common.c:172
exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:208
irqentry_exit_to_user_mode+0x9/0x20 kernel/entry/common.c:314
irqentry_exit+0x12/0x40 kernel/entry/common.c:405
exc_page_fault+0x47a/0x830 arch/x86/mm/fault.c:1608
asm_exc_page_fault+0x27/0x30 arch/x86/include/asm/idtentry.h:568
Second to last potentially related work creation:
kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38
__kasan_record_aux_stack+0xd3/0xf0 mm/kasan/generic.c:348
kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358
__call_rcu kernel/rcu/tree.c:2993 [inline]
call_rcu+0x133/0x12a0 kernel/rcu/tree.c:3073
free_vm_area_struct kernel/fork.c:394 [inline]
vm_area_free_no_check+0xff/0x130 kernel/fork.c:408
vm_area_free+0x53/0x60 kernel/fork.c:418
remove_vma mm/mmap.c:190 [inline]
exit_mmap+0x50d/0x6f0 mm/mmap.c:3217
__mmput+0x95/0x310 kernel/fork.c:1171
mmput+0x5b/0x170 kernel/fork.c:1194
exit_mm kernel/exit.c:551 [inline]
do_exit+0xbb4/0x2b60 kernel/exit.c:862
do_group_exit+0x141/0x310 kernel/exit.c:997
get_signal+0x7a3/0x1630 kernel/signal.c:2891
arch_do_signal_or_restart+0xbd/0x1680 arch/x86/kernel/signal.c:865
handle_signal_work kernel/entry/common.c:148 [inline]
exit_to_user_mode_loop+0xa0/0xe0 kernel/entry/common.c:172
exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:208
__syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline]
syscall_exit_to_user_mode+0x26/0x160 kernel/entry/common.c:301
do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x61/0xcb
The buggy address belongs to the object at ffff8881117f86f0
which belongs to the cache vm_area_struct of size 232
The buggy address is located 89 bytes inside of
232-byte region [ffff8881117f86f0, ffff8881117f87d8)
The buggy address belongs to the page:
page:ffffea000445fe00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1117f8
flags: 0x4000000000000200(slab|zone=1)
raw: 4000000000000200 ffffea0004b864c0 0000000500000004 ffff8881001b5800
raw: 0000000000000000 00000000000d000d 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 28156, ts 1335709816291, free_ts 1335698225253
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2502
prep_new_page mm/page_alloc.c:2508 [inline]
get_page_from_freelist+0x2c14/0x2cf0 mm/page_alloc.c:4291
__alloc_pages+0x386/0x7b0 mm/page_alloc.c:5569
allocate_slab mm/slub.c:1930 [inline]
new_slab+0x92/0x490 mm/slub.c:1993
___slab_alloc+0x39e/0x830 mm/slub.c:3026
__slab_alloc+0x4a/0x90 mm/slub.c:3113
slab_alloc_node mm/slub.c:3204 [inline]
slab_alloc mm/slub.c:3246 [inline]
kmem_cache_alloc+0x134/0x200 mm/slub.c:3251
vm_area_dup+0x26/0x230 kernel/fork.c:367
dup_mmap kernel/fork.c:600 [inline]
dup_mm+0x81b/0x12c0 kernel/fork.c:1513
copy_mm+0x107/0x1b0 kernel/fork.c:1565
copy_process+0x12bc/0x3260 kernel/fork.c:2256
kernel_clone+0x21e/0x9e0 kernel/fork.c:2659
__do_sys_clone kernel/fork.c:2785 [inline]
__se_sys_clone kernel/fork.c:2769 [inline]
__x64_sys_clone+0x23f/0x290 kernel/fork.c:2769
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
page last free stack trace:
reset_page_owner include/linux/page_owner.h:26 [inline]
free_pages_prepare mm/page_alloc.c:1370 [inline]
free_pcp_prepare mm/page_alloc.c:1442 [inline]
free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3441
free_unref_page+0xac/0x2c0 mm/page_alloc.c:3521
free_the_page mm/page_alloc.c:711 [inline]
__free_pages+0x61/0xf0 mm/page_alloc.c:5645
__free_slab+0xec/0x1d0 mm/slub.c:2018
free_slab mm/slub.c:2033 [inline]
discard_slab+0x29/0x40 mm/slub.c:2039
__slab_free+0x205/0x290 mm/slub.c:3422
do_slab_free mm/slub.c:3505 [inline]
___cache_free+0x109/0x120 mm/slub.c:3524
qlink_free+0x4d/0x90 mm/kasan/quarantine.c:157
qlist_free_all+0x44/0xb0 mm/kasan/quarantine.c:176
kasan_quarantine_reduce+0x15a/0x180 mm/kasan/quarantine.c:283
__kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:443
kasan_slab_alloc include/linux/kasan.h:217 [inline]
slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:550
slab_alloc_node mm/slub.c:3238 [inline]
slab_alloc mm/slub.c:3246 [inline]
kmem_cache_alloc+0xf5/0x200 mm/slub.c:3251
kmem_cache_zalloc include/linux/slab.h:728 [inline]
alloc_buffer_head+0x26/0x110 fs/buffer.c:3311
alloc_page_buffers+0x192/0x390 fs/buffer.c:832
create_empty_buffers+0x3d/0x4c0 fs/buffer.c:1562
Memory state around the buggy address:
ffff8881117f8600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8881117f8680: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fa fb
>ffff8881117f8700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8881117f8780: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc
ffff8881117f8800: fc fc fc 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
------------[ cut here ]------------
refcount_t: underflow; use-after-free.
WARNING: CPU: 0 PID: 17809 at lib/refcount.c:28 refcount_warn_saturate+0x158/0x1a0 lib/refcount.c:28
Modules linked in:
CPU: 0 PID: 17809 Comm: syz-executor.2 Tainted: G B 5.15.106-syzkaller-00249-g19c0ed55a470 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023
RIP: 0010:refcount_warn_saturate+0x158/0x1a0 lib/refcount.c:28
Code: 04 01 48 c7 c7 c0 9b 82 85 e8 54 99 dd fe 0f 0b eb 8b e8 7b 15 0c ff c6 05 89 b8 9e 04 01 48 c7 c7 20 9c 82 85 e8 38 99 dd fe <0f> 0b e9 6c ff ff ff e8 5c 15 0c ff c6 05 6b b8 9e 04 01 48 c7 c7
RSP: 0018:ffffc90003867948 EFLAGS: 00010246
RAX: 034e1dc35adb5700 RBX: 0000000000000003 RCX: 0000000000040000
RDX: ffffc900097a7000 RSI: 000000000003ffff RDI: 0000000000040000
RBP: ffffc90003867958 R08: ffffffff815748e5 R09: ffffed103ee065e8
R10: 0000000000000000 R11: dffffc0000000001 R12: 1ffff110259a8f17
R13: ffff88812cd478b8 R14: 0000000000000003 R15: ffff8881117f8749
FS: 00007fa0842e6700(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005555564413b8 CR3: 000000011507f000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
__refcount_sub_and_test include/linux/refcount.h:283 [inline]
__refcount_dec_and_test include/linux/refcount.h:315 [inline]
refcount_dec_and_test include/linux/refcount.h:333 [inline]
kref_put include/linux/kref.h:64 [inline]
anon_vma_name_put include/linux/mm_inline.h:365 [inline]
free_anon_vma_name include/linux/mm_inline.h:396 [inline]
vm_area_free_no_check+0x123/0x130 kernel/fork.c:405
vm_area_free kernel/fork.c:418 [inline]
dup_mmap kernel/fork.c:680 [inline]
dup_mm+0xd73/0x12c0 kernel/fork.c:1513
copy_mm+0x107/0x1b0 kernel/fork.c:1565
copy_process+0x12bc/0x3260 kernel/fork.c:2256
kernel_clone+0x21e/0x9e0 kernel/fork.c:2659
__do_sys_clone kernel/fork.c:2785 [inline]
__se_sys_clone kernel/fork.c:2769 [inline]
__x64_sys_clone+0x23f/0x290 kernel/fork.c:2769
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7fa085573169
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fa0842e6118 EFLAGS: 00000206 ORIG_RAX: 0000000000000038
RAX: ffffffffffffffda RBX: 00007fa085692f80 RCX: 00007fa085573169
RDX: 0000000000000000 RSI: 0000000020000000 RDI: 0000000060000200
RBP: 00007fa0842e61d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000002
R13: 00007fff19bf538f R14: 00007fa0842e6300 R15: 0000000000022000
---[ end trace eab950b0b0de5ec0 ]---