syzbot


KASAN: use-after-free Read in slip_open

Status: auto-obsoleted due to no activity on 2023/09/20 09:40
Reported-by: syzbot+ba2f391ea85dc8850df5@syzkaller.appspotmail.com
First crash: 398d, last: 398d
Similar bugs (6)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: use-after-free Read in slip_open C done done 7 1685d 1696d 1/1 fixed on 2020/01/03 09:37
upstream KASAN: use-after-free Read in slip_open net C done 3 1694d 1695d 15/27 fixed on 2019/12/13 00:31
upstream KASAN: use-after-free Read in slip_open (2) net 4 639d 792d 0/27 auto-obsoleted due to no activity on 2023/02/11 15:10
linux-4.14 KASAN: use-after-free Read in slip_open C done done 2 1692d 1692d 1/1 fixed on 2019/12/28 10:32
upstream KASAN: slab-use-after-free Read in slip_open (2) net 1 80d 76d 0/27 moderation: reported on 2024/04/29 07:50
upstream KASAN: slab-use-after-free Read in slip_open net 2 444d 456d 0/27 auto-obsoleted due to no activity on 2023/08/05 06:52

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in sl_sync drivers/net/slip/slip.c:732 [inline]
BUG: KASAN: use-after-free in slip_open+0x1e8/0xcb8 drivers/net/slip/slip.c:806
Read of size 4 at addr ffff00012b2760c0 by task syz-executor.0/26373

CPU: 1 PID: 26373 Comm: syz-executor.0 Not tainted 6.1.33-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023
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_load4_noabort+0x2c/0x38 mm/kasan/report_generic.c:350
 sl_sync drivers/net/slip/slip.c:732 [inline]
 slip_open+0x1e8/0xcb8 drivers/net/slip/slip.c:806
 tty_ldisc_open drivers/tty/tty_ldisc.c:433 [inline]
 tty_set_ldisc+0x41c/0x73c drivers/tty/tty_ldisc.c:558
 tiocsetd+0x100/0x13c drivers/tty/tty_io.c:2428
 tty_ioctl+0xba0/0xd8c drivers/tty/tty_io.c:2709
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl fs/ioctl.c:856 [inline]
 __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:856
 __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:581

Allocated by task 26364:
 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]
 __do_kmalloc_node mm/slab_common.c:955 [inline]
 __kmalloc_node+0xe0/0x1d0 mm/slab_common.c:962
 kmalloc_node include/linux/slab.h:579 [inline]
 kvmalloc_node+0x84/0x1e4 mm/util.c:581
 kvmalloc include/linux/slab.h:706 [inline]
 kvzalloc include/linux/slab.h:714 [inline]
 alloc_netdev_mqs+0x94/0xba8 net/core/dev.c:10585
 sl_alloc drivers/net/slip/slip.c:756 [inline]
 slip_open+0x320/0xcb8 drivers/net/slip/slip.c:817
 tty_ldisc_open drivers/tty/tty_ldisc.c:433 [inline]
 tty_set_ldisc+0x41c/0x73c drivers/tty/tty_ldisc.c:558
 tiocsetd+0x100/0x13c drivers/tty/tty_io.c:2428
 tty_ioctl+0xba0/0xd8c drivers/tty/tty_io.c:2709
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl fs/ioctl.c:856 [inline]
 __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:856
 __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:581

Freed by task 26363:
 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
 kvfree+0x40/0x50 mm/util.c:627
 netdev_freemem+0x4c/0x64 net/core/dev.c:10539
 netdev_release+0x88/0xb0 net/core/net-sysfs.c:1910
 device_release+0x8c/0x1ac
 kobject_cleanup lib/kobject.c:681 [inline]
 kobject_release lib/kobject.c:712 [inline]
 kref_put include/linux/kref.h:65 [inline]
 kobject_put+0x2a8/0x41c lib/kobject.c:729
 netdev_run_todo+0xcf0/0xe08 net/core/dev.c:10375
 rtnl_unlock+0x14/0x20 net/core/rtnetlink.c:147
 unregister_netdev+0x17c/0x1f0 net/core/dev.c:10904
 slip_close+0x13c/0x164 drivers/net/slip/slip.c:906
 tty_ldisc_close drivers/tty/tty_ldisc.c:456 [inline]
 tty_ldisc_kill+0x1b0/0x300 drivers/tty/tty_ldisc.c:608
 tty_ldisc_release+0x190/0x23c drivers/tty/tty_ldisc.c:776
 tty_release_struct+0x34/0xd4 drivers/tty/tty_io.c:1689
 tty_release+0xb64/0x1014 drivers/tty/tty_io.c:1860
 __fput+0x30c/0x7bc fs/file_table.c:320
 ____fput+0x20/0x30 fs/file_table.c:348
 task_work_run+0x240/0x2f0 kernel/task_work.c:179
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 do_notify_resume+0x2144/0x3470 arch/arm64/kernel/signal.c:1132
 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline]
 exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline]
 el0_svc+0x9c/0x168 arch/arm64/kernel/entry-common.c:638
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581

The buggy address belongs to the object at ffff00012b276000
 which belongs to the cache kmalloc-cg-4k of size 4096
The buggy address is located 192 bytes inside of
 4096-byte region [ffff00012b276000, ffff00012b277000)

The buggy address belongs to the physical page:
page:000000003528a3b1 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x16b270
head:000000003528a3b1 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff0000d58c9b01
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 fffffc0003228400 dead000000000003 ffff0000c0003500
raw: 0000000000000000 0000000000040004 00000001ffffffff ffff0000d58c9b01
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff00012b275f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff00012b276000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff00012b276080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                           ^
 ffff00012b276100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff00012b276180: 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
2023/06/12 09:39 linux-6.1.y 2f3918bc53fb 49519f06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in slip_open
* Struck through repros no longer work on HEAD.