syzbot


KASAN: use-after-free Read in dump_schedule

Status: closed as invalid on 2024/06/25 09:04
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+ec83c5ce379ab3116017@syzkaller.appspotmail.com
First crash: 242d, last: 222d
Fix bisection: failed (error log, bisect log)
  
Bug presence (1)
Date Name Commit Repro Result
2024/03/26 upstream (ToT) 928a87efa423 C [report] KASAN: slab-use-after-free Read in advance_sched
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in dump_schedule net C done done 7 1430d 1541d 19/28 fixed on 2021/03/10 01:48
linux-5.15 KASAN: use-after-free Read in dump_schedule origin:upstream missing-backport C error 2 26d 245d 0/3 upstream: reported C repro on 2024/03/23 08:43
upstream KASAN: use-after-free Read in dump_schedule (2) net C done inconclusive 10 718d 1279d 0/28 auto-obsoleted due to no activity on 2023/10/12 02:40
Last patch testing requests (1)
Created Duration User Patch Repo Result
2024/06/21 09:26 1h16m radoslaw.zielonek@gmail.com linux-6.1.y OK log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in dump_schedule+0xc8/0x7a0 net/sched/sch_taprio.c:1932
Read of size 8 at addr ffff0000e65c9a40 by task syz-executor.0/4612

CPU: 1 PID: 4612 Comm: syz-executor.0 Not tainted 6.1.82-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024
Call trace:
 dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:284 [inline]
 print_report+0x174/0x4c0 mm/kasan/report.c:395
 kasan_report+0xd4/0x130 mm/kasan/report.c:495
 __asan_report_load8_noabort+0x2c/0x38 mm/kasan/report_generic.c:351
 dump_schedule+0xc8/0x7a0 net/sched/sch_taprio.c:1932
 taprio_dump+0xa0c/0xd80 net/sched/sch_taprio.c:2029
 tc_fill_qdisc+0x55c/0xf70 net/sched/sch_api.c:949
 qdisc_notify+0x1a0/0x338 net/sched/sch_api.c:1021
 tc_modify_qdisc+0x16d0/0x186c net/sched/sch_api.c:1722
 rtnetlink_rcv_msg+0x72c/0xd94 net/core/rtnetlink.c:6121
 netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2508
 rtnetlink_rcv+0x28/0x38 net/core/rtnetlink.c:6139
 netlink_unicast_kernel net/netlink/af_netlink.c:1326 [inline]
 netlink_unicast+0x65c/0x898 net/netlink/af_netlink.c:1352
 netlink_sendmsg+0x834/0xb18 net/netlink/af_netlink.c:1874
 sock_sendmsg_nosec net/socket.c:718 [inline]
 __sock_sendmsg net/socket.c:730 [inline]
 ____sys_sendmsg+0x55c/0x848 net/socket.c:2514
 ___sys_sendmsg net/socket.c:2568 [inline]
 __sys_sendmmsg+0x318/0x7d8 net/socket.c:2654
 __do_sys_sendmmsg net/socket.c:2683 [inline]
 __se_sys_sendmmsg net/socket.c:2680 [inline]
 __arm64_sys_sendmmsg+0xa0/0xbc net/socket.c:2680
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

Allocated by task 4607:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
 kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:505
 ____kasan_kmalloc mm/kasan/common.c:374 [inline]
 __kasan_kmalloc+0xac/0xc4 mm/kasan/common.c:383
 kasan_kmalloc include/linux/kasan.h:211 [inline]
 kmalloc_trace+0x7c/0x94 mm/slab_common.c:1050
 kmalloc include/linux/slab.h:556 [inline]
 kzalloc include/linux/slab.h:692 [inline]
 taprio_change+0x96c/0x3834 net/sched/sch_taprio.c:1579
 qdisc_change net/sched/sch_api.c:1390 [inline]
 tc_modify_qdisc+0x1470/0x186c net/sched/sch_api.c:1720
 rtnetlink_rcv_msg+0x72c/0xd94 net/core/rtnetlink.c:6121
 netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2508
 rtnetlink_rcv+0x28/0x38 net/core/rtnetlink.c:6139
 netlink_unicast_kernel net/netlink/af_netlink.c:1326 [inline]
 netlink_unicast+0x65c/0x898 net/netlink/af_netlink.c:1352
 netlink_sendmsg+0x834/0xb18 net/netlink/af_netlink.c:1874
 sock_sendmsg_nosec net/socket.c:718 [inline]
 __sock_sendmsg net/socket.c:730 [inline]
 ____sys_sendmsg+0x55c/0x848 net/socket.c:2514
 ___sys_sendmsg net/socket.c:2568 [inline]
 __sys_sendmmsg+0x318/0x7d8 net/socket.c:2654
 __do_sys_sendmmsg net/socket.c:2683 [inline]
 __se_sys_sendmmsg net/socket.c:2680 [inline]
 __arm64_sys_sendmmsg+0xa0/0xbc net/socket.c:2680
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

Freed by task 15:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
 kasan_save_free_info+0x38/0x5c mm/kasan/generic.c:516
 ____kasan_slab_free+0x144/0x1c0 mm/kasan/common.c:236
 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:244
 kasan_slab_free include/linux/kasan.h:177 [inline]
 slab_free_hook mm/slub.c:1724 [inline]
 slab_free_freelist_hook mm/slub.c:1750 [inline]
 slab_free mm/slub.c:3661 [inline]
 __kmem_cache_free+0x2c0/0x4b4 mm/slub.c:3674
 kfree+0xcc/0x1b8 mm/slab_common.c:1007
 taprio_free_sched_cb+0x154/0x174 net/sched/sch_taprio.c:127
 rcu_do_batch kernel/rcu/tree.c:2296 [inline]
 rcu_core+0x878/0x1c10 kernel/rcu/tree.c:2556
 rcu_core_si+0x10/0x1c kernel/rcu/tree.c:2573
 __do_softirq+0x314/0xe38 kernel/softirq.c:571

Last potentially related work creation:
 kasan_save_stack+0x40/0x70 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xcc/0xe8 mm/kasan/generic.c:486
 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:496
 call_rcu+0xfc/0xa40 kernel/rcu/tree.c:2844
 taprio_change+0x2e7c/0x3834 net/sched/sch_taprio.c:1686
 qdisc_change net/sched/sch_api.c:1390 [inline]
 tc_modify_qdisc+0x1470/0x186c net/sched/sch_api.c:1720
 rtnetlink_rcv_msg+0x72c/0xd94 net/core/rtnetlink.c:6121
 netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2508
 rtnetlink_rcv+0x28/0x38 net/core/rtnetlink.c:6139
 netlink_unicast_kernel net/netlink/af_netlink.c:1326 [inline]
 netlink_unicast+0x65c/0x898 net/netlink/af_netlink.c:1352
 netlink_sendmsg+0x834/0xb18 net/netlink/af_netlink.c:1874
 sock_sendmsg_nosec net/socket.c:718 [inline]
 __sock_sendmsg net/socket.c:730 [inline]
 ____sys_sendmsg+0x55c/0x848 net/socket.c:2514
 ___sys_sendmsg net/socket.c:2568 [inline]
 __sys_sendmmsg+0x318/0x7d8 net/socket.c:2654
 __do_sys_sendmmsg net/socket.c:2683 [inline]
 __se_sys_sendmmsg net/socket.c:2680 [inline]
 __arm64_sys_sendmmsg+0xa0/0xbc net/socket.c:2680
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

The buggy address belongs to the object at ffff0000e65c9a00
 which belongs to the cache kmalloc-128 of size 128
The buggy address is located 64 bytes inside of
 128-byte region [ffff0000e65c9a00, ffff0000e65c9a80)

The buggy address belongs to the physical page:
page:000000001433dc37 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1265c9
flags: 0x5ffc00000000200(slab|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000000200 fffffc00039920c0 dead000000000004 ffff0000c0002300
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff0000e65c9900: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
 ffff0000e65c9980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff0000e65c9a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                           ^
 ffff0000e65c9a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff0000e65c9b00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
netlink: 20 bytes leftover after parsing attributes in process `syz-executor.0'.

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/03/25 15:22 linux-6.1.y d7543167affd 0ea90952 .config console log report syz [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in dump_schedule
2024/04/14 10:53 linux-6.1.y cd5d98c0556c c8349e48 .config console log report syz [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in dump_schedule
* Struck through repros no longer work on HEAD.