syzbot


KASAN: use-after-free Read in __tcf_qdisc_find

Status: auto-obsoleted due to no activity on 2023/03/27 21:31
Reported-by: syzbot+91c470513fd63f655a0b@syzkaller.appspotmail.com
First crash: 449d, last: 449d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in __tcf_qdisc_find net 1 536d 536d 22/26 fixed on 2023/02/24 13:50
android-5-10 KASAN: use-after-free Read in __tcf_qdisc_find 1 565d 565d 0/2 auto-obsoleted due to no activity on 2022/11/05 13:12

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __tcf_qdisc_find+0x743/0x7b0 net/sched/cls_api.c:1048
Read of size 4 at addr ffff88818719ec38 by task syz-executor.3/25585

CPU: 0 PID: 25585 Comm: syz-executor.3 Not tainted 5.15.75-syzkaller-00546-gd9d889009b78 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106
 print_address_description+0x87/0x3d0 mm/kasan/report.c:256
 __kasan_report mm/kasan/report.c:435 [inline]
 kasan_report+0x1a6/0x1f0 mm/kasan/report.c:452
 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308
 __tcf_qdisc_find+0x743/0x7b0 net/sched/cls_api.c:1048
 tc_new_tfilter+0x422/0x1d70 net/sched/cls_api.c:1998
 rtnetlink_rcv_msg+0x76a/0xc50 net/core/rtnetlink.c:5578
 netlink_rcv_skb+0x1f0/0x460 net/netlink/af_netlink.c:2523
 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5605
 netlink_unicast_kernel net/netlink/af_netlink.c:1321 [inline]
 netlink_unicast+0x91a/0xb10 net/netlink/af_netlink.c:1347
 netlink_sendmsg+0x946/0xd00 net/netlink/af_netlink.c:1942
 sock_sendmsg_nosec net/socket.c:704 [inline]
 sock_sendmsg net/socket.c:724 [inline]
 ____sys_sendmsg+0x597/0x8e0 net/socket.c:2412
 ___sys_sendmsg net/socket.c:2466 [inline]
 __sys_sendmsg+0x36f/0x450 net/socket.c:2495
 __do_sys_sendmsg net/socket.c:2504 [inline]
 __se_sys_sendmsg net/socket.c:2502 [inline]
 __x64_sys_sendmsg+0x7f/0x90 net/socket.c:2502
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f0f5d2e50d9
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:00007f0f5c037168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007f0f5d405050 RCX: 00007f0f5d2e50d9
RDX: 0000000000000000 RSI: 0000000020000140 RDI: 0000000000000003
RBP: 00007f0f5d340ae9 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffc060e4dcf R14: 00007f0f5c037300 R15: 0000000000022000
 </TASK>

Allocated by task 25582:
 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+0xdc/0x110 mm/kasan/common.c:512
 __kasan_kmalloc+0x9/0x10 mm/kasan/common.c:521
 kasan_kmalloc include/linux/kasan.h:254 [inline]
 __kmalloc+0x203/0x350 mm/slub.c:4423
 __kmalloc_node include/linux/slab.h:457 [inline]
 kmalloc_node include/linux/slab.h:614 [inline]
 kzalloc_node include/linux/slab.h:732 [inline]
 qdisc_alloc+0x74/0x770 net/sched/sch_generic.c:888
 qdisc_create_dflt+0x6b/0x3c0 net/sched/sch_generic.c:950
 attach_one_default_qdisc net/sched/sch_generic.c:1113 [inline]
 netdev_for_each_tx_queue include/linux/netdevice.h:2413 [inline]
 attach_default_qdiscs net/sched/sch_generic.c:1131 [inline]
 dev_activate+0x2da/0x1140 net/sched/sch_generic.c:1190
 __dev_open+0x3bd/0x4e0 net/core/dev.c:1502
 __dev_change_flags+0x1e0/0x6d0 net/core/dev.c:8788
 rtnl_configure_link net/core/rtnetlink.c:3133 [inline]
 __rtnl_newlink net/core/rtnetlink.c:3470 [inline]
 rtnl_newlink+0x18f4/0x2060 net/core/rtnetlink.c:3510
 rtnetlink_rcv_msg+0x951/0xc50 net/core/rtnetlink.c:5587
 netlink_rcv_skb+0x1f0/0x460 net/netlink/af_netlink.c:2523
 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5605
 netlink_unicast_kernel net/netlink/af_netlink.c:1321 [inline]
 netlink_unicast+0x91a/0xb10 net/netlink/af_netlink.c:1347
 netlink_sendmsg+0x946/0xd00 net/netlink/af_netlink.c:1942
 sock_sendmsg_nosec net/socket.c:704 [inline]
 sock_sendmsg net/socket.c:724 [inline]
 ____sys_sendmsg+0x597/0x8e0 net/socket.c:2412
 ___sys_sendmsg net/socket.c:2466 [inline]
 __sys_sendmsg+0x36f/0x450 net/socket.c:2495
 __do_sys_sendmsg net/socket.c:2504 [inline]
 __se_sys_sendmsg net/socket.c:2502 [inline]
 __x64_sys_sendmsg+0x7f/0x90 net/socket.c:2502
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x61/0xcb

Freed by task 25583:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4c/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:220 [inline]
 slab_free_hook mm/slub.c:1721 [inline]
 slab_free_freelist_hook+0xc9/0x1a0 mm/slub.c:1747
 slab_free mm/slub.c:3515 [inline]
 kfree+0xc8/0x210 mm/slub.c:4575
 qdisc_free net/sched/sch_generic.c:1001 [inline]
 qdisc_free_cb+0xa1/0xd0 net/sched/sch_generic.c:1008
 rcu_do_batch+0x55b/0xbe0 kernel/rcu/tree.c:2509
 rcu_core+0x506/0x1000 kernel/rcu/tree.c:2749
 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2762
 __do_softirq+0x27e/0x5dc 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+0x140/0x1400 kernel/rcu/tree.c:3073
 qdisc_destroy+0x15d/0x260 net/sched/sch_generic.c:1032
 qdisc_put+0x83/0xf0 net/sched/sch_generic.c:1044
 notify_and_destroy net/sched/sch_api.c:1012 [inline]
 qdisc_graft+0xd59/0x1270 net/sched/sch_api.c:1084
 tc_modify_qdisc+0xd24/0x14b0 net/sched/sch_api.c:1680
 rtnetlink_rcv_msg+0x951/0xc50 net/core/rtnetlink.c:5587
 netlink_rcv_skb+0x1f0/0x460 net/netlink/af_netlink.c:2523
 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5605
 netlink_unicast_kernel net/netlink/af_netlink.c:1321 [inline]
 netlink_unicast+0x91a/0xb10 net/netlink/af_netlink.c:1347
 netlink_sendmsg+0x946/0xd00 net/netlink/af_netlink.c:1942
 sock_sendmsg_nosec net/socket.c:704 [inline]
 sock_sendmsg net/socket.c:724 [inline]
 ____sys_sendmsg+0x597/0x8e0 net/socket.c:2412
 ___sys_sendmsg net/socket.c:2466 [inline]
 __sys_sendmsg+0x36f/0x450 net/socket.c:2495
 __do_sys_sendmsg net/socket.c:2504 [inline]
 __se_sys_sendmsg net/socket.c:2502 [inline]
 __x64_sys_sendmsg+0x7f/0x90 net/socket.c:2502
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x61/0xcb

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
 kvfree_call_rcu+0xb2/0x7f0 kernel/rcu/tree.c:3559
 neigh_destroy+0x421/0x560 net/core/neighbour.c:873
 neigh_release include/net/neighbour.h:434 [inline]
 neigh_cleanup_and_release+0x71/0xb0 net/core/neighbour.c:103
 neigh_del net/core/neighbour.c:197 [inline]
 neigh_remove_one+0x3a1/0x420 net/core/neighbour.c:218
 neigh_forced_gc net/core/neighbour.c:248 [inline]
 neigh_alloc net/core/neighbour.c:410 [inline]
 ___neigh_create+0x3ee/0x1b50 net/core/neighbour.c:604
 __neigh_create+0x32/0x40 net/core/neighbour.c:692
 ip6_finish_output2+0x9ef/0x1710 net/ipv6/ip6_output.c:123
 __ip6_finish_output+0x674/0x850 net/ipv6/ip6_output.c:191
 ip6_finish_output+0x20b/0x220 net/ipv6/ip6_output.c:201
 NF_HOOK_COND include/linux/netfilter.h:299 [inline]
 ip6_output+0x211/0x4c0 net/ipv6/ip6_output.c:224
 dst_output include/net/dst.h:450 [inline]
 NF_HOOK include/linux/netfilter.h:310 [inline]
 ndisc_send_skb+0x779/0xce0 net/ipv6/ndisc.c:508
 ndisc_send_rs+0x512/0x680 net/ipv6/ndisc.c:702
 addrconf_rs_timer+0x2d4/0x610 net/ipv6/addrconf.c:3949
 call_timer_fn+0x35/0x270 kernel/time/timer.c:1427
 expire_timers+0x21b/0x3a0 kernel/time/timer.c:1472
 __run_timers+0x598/0x6f0 kernel/time/timer.c:1743
 run_timer_softirq+0x69/0xf0 kernel/time/timer.c:1756
 __do_softirq+0x27e/0x5dc kernel/softirq.c:565

The buggy address belongs to the object at ffff88818719ec00
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 56 bytes inside of
 512-byte region [ffff88818719ec00, ffff88818719ee00)
The buggy address belongs to the page:
page:ffffea00061c6700 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x18719c
head:ffffea00061c6700 order:2 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100042f00
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 17684, ts 2103174349122, free_ts 2098520109647
 set_page_owner include/linux/page_owner.h:33 [inline]
 post_alloc_hook+0x1ab/0x1b0 mm/page_alloc.c:2495
 prep_new_page mm/page_alloc.c:2501 [inline]
 get_page_from_freelist+0x38b/0x400 mm/page_alloc.c:4281
 __alloc_pages+0x3a8/0x7c0 mm/page_alloc.c:5548
 allocate_slab+0x62/0x580 mm/slub.c:1928
 new_slab mm/slub.c:1991 [inline]
 ___slab_alloc+0x2e2/0x6f0 mm/slub.c:3024
 __slab_alloc+0x4a/0x90 mm/slub.c:3111
 slab_alloc_node mm/slub.c:3202 [inline]
 slab_alloc mm/slub.c:3244 [inline]
 __kmalloc+0x25b/0x350 mm/slub.c:4419
 kmalloc include/linux/slab.h:596 [inline]
 kzalloc include/linux/slab.h:721 [inline]
 alloc_workqueue+0x156/0x11d0 kernel/workqueue.c:4329
 tipc_crypto_start+0xd4/0x6a0 net/tipc/crypto.c:1483
 tipc_init_net+0x235/0x370 net/tipc/core.c:72
 ops_init+0x19e/0x390 net/core/net_namespace.c:134
 setup_net+0x34b/0xbb0 net/core/net_namespace.c:322
 copy_net_ns+0x359/0x5c0 net/core/net_namespace.c:466
 create_new_namespaces+0x3d8/0x6e0 kernel/nsproxy.c:110
 copy_namespaces+0x1d1/0x220 kernel/nsproxy.c:178
 copy_process+0x12dd/0x3250 kernel/fork.c:2248
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:26 [inline]
 free_pages_prepare mm/page_alloc.c:1364 [inline]
 free_pcp_prepare+0x448/0x450 mm/page_alloc.c:1435
 free_unref_page_prepare mm/page_alloc.c:3433 [inline]
 free_unref_page+0x9c/0x370 mm/page_alloc.c:3513
 free_the_page mm/page_alloc.c:706 [inline]
 __free_pages+0xd8/0x100 mm/page_alloc.c:5621
 __free_slab+0xf0/0x1d0 mm/slub.c:2016
 free_slab mm/slub.c:2031 [inline]
 discard_slab mm/slub.c:2037 [inline]
 __unfreeze_partials+0x17d/0x1b0 mm/slub.c:2523
 put_cpu_partial+0xc4/0x120 mm/slub.c:2603
 __slab_free+0x1c0/0x2f0 mm/slub.c:3384
 do_slab_free mm/slub.c:3503 [inline]
 ___cache_free+0x112/0x130 mm/slub.c:3522
 qlink_free+0x4d/0x90 mm/kasan/quarantine.c:157
 qlist_free_all+0x4c/0xc0 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:244 [inline]
 slab_post_alloc_hook mm/slab.h:550 [inline]
 slab_alloc_node mm/slub.c:3236 [inline]
 slab_alloc mm/slub.c:3244 [inline]
 kmem_cache_alloc+0x189/0x2f0 mm/slub.c:3249
 kmem_cache_zalloc include/linux/slab.h:711 [inline]
 alloc_buffer_head+0x26/0x110 fs/buffer.c:3311
 alloc_page_buffers+0x198/0x3a0 fs/buffer.c:832
 create_empty_buffers+0x3d/0x4e0 fs/buffer.c:1562

Memory state around the buggy address:
 ffff88818719eb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88818719eb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88818719ec00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                        ^
 ffff88818719ec80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88818719ed00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/12/01 01:40 android13-5.15-lts d9d889009b78 4c2a66e8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-15 KASAN: use-after-free Read in __tcf_qdisc_find
* Struck through repros no longer work on HEAD.