syzbot


KASAN: use-after-free Read in route4_destroy

Status: auto-closed as invalid on 2020/07/21 15:40
Reported-by: syzbot+d635517d87f68b20722c@syzkaller.appspotmail.com
First crash: 1722d, last: 1716d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in route4_destroy net C 2 1722d 1722d 0/28 auto-obsoleted due to no activity on 2022/08/30 17:50

Sample crash report:
bond1 (unregistering): Releasing active interface bridge3
bond1 (unregistering): Releasing active interface bridge2
bond1 (unregistering): Releasing active interface bridge1
bond1 (unregistering): Released all slaves
==================================================================
BUG: KASAN: use-after-free in route4_destroy+0x698/0x7e0 net/sched/cls_route.c:298
Read of size 8 at addr ffff8880a6427500 by task kworker/u4:1/23

CPU: 0 PID: 23 Comm: kworker/u4:1 Not tainted 4.19.112-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: netns cleanup_net
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x188/0x20d lib/dump_stack.c:118
 print_address_description.cold+0x7c/0x212 mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report mm/kasan/report.c:412 [inline]
 kasan_report.cold+0x88/0x2b9 mm/kasan/report.c:396
 route4_destroy+0x698/0x7e0 net/sched/cls_route.c:298
 tcf_proto_destroy+0x5d/0xe0 net/sched/cls_api.c:190
 tcf_chain_flush+0x1ed/0x330 net/sched/cls_api.c:362
 tcf_block_put_ext.part.0+0x418/0x9a0 net/sched/cls_api.c:770
 tcf_block_put_ext net/sched/cls_api.c:754 [inline]
 tcf_block_put+0xad/0xf8 net/sched/cls_api.c:797
 hfsc_destroy_qdisc+0xe0/0x280 net/sched/sch_hfsc.c:1509
 qdisc_destroy+0x17c/0x6b0 net/sched/sch_generic.c:982
 dev_shutdown+0x2b5/0x47a net/sched/sch_generic.c:1300
 rollback_registered_many+0x64a/0xc40 net/core/dev.c:8173
 unregister_netdevice_many.part.0+0x16/0x1e0 net/core/dev.c:9294
 unregister_netdevice_many net/core/dev.c:9293 [inline]
 default_device_exit_batch+0x2ff/0x3c0 net/core/dev.c:9765
 ops_exit_list.isra.0+0xef/0x140 net/core/net_namespace.c:156
 cleanup_net+0x3bf/0x850 net/core/net_namespace.c:553
 process_one_work+0x91f/0x1640 kernel/workqueue.c:2155
 worker_thread+0x96/0xe20 kernel/workqueue.c:2298
 kthread+0x34a/0x420 kernel/kthread.c:246
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415

Allocated by task 17891:
 set_track mm/kasan/kasan.c:460 [inline]
 kasan_kmalloc mm/kasan/kasan.c:553 [inline]
 kasan_kmalloc+0xbf/0xe0 mm/kasan/kasan.c:531
 kmem_cache_alloc_trace+0x14d/0x7a0 mm/slab.c:3625
 kmalloc include/linux/slab.h:515 [inline]
 kzalloc include/linux/slab.h:709 [inline]
 snd_seq_pool_new+0x40/0x240 sound/core/seq/seq_memory.c:475
 seq_create_client1+0x64/0x4b0 sound/core/seq/seq_clientmgr.c:214
 snd_seq_open sound/core/seq/seq_clientmgr.c:315 [inline]
 snd_seq_open+0x57/0x580 sound/core/seq/seq_clientmgr.c:303
 snd_open+0x212/0x3e2 sound/core/sound.c:175
 chrdev_open+0x219/0x5c0 fs/char_dev.c:423
 do_dentry_open+0x4a8/0x1160 fs/open.c:796
 do_last fs/namei.c:3421 [inline]
 path_openat+0x1031/0x4200 fs/namei.c:3537
 do_filp_open+0x1a1/0x280 fs/namei.c:3567
 do_sys_open+0x3c0/0x500 fs/open.c:1085
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 17887:
 set_track mm/kasan/kasan.c:460 [inline]
 __kasan_slab_free+0xf7/0x140 mm/kasan/kasan.c:521
 __cache_free mm/slab.c:3503 [inline]
 kfree+0xce/0x220 mm/slab.c:3822
 snd_seq_pool_delete+0x4d/0x70 sound/core/seq/seq_memory.c:503
 seq_free_client1.part.0+0x167/0x270 sound/core/seq/seq_clientmgr.c:267
 seq_free_client1 sound/core/seq/seq_clientmgr.c:256 [inline]
 seq_free_client+0x7b/0xf0 sound/core/seq/seq_clientmgr.c:285
 snd_seq_release+0x4d/0xe0 sound/core/seq/seq_clientmgr.c:366
 __fput+0x2cd/0x890 fs/file_table.c:278
 task_work_run+0x13f/0x1b0 kernel/task_work.c:113
 tracehook_notify_resume include/linux/tracehook.h:193 [inline]
 exit_to_usermode_loop+0x25a/0x2b0 arch/x86/entry/common.c:167
 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:271 [inline]
 do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff8880a6427500
 which belongs to the cache kmalloc-192 of size 192
The buggy address is located 0 bytes inside of
 192-byte region [ffff8880a6427500, ffff8880a64275c0)
The buggy address belongs to the page:
page:ffffea00029909c0 count:1 mapcount:0 mapping:ffff88812c3dc040 index:0xffff8880a6427a00
flags: 0xfffe0000000100(slab)
raw: 00fffe0000000100 ffffea000269cc48 ffffea0002a4e108 ffff88812c3dc040
raw: ffff8880a6427a00 ffff8880a6427000 000000010000000d 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880a6427400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880a6427480: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
>ffff8880a6427500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                   ^
 ffff8880a6427580: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff8880a6427600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/03/23 15:39 linux-4.19.y 14cfdbd39e31 84f999d6 .config console log report ci2-linux-4-19
2020/03/18 23:50 linux-4.19.y 93556fb211fa 2c31c529 .config console log report ci2-linux-4-19
2020/03/18 10:26 linux-4.19.y 93556fb211fa 0a96a13c .config console log report ci2-linux-4-19
2020/03/18 07:56 linux-4.19.y 93556fb211fa 97bc55ce .config console log report ci2-linux-4-19
* Struck through repros no longer work on HEAD.