==================================================================
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.0/3606
CPU: 1 PID: 3606 Comm: syz-executor.0 Tainted: G W 5.15.148-syzkaller-00718-g993bed180178 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
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
__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
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:0x7ff2fccebdd3
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:00007ffdfcebd888 EFLAGS: 00000246 ORIG_RAX: 0000000000000038
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007ff2fccebdd3
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000555555b8b750 R11: 0000000000000246 R12: 0000000000000001
R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000001
The buggy address belongs to the page:
page:ffffea0007000000 refcount:0 mapcount:-128 mapping:0000000000000000 index:0xa pfn:0x1c0000
flags: 0x4000000000000000(zone=1)
raw: 4000000000000000 ffffea0006470008 ffffea00064a0008 0000000000000000
raw: 000000000000000a 000000000000000a 00000000ffffff7f 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 10, migratetype Unmovable, gfp_mask 0x542a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_COMP|__GFP_HARDWALL|__GFP_ACCOUNT), pid 17568, ts 1185601915491, free_ts 1185717144472
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2604
prep_new_page+0x1b/0x110 mm/page_alloc.c:2610
get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4484
__alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5776
__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]
kmalloc_order+0x4a/0x160 mm/slab_common.c:975
kmalloc_order_trace+0x1a/0xb0 mm/slab_common.c:994
kmalloc_large include/linux/slab.h:532 [inline]
__kmalloc+0x19c/0x270 mm/slub.c:4416
__kmalloc_node include/linux/slab.h:469 [inline]
kmalloc_node include/linux/slab.h:626 [inline]
bpf_map_kmalloc_node+0xdb/0x160 kernel/bpf/syscall.c:432
alloc_htab_elem+0x28a/0x900 kernel/bpf/hashtab.c:966
htab_map_update_elem+0x382/0x9c0 kernel/bpf/hashtab.c:1099
bpf_map_update_value+0x224/0x3c0 kernel/bpf/syscall.c:223
map_update_elem+0x644/0x770 kernel/bpf/syscall.c:1165
__sys_bpf+0x405/0x760 kernel/bpf/syscall.c:4615
__do_sys_bpf kernel/bpf/syscall.c:4731 [inline]
__se_sys_bpf kernel/bpf/syscall.c:4729 [inline]
__x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:4729
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:1471 [inline]
free_pcp_prepare mm/page_alloc.c:1543 [inline]
free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3533
free_unref_page+0xe8/0x750 mm/page_alloc.c:3615
free_the_page mm/page_alloc.c:804 [inline]
__free_pages+0x61/0xf0 mm/page_alloc.c:5852
free_nonslab_page+0x82/0xc0 mm/slub.c:3555
kfree+0x19e/0x220 mm/slub.c:4576
htab_elem_free kernel/bpf/hashtab.c:842 [inline]
htab_elem_free_rcu+0xeb/0x1a0 kernel/bpf/hashtab.c:850
rcu_do_batch+0x57a/0xc10 kernel/rcu/tree.c:2523
rcu_core+0x517/0x1020 kernel/rcu/tree.c:2763
rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2776
__do_softirq+0x26d/0x5bf kernel/softirq.c:565
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 0xdffffc0000001b39: 0000 [#1] PREEMPT SMP KASAN
KASAN: probably user-memory-access in range [0x000000000000d9c8-0x000000000000d9cf]
CPU: 0 PID: 3606 Comm: syz-executor.0 Tainted: G B W 5.15.148-syzkaller-00718-g993bed180178 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
RIP: 0010:__rb_insert lib/rbtree.c:110 [inline]
RIP: 0010:__rb_insert_augmented+0x63/0x610 lib/rbtree.c:459
Code: 0b 2b ff 4d 8b 2f 4d 85 ed 75 18 e9 a7 05 00 00 4c 8b 2b 49 89 df 49 83 e5 fc 4c 89 2b 0f 84 91 05 00 00 4c 89 eb 48 c1 eb 03 <42> 80 3c 23 00 74 08 4c 89 ef e8 5e 0b 2b ff 49 8b 45 00 a8 01 0f
RSP: 0018:ffffc90000f978f8 EFLAGS: 00010207
RAX: 0000000000000000 RBX: 0000000000001b39 RCX: ffffffff82872802
RDX: 0000000000000000 RSI: 0000000000000292 RDI: ffff8881c0000000
RBP: ffffc90000f97960 R08: ffffffff81416e7b R09: 0000000000000003
R10: fffffbfff0e5224c R11: dffffc0000000001 R12: dffffc0000000000
R13: 000000000000d9cc R14: ffff8881c0000001 R15: ffff8881c0000000
FS: 0000555555b8b480(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000149d64000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 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
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:0x7ff2fccebdd3
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:00007ffdfcebd888 EFLAGS: 00000246 ORIG_RAX: 0000000000000038
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007ff2fccebdd3
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000555555b8b750 R11: 0000000000000246 R12: 0000000000000001
R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000001
Modules linked in:
---[ end trace 0c5d785edd526e20 ]---
RIP: 0010:__rb_insert lib/rbtree.c:110 [inline]
RIP: 0010:__rb_insert_augmented+0x63/0x610 lib/rbtree.c:459
Code: 0b 2b ff 4d 8b 2f 4d 85 ed 75 18 e9 a7 05 00 00 4c 8b 2b 49 89 df 49 83 e5 fc 4c 89 2b 0f 84 91 05 00 00 4c 89 eb 48 c1 eb 03 <42> 80 3c 23 00 74 08 4c 89 ef e8 5e 0b 2b ff 49 8b 45 00 a8 01 0f
RSP: 0018:ffffc90000f978f8 EFLAGS: 00010207
RAX: 0000000000000000 RBX: 0000000000001b39 RCX: ffffffff82872802
RDX: 0000000000000000 RSI: 0000000000000292 RDI: ffff8881c0000000
RBP: ffffc90000f97960 R08: ffffffff81416e7b R09: 0000000000000003
R10: fffffbfff0e5224c R11: dffffc0000000001 R12: dffffc0000000000
R13: 000000000000d9cc R14: ffff8881c0000001 R15: ffff8881c0000000
FS: 0000555555b8b480(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b30c21000 CR3: 0000000149d64000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 1 bytes skipped:
0: 2b ff sub %edi,%edi
2: 4d 8b 2f mov (%r15),%r13
5: 4d 85 ed test %r13,%r13
8: 75 18 jne 0x22
a: e9 a7 05 00 00 jmp 0x5b6
f: 4c 8b 2b mov (%rbx),%r13
12: 49 89 df mov %rbx,%r15
15: 49 83 e5 fc and $0xfffffffffffffffc,%r13
19: 4c 89 2b mov %r13,(%rbx)
1c: 0f 84 91 05 00 00 je 0x5b3
22: 4c 89 eb mov %r13,%rbx
25: 48 c1 eb 03 shr $0x3,%rbx
* 29: 42 80 3c 23 00 cmpb $0x0,(%rbx,%r12,1) <-- trapping instruction
2e: 74 08 je 0x38
30: 4c 89 ef mov %r13,%rdi
33: e8 5e 0b 2b ff call 0xff2b0b96
38: 49 8b 45 00 mov 0x0(%r13),%rax
3c: a8 01 test $0x1,%al
3e: 0f .byte 0xf