syzbot


KASAN: use-after-free Read in __schedule (2)

Status: auto-closed as invalid on 2022/05/18 22:28
Reported-by: syzbot+9da12bc32af80dd00aaa@syzkaller.appspotmail.com
First crash: 820d, last: 820d
Similar bugs (9)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-54 KASAN: use-after-free Read in __schedule 3 1480d 1507d 0/2 auto-closed as invalid on 2020/07/28 03:17
upstream KASAN: use-after-free Read in __schedule kvm C 145 2309d 2310d 4/26 fixed on 2018/02/14 17:41
linux-4.19 KASAN: use-after-free Read in __schedule 1 1144d 1144d 0/1 auto-closed as invalid on 2021/06/29 13:25
upstream KASAN: use-after-free Read in __schedule (2) kvm C done 961 1867d 2086d 13/26 fixed on 2019/11/20 22:01
upstream KMSAN: uninit-value in __schedule (4) reiserfs sctp C error 4 229d 225d 0/26 auto-obsoleted due to no activity on 2023/12/10 17:35
upstream KMSAN: uninit-value in __schedule (5) kernel 1 12d 8d04h 0/26 upstream: reported on 2024/04/10 09:12
android-54 BUG: unable to handle kernel paging request in __schedule C 12 1148d 1304d 0/2 auto-obsoleted due to no activity on 2023/04/17 21:57
upstream KMSAN: uninit-value in __schedule (3) net trace 2 427d 430d 0/26 auto-obsoleted due to no activity on 2023/05/17 02:32
upstream KMSAN: uninit-value in __schedule (2) kernel 1 600d 600d 0/26 auto-obsoleted due to no activity on 2022/11/24 18:35

Sample crash report:
raw: 00fff00000000000 ffffea00014ce2c8 ffff8880ba12ea78 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
==================================================================
page dumped because: VM_BUG_ON_PAGE(page_ref_count(page) == 0)
BUG: KASAN: use-after-free in schedule_debug kernel/sched/core.c:3329 [inline]
BUG: KASAN: use-after-free in __schedule+0x1ae3/0x2040 kernel/sched/core.c:3439
------------[ cut here ]------------
Read of size 8 at addr ffff8880a0f80000 by task syz-executor.4/18981
kernel BUG at include/linux/mm.h:519!

CPU: 0 PID: 18981 Comm: syz-executor.4 Not tainted 4.19.211-syzkaller #0
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
CPU: 1 PID: 18908 Comm: syz-executor.3 Not tainted 4.19.211-syzkaller #0
Call Trace:
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
RIP: 0010:put_page_testzero include/linux/mm.h:519 [inline]
RIP: 0010:put_page include/linux/mm.h:962 [inline]
RIP: 0010:tls_sk_proto_close+0x884/0xc20 net/tls/tls_main.c:277
 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
Code: 92 f9 ff ff e8 2d ac 69 fa 4c 8b 24 24 49 83 ec 01 e9 c3 fa ff ff e8 1b ac 69 fa 48 c7 c6 60 77 58 89 4c 89 e7 e8 cc 3d 91 fa <0f> 0b e8 05 ac 69 fa be 00 00 10 00 48 89 ef e8 38 63 76 ff e9 d6
 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354
RSP: 0018:ffff888047687a50 EFLAGS: 00010246
RAX: 0000000000040000 RBX: ffff888050c4e700 RCX: ffffc9000667e000
 kasan_report mm/kasan/report.c:412 [inline]
 __asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433
RDX: 0000000000040000 RSI: ffffffff86f8d964 RDI: ffffea000283e038
RBP: ffff888090da3000 R08: 000000000000003e R09: 0000000000000000
 schedule_debug kernel/sched/core.c:3329 [inline]
 __schedule+0x1ae3/0x2040 kernel/sched/core.c:3439
R10: 0000000000000005 R11: 0000000000000000 R12: ffffea000283e000
R13: ffffea000283e034 R14: dffffc0000000000 R15: ffff8880a0bd50c0
FS:  00007ff756879700(0000) GS:ffff8880ba100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f523ec7c028 CR3: 00000000ab49b000 CR4: 00000000003426e0
 schedule+0x8d/0x1b0 kernel/sched/core.c:3561
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
 schedule_timeout+0x92d/0xfe0 kernel/time/timer.c:1794
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 inet_release+0xd7/0x1e0 net/ipv4/af_inet.c:427
 do_wait_for_common kernel/sched/completion.c:83 [inline]
 __wait_for_common kernel/sched/completion.c:104 [inline]
 wait_for_common+0x29c/0x470 kernel/sched/completion.c:115
 inet6_release+0x4c/0x70 net/ipv6/af_inet6.c:472
 __sock_release+0xcd/0x2a0 net/socket.c:599
 sock_close+0x15/0x20 net/socket.c:1214
 __fput+0x2ce/0x890 fs/file_table.c:278
 wait_for_completion_killable+0x14/0x30 kernel/sched/completion.c:241
 task_work_run+0x148/0x1c0 kernel/task_work.c:113
 __kthread_create_on_node+0x250/0x410 kernel/kthread.c:324
 get_signal+0x1b64/0x1f70 kernel/signal.c:2400
 do_signal+0x8f/0x1670 arch/x86/kernel/signal.c:799
 kthread_create_on_node+0xbb/0xf0 kernel/kthread.c:392
 exit_to_usermode_loop+0x204/0x2a0 arch/x86/entry/common.c:163
 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
 loop_prepare_queue drivers/block/loop.c:929 [inline]
 loop_set_fd drivers/block/loop.c:979 [inline]
 lo_ioctl+0xae5/0x20e0 drivers/block/loop.c:1576
RIP: 0033:0x7ff757f03fe9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 bc ff ff ff f7 d8 64 89 01 48
 __blkdev_driver_ioctl block/ioctl.c:303 [inline]
 blkdev_ioctl+0x5cb/0x1a80 block/ioctl.c:601
RSP: 002b:00007ff756879168 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
RAX: 00000000001d8000 RBX: 00007ff758016f60 RCX: 00007ff757f03fe9
RDX: 00000000e0ffffff RSI: 00000000200005c0 RDI: 0000000000000003
RBP: 00007ff757f5e08d R08: 0000000000000000 R09: 00000000000000d8
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffd8e29c2bf R14: 00007ff756879300 R15: 0000000000022000
Modules linked in:
 block_ioctl+0xe9/0x130 fs/block_dev.c:1906
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:501 [inline]
 do_vfs_ioctl+0xcdb/0x12e0 fs/ioctl.c:688
---[ end trace dedc6ac61ba7981e ]---
RIP: 0010:put_page_testzero include/linux/mm.h:519 [inline]
RIP: 0010:put_page include/linux/mm.h:962 [inline]
RIP: 0010:tls_sk_proto_close+0x884/0xc20 net/tls/tls_main.c:277
 ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705
Code: 92 f9 ff ff e8 2d ac 69 fa 4c 8b 24 24 49 83 ec 01 e9 c3 fa ff ff e8 1b ac 69 fa 48 c7 c6 60 77 58 89 4c 89 e7 e8 cc 3d 91 fa <0f> 0b e8 05 ac 69 fa be 00 00 10 00 48 89 ef e8 38 63 76 ff e9 d6
 __do_sys_ioctl fs/ioctl.c:712 [inline]
 __se_sys_ioctl fs/ioctl.c:710 [inline]
 __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710
RSP: 0018:ffff888047687a50 EFLAGS: 00010246
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7fe36604ada7
Code: 3c 1c 48 f7 d8 49 39 c4 72 b8 e8 04 54 02 00 85 c0 78 bd 48 83 c4 08 4c 89 e0 5b 41 5c c3 0f 1f 44 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
RAX: 0000000000040000 RBX: ffff888050c4e700 RCX: ffffc9000667e000
RSP: 002b:00007fe36497df28 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fe3660949c8 RCX: 00007fe36604ada7
RDX: 0000000000000005 RSI: 0000000000004c00 RDI: 0000000000000006
RBP: 0000000000000006 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005
R13: 0000000000000005 R14: 00000000200002a8 R15: 0000000000000007

The buggy address belongs to the page:
page:ffffea000283e000 count:0 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0xfff00000000000()
raw: 00fff00000000000 ffffea00014ce2c8 ffffea0002d47008 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880a0f7ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8880a0f7ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880a0f80000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                   ^
 ffff8880a0f80080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8880a0f80100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/01/18 22:27 linux-4.19.y 3f8a27f9e27b 731a2d23 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in __schedule
* Struck through repros no longer work on HEAD.