==================================================================
BUG: KASAN: use-after-free in __list_del_entry_valid+0x2f/0x120 lib/list_debug.c:46
Read of size 8 at addr ffff888116361288 by task kworker/0:52/2589
CPU: 0 PID: 2589 Comm: kworker/0:52 Not tainted 5.15.167-syzkaller-android13-5.15.167_r00 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Workqueue: events binder_deferred_func
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
__list_del_entry_valid+0x2f/0x120 lib/list_debug.c:46
__list_del_entry include/linux/list.h:132 [inline]
list_del_init include/linux/list.h:204 [inline]
binder_dequeue_work_head_ilocked drivers/android/binder.c:515 [inline]
binder_release_work+0xcd/0x680 drivers/android/binder.c:5183
binder_deferred_release drivers/android/binder.c:6339 [inline]
binder_deferred_func+0x1847/0x1bc0 drivers/android/binder.c:6374
process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325
worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472
kthread+0x421/0x510 kernel/kthread.c:337
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
Allocated by task 13575:
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_kmalloc+0xdb/0x110 mm/kasan/common.c:512
__kasan_kmalloc+0x9/0x10 mm/kasan/common.c:521
kasan_kmalloc include/linux/kasan.h:227 [inline]
kmem_cache_alloc_trace+0x115/0x210 mm/slub.c:3267
kmalloc include/linux/slab.h:603 [inline]
kzalloc include/linux/slab.h:733 [inline]
binder_request_freeze_notification drivers/android/binder.c:3895 [inline]
binder_thread_write+0x9f5/0x6ec0 drivers/android/binder.c:4535
binder_ioctl_write_read+0x205/0x7300 drivers/android/binder.c:5470
binder_ioctl+0x371/0x2640 drivers/android/binder.c:5787
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl+0x114/0x190 fs/ioctl.c:860
__x64_sys_ioctl+0x7b/0x90 fs/ioctl.c:860
x64_sys_call+0x98/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:17
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
Freed by task 2589:
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:3519 [inline]
kfree+0xc8/0x220 mm/slub.c:4579
binder_free_ref+0x128/0x260 drivers/android/binder.c:1465
binder_deferred_release drivers/android/binder.c:6334 [inline]
binder_deferred_func+0x171c/0x1bc0 drivers/android/binder.c:6374
process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325
worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472
kthread+0x421/0x510 kernel/kthread.c:337
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
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_common kernel/rcu/tree.c:3007 [inline]
call_rcu+0x123/0x10b0 kernel/rcu/tree.c:3125
tnode_free net/ipv4/fib_trie.c:495 [inline]
replace+0x19b/0x4b0 net/ipv4/fib_trie.c:521
inflate net/ipv4/fib_trie.c:623 [inline]
resize+0xbaf/0x1d60 net/ipv4/fib_trie.c:868
trie_rebalance net/ipv4/fib_trie.c:1101 [inline]
fib_insert_node net/ipv4/fib_trie.c:1145 [inline]
fib_insert_alias+0xb20/0x1060 net/ipv4/fib_trie.c:1159
fib_table_insert+0xa2c/0x20c0 net/ipv4/fib_trie.c:1372
fib_magic net/ipv4/fib_frontend.c:1093 [inline]
fib_add_ifaddr+0x43f/0x15e0 net/ipv4/fib_frontend.c:1115
fib_inetaddr_event+0x159/0x310 net/ipv4/fib_frontend.c:1429
notifier_call_chain kernel/notifier.c:83 [inline]
blocking_notifier_call_chain+0xbb/0x140 kernel/notifier.c:318
__inet_insert_ifa+0x906/0xb50 net/ipv4/devinet.c:554
inet_rtm_newaddr+0x8fd/0x16e0 net/ipv4/devinet.c:957
rtnetlink_rcv_msg+0x951/0xc40 net/core/rtnetlink.c:5618
netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2507
rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5636
netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline]
netlink_unicast+0x8df/0xac0 net/netlink/af_netlink.c:1356
netlink_sendmsg+0xa0a/0xd20 net/netlink/af_netlink.c:1924
sock_sendmsg_nosec net/socket.c:704 [inline]
__sock_sendmsg net/socket.c:716 [inline]
__sys_sendto+0x564/0x720 net/socket.c:2058
__do_sys_sendto net/socket.c:2070 [inline]
__se_sys_sendto net/socket.c:2066 [inline]
__x64_sys_sendto+0xe5/0x100 net/socket.c:2066
x64_sys_call+0x15c/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:45
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
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_common kernel/rcu/tree.c:3007 [inline]
call_rcu+0x123/0x10b0 kernel/rcu/tree.c:3125
collapse net/ipv4/fib_trie.c:702 [inline]
resize+0x1b00/0x1d60 net/ipv4/fib_trie.c:905
replace+0x352/0x4b0 net/ipv4/fib_trie.c:529
inflate net/ipv4/fib_trie.c:623 [inline]
resize+0xbaf/0x1d60 net/ipv4/fib_trie.c:868
trie_rebalance net/ipv4/fib_trie.c:1101 [inline]
fib_insert_node net/ipv4/fib_trie.c:1145 [inline]
fib_insert_alias+0xb20/0x1060 net/ipv4/fib_trie.c:1159
fib_table_insert+0xa2c/0x20c0 net/ipv4/fib_trie.c:1372
fib_magic net/ipv4/fib_frontend.c:1093 [inline]
fib_add_ifaddr+0x43f/0x15e0 net/ipv4/fib_frontend.c:1115
fib_inetaddr_event+0x159/0x310 net/ipv4/fib_frontend.c:1429
notifier_call_chain kernel/notifier.c:83 [inline]
blocking_notifier_call_chain+0xbb/0x140 kernel/notifier.c:318
__inet_insert_ifa+0x906/0xb50 net/ipv4/devinet.c:554
inet_rtm_newaddr+0x8fd/0x16e0 net/ipv4/devinet.c:957
rtnetlink_rcv_msg+0x951/0xc40 net/core/rtnetlink.c:5618
netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2507
rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5636
netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline]
netlink_unicast+0x8df/0xac0 net/netlink/af_netlink.c:1356
netlink_sendmsg+0xa0a/0xd20 net/netlink/af_netlink.c:1924
sock_sendmsg_nosec net/socket.c:704 [inline]
__sock_sendmsg net/socket.c:716 [inline]
__sys_sendto+0x564/0x720 net/socket.c:2058
__do_sys_sendto net/socket.c:2070 [inline]
__se_sys_sendto net/socket.c:2066 [inline]
__x64_sys_sendto+0xe5/0x100 net/socket.c:2066
x64_sys_call+0x15c/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:45
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
The buggy address belongs to the object at ffff888116361280
which belongs to the cache kmalloc-64 of size 64
The buggy address is located 8 bytes inside of
64-byte region [ffff888116361280, ffff8881163612c0)
The buggy address belongs to the page:
page:ffffea000458d840 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x116361
flags: 0x4000000000000200(slab|zone=1)
raw: 4000000000000200 ffffea00041e7dc0 0000000500000005 ffff888100042780
raw: 0000000000000000 0000000080200020 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 101, ts 4841184762, free_ts 4840781533
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
allocate_slab mm/slub.c:1932 [inline]
new_slab+0x9a/0x4e0 mm/slub.c:1995
___slab_alloc+0x39e/0x830 mm/slub.c:3028
__slab_alloc+0x4a/0x90 mm/slub.c:3115
slab_alloc_node mm/slub.c:3206 [inline]
slab_alloc mm/slub.c:3248 [inline]
kmem_cache_alloc_trace+0x142/0x210 mm/slub.c:3265
kmalloc include/linux/slab.h:603 [inline]
kernfs_get_open_node fs/kernfs/file.c:552 [inline]
kernfs_fop_open+0x7fa/0xab0 fs/kernfs/file.c:698
do_dentry_open+0x81c/0xfd0 fs/open.c:828
vfs_open+0x73/0x80 fs/open.c:958
do_open fs/namei.c:3608 [inline]
path_openat+0x26f0/0x2f40 fs/namei.c:3742
do_filp_open+0x21c/0x460 fs/namei.c:3769
do_sys_openat2+0x13f/0x820 fs/open.c:1234
do_sys_open fs/open.c:1250 [inline]
__do_sys_openat fs/open.c:1266 [inline]
__se_sys_openat fs/open.c:1261 [inline]
__x64_sys_openat+0x243/0x290 fs/open.c:1261
x64_sys_call+0x6bf/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:258
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
selinux_genfs_get_sid+0x24d/0x2a0 security/selinux/hooks.c:1375
inode_doinit_with_dentry+0x8d2/0x1070 security/selinux/hooks.c:1570
selinux_d_instantiate+0x27/0x40 security/selinux/hooks.c:6489
security_d_instantiate+0x9f/0x100 security/security.c:2074
d_splice_alias+0x6d/0x390 fs/dcache.c:3071
kernfs_iop_lookup+0x29e/0x2f0 fs/kernfs/dir.c:1175
__lookup_slow+0x2b9/0x400 fs/namei.c:1663
lookup_slow+0x5a/0x80 fs/namei.c:1680
walk_component+0x48c/0x610 fs/namei.c:1976
lookup_last fs/namei.c:2431 [inline]
path_lookupat+0x16d/0x450 fs/namei.c:2455
filename_lookup+0x230/0x5c0 fs/namei.c:2484
user_path_at_empty+0x43/0x1a0 fs/namei.c:2883
Memory state around the buggy address:
ffff888116361180: 00 00 00 00 00 00 00 03 fc fc fc fc fc fc fc fc
ffff888116361200: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
>ffff888116361280: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
^
ffff888116361300: 00 00 00 00 00 00 00 03 fc fc fc fc fc fc fc fc
ffff888116361380: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
==================================================================
general protection fault, probably for non-canonical address 0xf3affc7fc0000143: 0000 [#1] PREEMPT SMP KASAN
KASAN: maybe wild-memory-access in range [0x9d8003fe00000a18-0x9d8003fe00000a1f]
CPU: 0 PID: 2589 Comm: kworker/0:52 Tainted: G B 5.15.167-syzkaller-android13-5.15.167_r00 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Workqueue: events binder_deferred_func
RIP: 0010:__list_del_entry_valid+0x75/0x120 lib/list_debug.c:59
Code: 1e 48 85 db 74 68 4d 85 ff 74 74 48 ba 00 01 00 00 00 00 ad de 48 39 d3 74 76 48 83 c2 22 49 39 d7 74 7e 4c 89 f8 48 c1 e8 03 <42> 80 3c 20 00 74 08 4c 89 ff e8 cc 90 48 ff 49 8b 17 4c 39 f2 75
RSP: 0018:ffffc9000250fc00 EFLAGS: 00010a03
RAX: 13b0007fc0000143 RBX: ffff88810b1e7e00 RCX: ffffffff826a1859
RDX: dead000000000122 RSI: 0000000000000282 RDI: ffff888116361280
RBP: ffffc9000250fc20 R08: ffffffff8141997b R09: 0000000000000003
R10: fffffbfff0e9a04c R11: dffffc0000000001 R12: dffffc0000000000
R13: ffff888116361280 R14: ffff888116361280 R15: 9d8003fe00000a1d
FS: 0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2c11fffc CR3: 0000000006a0f000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
__list_del_entry include/linux/list.h:132 [inline]
list_del_init include/linux/list.h:204 [inline]
binder_dequeue_work_head_ilocked drivers/android/binder.c:515 [inline]
binder_release_work+0xcd/0x680 drivers/android/binder.c:5183
binder_deferred_release drivers/android/binder.c:6339 [inline]
binder_deferred_func+0x1847/0x1bc0 drivers/android/binder.c:6374
process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325
worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472
kthread+0x421/0x510 kernel/kthread.c:337
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
Modules linked in:
---[ end trace 5d504d60f52064cb ]---
RIP: 0010:__list_del_entry_valid+0x75/0x120 lib/list_debug.c:59
Code: 1e 48 85 db 74 68 4d 85 ff 74 74 48 ba 00 01 00 00 00 00 ad de 48 39 d3 74 76 48 83 c2 22 49 39 d7 74 7e 4c 89 f8 48 c1 e8 03 <42> 80 3c 20 00 74 08 4c 89 ff e8 cc 90 48 ff 49 8b 17 4c 39 f2 75
RSP: 0018:ffffc9000250fc00 EFLAGS: 00010a03
RAX: 13b0007fc0000143 RBX: ffff88810b1e7e00 RCX: ffffffff826a1859
RDX: dead000000000122 RSI: 0000000000000282 RDI: ffff888116361280
RBP: ffffc9000250fc20 R08: ffffffff8141997b R09: 0000000000000003
R10: fffffbfff0e9a04c R11: dffffc0000000001 R12: dffffc0000000000
R13: ffff888116361280 R14: ffff888116361280 R15: 9d8003fe00000a1d
FS: 0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2c11fffc CR3: 0000000006a0f000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 1 bytes skipped:
0: 48 85 db test %rbx,%rbx
3: 74 68 je 0x6d
5: 4d 85 ff test %r15,%r15
8: 74 74 je 0x7e
a: 48 ba 00 01 00 00 00 movabs $0xdead000000000100,%rdx
11: 00 ad de
14: 48 39 d3 cmp %rdx,%rbx
17: 74 76 je 0x8f
19: 48 83 c2 22 add $0x22,%rdx
1d: 49 39 d7 cmp %rdx,%r15
20: 74 7e je 0xa0
22: 4c 89 f8 mov %r15,%rax
25: 48 c1 e8 03 shr $0x3,%rax
* 29: 42 80 3c 20 00 cmpb $0x0,(%rax,%r12,1) <-- trapping instruction
2e: 74 08 je 0x38
30: 4c 89 ff mov %r15,%rdi
33: e8 cc 90 48 ff call 0xff489104
38: 49 8b 17 mov (%r15),%rdx
3b: 4c 39 f2 cmp %r14,%rdx
3e: 75 .byte 0x75