==================================================================
BUG: KASAN: use-after-free in __rb_insert lib/rbtree.c:115 [inline]
BUG: KASAN: use-after-free in __rb_insert_augmented+0xa0/0x610 lib/rbtree.c:459
Read of size 8 at addr ffff8881c0000008 by task syz-executor/8406
CPU: 0 PID: 8406 Comm: syz-executor Tainted: G W 5.15.156-syzkaller-00821-g29d153aabd54 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x151/0x1c0 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
__asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:309
__rb_insert lib/rbtree.c:115 [inline]
__rb_insert_augmented+0xa0/0x610 lib/rbtree.c:459
rb_insert_augmented include/linux/rbtree_augmented.h:50 [inline]
vma_interval_tree_insert_after+0x2be/0x2d0 mm/interval_tree.c:57
dup_mmap kernel/fork.c:631 [inline]
dup_mm kernel/fork.c:1521 [inline]
copy_mm+0xba2/0x13e0 kernel/fork.c:1573
copy_process+0x1149/0x3290 kernel/fork.c:2264
kernel_clone+0x21e/0x9e0 kernel/fork.c:2662
__do_sys_clone kernel/fork.c:2788 [inline]
__se_sys_clone kernel/fork.c:2772 [inline]
__x64_sys_clone+0x23f/0x290 kernel/fork.c:2772
x64_sys_call+0x1b0/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:57
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f895dd3f6d3
Code: 1f 84 00 00 00 00 00 64 48 8b 04 25 10 00 00 00 45 31 c0 31 d2 31 f6 bf 11 00 20 01 4c 8d 90 d0 02 00 00 b8 38 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 89 c2 85 c0 75 2c 64 48 8b 04 25 10 00 00
RSP: 002b:00007ffc79572cb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000038
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f895dd3f6d3
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000555555ea27d0 R11: 0000000000000246 R12: 0000000000000001
R13: 0000000000041f09 R14: 0000000000041936 R15: 00007ffc79572e40
The buggy address belongs to the page:
page:ffffea0007000000 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x0 pfn:0x1c0000
flags: 0x4000000000000000(zone=1)
raw: 4000000000000000 ffffea0006ff8008 ffffea0007008008 0000000000000000
raw: 0000000000000000 0000000000000008 00000000ffffff7f 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x100cc0(GFP_USER), pid 4784, ts 138687190231, free_ts 140571963054
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2605
prep_new_page+0x1b/0x110 mm/page_alloc.c:2611
get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4485
__alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5779
__alloc_pages_node include/linux/gfp.h:591 [inline]
alloc_pages_node include/linux/gfp.h:605 [inline]
alloc_pages include/linux/gfp.h:618 [inline]
__get_free_pages+0x10/0x30 mm/page_alloc.c:5816
kasan_populate_vmalloc_pte+0x39/0x130 mm/kasan/shadow.c:266
apply_to_pte_range mm/memory.c:2610 [inline]
apply_to_pmd_range mm/memory.c:2654 [inline]
apply_to_pud_range mm/memory.c:2690 [inline]
apply_to_p4d_range mm/memory.c:2726 [inline]
__apply_to_page_range+0x8dd/0xbe0 mm/memory.c:2760
apply_to_page_range+0x3b/0x50 mm/memory.c:2779
kasan_populate_vmalloc+0x65/0x70 mm/kasan/shadow.c:297
alloc_vmap_area+0x192f/0x1a80 mm/vmalloc.c:1576
__get_vm_area_node+0x158/0x360 mm/vmalloc.c:2439
get_vm_area_caller mm/vmalloc.c:2492 [inline]
vmap+0xbb/0x280 mm/vmalloc.c:2781
bpf_ringbuf_area_alloc kernel/bpf/ringbuf.c:106 [inline]
bpf_ringbuf_alloc+0x1a6/0x3d0 kernel/bpf/ringbuf.c:133
ringbuf_map_alloc+0x202/0x320 kernel/bpf/ringbuf.c:172
find_and_alloc_map kernel/bpf/syscall.c:129 [inline]
map_create+0x411/0x2050 kernel/bpf/syscall.c:857
__sys_bpf+0x296/0x760 kernel/bpf/syscall.c:4615
page last free stack trace:
reset_page_owner include/linux/page_owner.h:26 [inline]
free_pages_prepare mm/page_alloc.c:1472 [inline]
free_pcp_prepare mm/page_alloc.c:1544 [inline]
free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3534
free_unref_page+0xe8/0x750 mm/page_alloc.c:3616
free_the_page mm/page_alloc.c:805 [inline]
__free_pages+0x61/0xf0 mm/page_alloc.c:5855
free_pages+0x7c/0x90 mm/page_alloc.c:5866
kasan_depopulate_vmalloc_pte+0x6a/0x90 mm/kasan/shadow.c:354
apply_to_pte_range mm/memory.c:2610 [inline]
apply_to_pmd_range mm/memory.c:2654 [inline]
apply_to_pud_range mm/memory.c:2690 [inline]
apply_to_p4d_range mm/memory.c:2726 [inline]
__apply_to_page_range+0x8dd/0xbe0 mm/memory.c:2760
apply_to_existing_page_range+0x38/0x50 mm/memory.c:2793
kasan_release_vmalloc+0x9a/0xb0 mm/kasan/shadow.c:464
__purge_vmap_area_lazy+0x154a/0x1690 mm/vmalloc.c:1715
try_purge_vmap_area_lazy+0x38/0x50 mm/vmalloc.c:1734
free_vmap_area_noflush+0x9df/0xa20 mm/vmalloc.c:1776
free_unmap_vmap_area mm/vmalloc.c:1789 [inline]
remove_vm_area+0x1d9/0x200 mm/vmalloc.c:2544
vm_remove_mappings mm/vmalloc.c:2573 [inline]
__vunmap+0x24b/0x8f0 mm/vmalloc.c:2642
vunmap+0x46/0x60 mm/vmalloc.c:2749
bpf_ringbuf_free kernel/bpf/ringbuf.c:189 [inline]
ringbuf_map_free+0x83/0x120 kernel/bpf/ringbuf.c:200
map_create+0x1a3a/0x2050 kernel/bpf/syscall.c:935
Memory state around the buggy address:
ffff8881bfffff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8881bfffff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8881c0000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff8881c0000080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8881c0000100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
general protection fault, probably for non-canonical address 0xff1f1b1f1f1f1f1f: 0000 [#1] PREEMPT SMP KASAN
KASAN: maybe wild-memory-access in range [0xf8f8f8f8f8f8f8f8-0xf8f8f8f8f8f8f8ff]
CPU: 0 PID: 8406 Comm: syz-executor Tainted: G B W 5.15.156-syzkaller-00821-g29d153aabd54 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024
RIP: 0010:__rb_insert lib/rbtree.c:117 [inline]
RIP: 0010:__rb_insert_augmented+0xbf/0x610 lib/rbtree.c:459
Code: 00 74 08 48 89 df e8 60 e8 2a ff 48 89 d8 48 8b 1b 4c 39 eb 4c 89 7d a8 74 4b 48 85 db 0f 84 ff 00 00 00 49 89 df 49 c1 ef 03 <43> 80 3c 27 00 74 08 48 89 df e8 32 e8 2a ff f6 03 01 0f 85 e0 00
RSP: 0000:ffffc90000eaf8f8 EFLAGS: 00010a02
RAX: ffff8881c0000008 RBX: f8f8f8f8f8f8f8f8 RCX: ffff8881236d0000
RDX: 0000000000000000 RSI: 0000000000000292 RDI: 00000000ffffffff
RBP: ffffc90000eaf960 R08: ffffffff8141971b R09: 0000000000000003
R10: fffffbfff0e99c4c R11: dffffc0000000001 R12: dffffc0000000000
R13: ffff8881b8c01ac0 R14: 1ffff11038000001 R15: 1f1f1f1f1f1f1f1f
FS: 0000555555ea2500(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000555555c884a8 CR3: 000000012583b000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000600
Call Trace:
rb_insert_augmented include/linux/rbtree_augmented.h:50 [inline]
vma_interval_tree_insert_after+0x2be/0x2d0 mm/interval_tree.c:57
dup_mmap kernel/fork.c:631 [inline]
dup_mm kernel/fork.c:1521 [inline]
copy_mm+0xba2/0x13e0 kernel/fork.c:1573
copy_process+0x1149/0x3290 kernel/fork.c:2264
kernel_clone+0x21e/0x9e0 kernel/fork.c:2662
__do_sys_clone kernel/fork.c:2788 [inline]
__se_sys_clone kernel/fork.c:2772 [inline]
__x64_sys_clone+0x23f/0x290 kernel/fork.c:2772
x64_sys_call+0x1b0/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:57
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f895dd3f6d3
Code: 1f 84 00 00 00 00 00 64 48 8b 04 25 10 00 00 00 45 31 c0 31 d2 31 f6 bf 11 00 20 01 4c 8d 90 d0 02 00 00 b8 38 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 89 c2 85 c0 75 2c 64 48 8b 04 25 10 00 00
RSP: 002b:00007ffc79572cb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000038
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f895dd3f6d3
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000555555ea27d0 R11: 0000000000000246 R12: 0000000000000001
R13: 0000000000041f09 R14: 0000000000041936 R15: 00007ffc79572e40
Modules linked in:
---[ end trace 21e81a12d8e59585 ]---
RIP: 0010:__rb_insert lib/rbtree.c:117 [inline]
RIP: 0010:__rb_insert_augmented+0xbf/0x610 lib/rbtree.c:459
Code: 00 74 08 48 89 df e8 60 e8 2a ff 48 89 d8 48 8b 1b 4c 39 eb 4c 89 7d a8 74 4b 48 85 db 0f 84 ff 00 00 00 49 89 df 49 c1 ef 03 <43> 80 3c 27 00 74 08 48 89 df e8 32 e8 2a ff f6 03 01 0f 85 e0 00
RSP: 0000:ffffc90000eaf8f8 EFLAGS: 00010a02
RAX: ffff8881c0000008 RBX: f8f8f8f8f8f8f8f8 RCX: ffff8881236d0000
RDX: 0000000000000000 RSI: 0000000000000292 RDI: 00000000ffffffff
RBP: ffffc90000eaf960 R08: ffffffff8141971b R09: 0000000000000003
R10: fffffbfff0e99c4c R11: dffffc0000000001 R12: dffffc0000000000
R13: ffff8881b8c01ac0 R14: 1ffff11038000001 R15: 1f1f1f1f1f1f1f1f
FS: 0000555555ea2500(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020001400 CR3: 000000012583b000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000600
----------------
Code disassembly (best guess):
0: 00 74 08 48 add %dh,0x48(%rax,%rcx,1)
4: 89 df mov %ebx,%edi
6: e8 60 e8 2a ff call 0xff2ae86b
b: 48 89 d8 mov %rbx,%rax
e: 48 8b 1b mov (%rbx),%rbx
11: 4c 39 eb cmp %r13,%rbx
14: 4c 89 7d a8 mov %r15,-0x58(%rbp)
18: 74 4b je 0x65
1a: 48 85 db test %rbx,%rbx
1d: 0f 84 ff 00 00 00 je 0x122
23: 49 89 df mov %rbx,%r15
26: 49 c1 ef 03 shr $0x3,%r15
* 2a: 43 80 3c 27 00 cmpb $0x0,(%r15,%r12,1) <-- trapping instruction
2f: 74 08 je 0x39
31: 48 89 df mov %rbx,%rdi
34: e8 32 e8 2a ff call 0xff2ae86b
39: f6 03 01 testb $0x1,(%rbx)
3c: 0f .byte 0xf
3d: 85 e0 test %esp,%eax