syzbot


KASAN: use-after-free Write in __run_timers

Status: upstream: reported syz repro on 2020/07/11 21:22
Reported-by: syzbot+0a7161c0b95ba157f096@syzkaller.appspotmail.com
First crash: 878d, last: 7d08h
similar bugs (4):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Write in __run_timers 6144 1871d 1931d 3/24 fixed on 2017/11/11 01:37
upstream KASAN: invalid-access Write in __run_timers 8 655d 661d 0/24 auto-closed as invalid on 2021/05/20 13:15
android-54 KASAN: slab-out-of-bounds Write in __run_timers 4 526d 716d 0/2 auto-closed as invalid on 2021/10/26 12:53
upstream KASAN: slab-out-of-bounds Write in __run_timers 19 1905d 1922d 0/24 closed as invalid on 2017/10/22 12:45

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in hlist_move_list include/linux/list.h:843 [inline]
BUG: KASAN: use-after-free in __collect_expired_timers kernel/time/timer.c:1470 [inline]
BUG: KASAN: use-after-free in collect_expired_timers kernel/time/timer.c:1705 [inline]
BUG: KASAN: use-after-free in __run_timers+0x55e/0x7b0 kernel/time/timer.c:1769
Write of size 8 at addr ffff8881c4b2f188 by task systemd-udevd/6641

CPU: 0 PID: 6641 Comm: systemd-udevd Not tainted 5.4.52-syzkaller-00272-g0c0d417747d8 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x14a/0x1ce lib/dump_stack.c:118
 print_address_description+0x93/0x620 mm/kasan/report.c:374
 __kasan_report+0x16d/0x1e0 mm/kasan/report.c:506
 kasan_report+0x36/0x60 mm/kasan/common.c:634
 hlist_move_list include/linux/list.h:843 [inline]
 __collect_expired_timers kernel/time/timer.c:1470 [inline]
 collect_expired_timers kernel/time/timer.c:1705 [inline]
 __run_timers+0x55e/0x7b0 kernel/time/timer.c:1769
 run_timer_softirq+0x19/0x30 kernel/time/timer.c:1786
 __do_softirq+0x2d5/0x725 kernel/softirq.c:292
 invoke_softirq kernel/softirq.c:373 [inline]
 irq_exit+0x16d/0x180 kernel/softirq.c:413
 exiting_irq arch/x86/include/asm/apic.h:546 [inline]
 smp_apic_timer_interrupt+0x281/0x3f0 arch/x86/kernel/apic/apic.c:1146
 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:831
 </IRQ>
RIP: 0010:get_current arch/x86/include/asm/current.h:15 [inline]
RIP: 0010:__sanitizer_cov_trace_pc+0x4/0x50 kernel/kcov.c:186
Code: 00 0f 0b 0f 1f 00 53 48 89 fb e8 17 00 00 00 48 8b 3d 18 12 97 03 48 89 de 5b e9 57 81 2d 00 90 90 90 90 90 90 90 48 8b 04 24 <65> 48 8b 0c 25 00 ed 01 00 65 8b 15 88 ed bf 7e f7 c2 00 01 1f 00
RSP: 0018:ffff8881ccde79b8 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13
RAX: ffffffff8167f0b9 RBX: 0000000000000000 RCX: ffff8881c8815d00
RDX: ffff8881c8815d00 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffff8881ccde7b50 R08: ffffffff8167f0aa R09: fffff94000edcfa1
R10: fffff94000edcfa1 R11: 0000000000000000 R12: 1ffffd4000edcfa1
R13: ffffea00076e7d00 R14: ffffea00076e7d08 R15: dffffc0000000000
 mm_counter_file include/linux/mm.h:1703 [inline]
 mm_counter include/linux/mm.h:1705 [inline]
 zap_pte_range mm/memory.c:1080 [inline]
 zap_pmd_range mm/memory.c:1185 [inline]
 zap_pud_range mm/memory.c:1214 [inline]
 zap_p4d_range mm/memory.c:1235 [inline]
 unmap_page_range+0xbe9/0x16e0 mm/memory.c:1256
 unmap_single_vma mm/memory.c:1301 [inline]
 unmap_vmas+0x1b5/0x230 mm/memory.c:1333
 exit_mmap+0x28a/0x500 mm/mmap.c:3160
 __mmput+0x34/0x240 kernel/fork.c:1090
 exit_mm kernel/exit.c:485 [inline]
 do_exit+0xa6c/0x2700 kernel/exit.c:795
 do_group_exit+0x155/0x2b0 kernel/exit.c:906
 __do_sys_exit_group+0x13/0x20 kernel/exit.c:917
 __se_sys_exit_group+0x10/0x10 kernel/exit.c:915
 __x64_sys_exit_group+0x37/0x40 kernel/exit.c:915
 do_syscall_64+0xcb/0x150 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x7f4bfb228618
Code: 00 00 be 3c 00 00 00 eb 19 66 0f 1f 84 00 00 00 00 00 48 89 d7 89 f0 0f 05 48 3d 00 f0 ff ff 77 21 f4 48 89 d7 44 89 c0 0f 05 <48> 3d 00 f0 ff ff 76 e0 f7 d8 64 41 89 01 eb d8 0f 1f 84 00 00 00
RSP: 002b:00007ffe9c62c438 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 00007ffe9c62c500 RCX: 00007f4bfb228618
RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000
RBP: 00007ffe9c62c5b0 R08: 00000000000000e7 R09: fffffffffffffe50
R10: 00000000ffffffff R11: 0000000000000206 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000003 R15: 000000000000000e

The buggy address belongs to the page:
page:ffffea000712cbc0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0x8000000000000000()
raw: 8000000000000000 0000000000000000 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8881c4b2f080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8881c4b2f100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8881c4b2f180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                      ^
 ffff8881c4b2f200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8881c4b2f280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 6641 Comm: systemd-udevd Tainted: G    B             5.4.52-syzkaller-00272-g0c0d417747d8 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:__hlist_del include/linux/list.h:764 [inline]
RIP: 0010:detach_timer kernel/time/timer.c:815 [inline]
RIP: 0010:expire_timers+0x284/0x470 kernel/time/timer.c:1438
Code: 89 e7 e8 df 31 3d 00 4d 89 3c 24 4d 85 ff 74 36 e8 41 02 0f 00 49 83 c7 08 4c 89 f8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <80> 3c 08 00 74 08 4c 89 ff e8 ae 31 3d 00 4d 89 27 eb 0e 66 0f 1f
RSP: 0018:ffff8881db809c50 EFLAGS: 00010802
RAX: 1bd5a00000000025 RBX: ffff8881db823708 RCX: dffffc0000000000
RDX: 0000000080000102 RSI: 0000000000000008 RDI: ffff8881c4b2f188
RBP: 1ffff11038965e31 R08: ffffffff8132fb29 R09: fffffbfff0ac35e9
R10: fffffbfff0ac35e9 R11: 0000000000000000 R12: ffff8881db809d80
R13: ffff8881c4b2f180 R14: ffff8881c4b2f188 R15: dead00000000012a
FS:  0000000000000000(0000) GS:ffff8881db800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000564062555398 CR3: 00000001c8bff003 CR4: 00000000001606f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <IRQ>
 __run_timers+0x662/0x7b0 kernel/time/timer.c:1773
 run_timer_softirq+0x19/0x30 kernel/time/timer.c:1786
 __do_softirq+0x2d5/0x725 kernel/softirq.c:292
 invoke_softirq kernel/softirq.c:373 [inline]
 irq_exit+0x16d/0x180 kernel/softirq.c:413
 exiting_irq arch/x86/include/asm/apic.h:546 [inline]
 smp_apic_timer_interrupt+0x281/0x3f0 arch/x86/kernel/apic/apic.c:1146
 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:831
 </IRQ>
RIP: 0010:get_current arch/x86/include/asm/current.h:15 [inline]
RIP: 0010:__sanitizer_cov_trace_pc+0x4/0x50 kernel/kcov.c:186
Code: 00 0f 0b 0f 1f 00 53 48 89 fb e8 17 00 00 00 48 8b 3d 18 12 97 03 48 89 de 5b e9 57 81 2d 00 90 90 90 90 90 90 90 48 8b 04 24 <65> 48 8b 0c 25 00 ed 01 00 65 8b 15 88 ed bf 7e f7 c2 00 01 1f 00
RSP: 0018:ffff8881ccde79b8 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13
RAX: ffffffff8167f0b9 RBX: 0000000000000000 RCX: ffff8881c8815d00
RDX: ffff8881c8815d00 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffff8881ccde7b50 R08: ffffffff8167f0aa R09: fffff94000edcfa1
R10: fffff94000edcfa1 R11: 0000000000000000 R12: 1ffffd4000edcfa1
R13: ffffea00076e7d00 R14: ffffea00076e7d08 R15: dffffc0000000000
 mm_counter_file include/linux/mm.h:1703 [inline]
 mm_counter include/linux/mm.h:1705 [inline]
 zap_pte_range mm/memory.c:1080 [inline]
 zap_pmd_range mm/memory.c:1185 [inline]
 zap_pud_range mm/memory.c:1214 [inline]
 zap_p4d_range mm/memory.c:1235 [inline]
 unmap_page_range+0xbe9/0x16e0 mm/memory.c:1256
 unmap_single_vma mm/memory.c:1301 [inline]
 unmap_vmas+0x1b5/0x230 mm/memory.c:1333
 exit_mmap+0x28a/0x500 mm/mmap.c:3160
 __mmput+0x34/0x240 kernel/fork.c:1090
 exit_mm kernel/exit.c:485 [inline]
 do_exit+0xa6c/0x2700 kernel/exit.c:795
 do_group_exit+0x155/0x2b0 kernel/exit.c:906
 __do_sys_exit_group+0x13/0x20 kernel/exit.c:917
 __se_sys_exit_group+0x10/0x10 kernel/exit.c:915
 __x64_sys_exit_group+0x37/0x40 kernel/exit.c:915
 do_syscall_64+0xcb/0x150 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x7f4bfb228618
Code: 00 00 be 3c 00 00 00 eb 19 66 0f 1f 84 00 00 00 00 00 48 89 d7 89 f0 0f 05 48 3d 00 f0 ff ff 77 21 f4 48 89 d7 44 89 c0 0f 05 <48> 3d 00 f0 ff ff 76 e0 f7 d8 64 41 89 01 eb d8 0f 1f 84 00 00 00
RSP: 002b:00007ffe9c62c438 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 00007ffe9c62c500 RCX: 00007f4bfb228618
RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000
RBP: 00007ffe9c62c5b0 R08: 00000000000000e7 R09: fffffffffffffe50
R10: 00000000ffffffff R11: 0000000000000206 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000003 R15: 000000000000000e
Modules linked in:
---[ end trace ee8c0415b0019a73 ]---
RIP: 0010:__hlist_del include/linux/list.h:764 [inline]
RIP: 0010:detach_timer kernel/time/timer.c:815 [inline]
RIP: 0010:expire_timers+0x284/0x470 kernel/time/timer.c:1438
Code: 89 e7 e8 df 31 3d 00 4d 89 3c 24 4d 85 ff 74 36 e8 41 02 0f 00 49 83 c7 08 4c 89 f8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <80> 3c 08 00 74 08 4c 89 ff e8 ae 31 3d 00 4d 89 27 eb 0e 66 0f 1f
RSP: 0018:ffff8881db809c50 EFLAGS: 00010802
RAX: 1bd5a00000000025 RBX: ffff8881db823708 RCX: dffffc0000000000
RDX: 0000000080000102 RSI: 0000000000000008 RDI: ffff8881c4b2f188
RBP: 1ffff11038965e31 R08: ffffffff8132fb29 R09: fffffbfff0ac35e9
R10: fffffbfff0ac35e9 R11: 0000000000000000 R12: ffff8881db809d80
R13: ffff8881c4b2f180 R14: ffff8881c4b2f188 R15: dead00000000012a
FS:  0000000000000000(0000) GS:ffff8881db800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000564062555398 CR3: 00000001c8bff003 CR4: 00000000001606f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (126):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-android-5-4-kasan 2020/07/18 22:27 https://android.googlesource.com/kernel/common android-5.4 0c0d417747d8 9c812472 .config log report syz
ci2-android-5-4-perf-kasan 2022/11/29 15:58 android12-5.4 df2b5549c0ec ca9683b8 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/11/24 09:32 android12-5.4 c80a5b2e7f63 ff68ff8f .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-kasan 2022/11/20 14:03 android12-5.4 e9f865cb240f 5bb70014 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/11/10 05:09 android12-5.4 5a34019eb955 b2488a87 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/10/27 19:15 android12-5.4 035e4939365c 5c716ff6 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/10/27 04:37 android12-5.4 035e4939365c 86777b7f .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/10/25 21:15 android12-5.4 035e4939365c 45645420 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/10/22 15:07 android12-5.4 8c70a830a157 c0b80a55 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/10/21 12:47 android12-5.4 8c70a830a157 63e790dd .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/10/20 11:42 android12-5.4 ff63a5f5cdf6 b31320fc .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/10/15 22:14 android12-5.4 ff63a5f5cdf6 67cb024c .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/10/12 18:26 android12-5.4 35e910266d44 16a9c9e0 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/10/08 03:24 android12-5.4 cc4340dfc7b2 79a59635 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/10/07 07:14 android12-5.4 cc4340dfc7b2 80b58a42 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/10/03 07:01 android12-5.4 3ee2a37108c8 feb56351 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/09/30 07:10 android12-5.4 3ee2a37108c8 45fd7169 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/09/29 11:57 android12-5.4 871bb50ab5b1 a41a2080 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-kasan 2022/09/29 04:46 android12-5.4 871bb50ab5b1 a41a2080 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/09/24 07:04 android12-5.4 def19b1cf16c 0042f2b4 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/09/18 05:49 android12-5.4 f3665979a8e7 dd9a85ff .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/09/18 01:11 android12-5.4 f3665979a8e7 dd9a85ff .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/09/14 12:28 android12-5.4 704c7d053806 b884348d .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/09/14 10:43 android12-5.4 704c7d053806 b884348d .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/09/07 20:20 android12-5.4 704c7d053806 c5b7bc57 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/09/04 20:52 android12-5.4 f0306959ab7c 28811d0a .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/09/04 02:37 android12-5.4 f0306959ab7c 28811d0a .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/09/03 19:51 android12-5.4 f0306959ab7c 28811d0a .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/08/31 21:52 android12-5.4 f0306959ab7c 51e54e30 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/08/30 16:42 android12-5.4 f0306959ab7c 4a380809 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/08/28 09:09 android12-5.4 f0306959ab7c 07177916 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/08/23 08:29 android12-5.4 f3c75e616e3f 26a13b38 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/08/22 07:29 android12-5.4 f3c75e616e3f 26a13b38 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/08/21 17:19 android12-5.4 f3c75e616e3f 26a13b38 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/08/20 22:32 android12-5.4 f3c75e616e3f 26a13b38 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/08/18 00:58 android12-5.4 2bf0b614f0fb a9409d47 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/08/16 15:17 android12-5.4 2bf0b614f0fb 7a7cb304 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/08/16 09:52 android12-5.4 2bf0b614f0fb 7a7cb304 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/08/14 00:59 android12-5.4 2bf0b614f0fb 8dfcaa3d .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/08/08 13:29 android12-5.4 19a66b6f3cd8 88e3a122 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/08/01 17:03 android12-5.4 2bde2e268ec7 fef302b1 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/07/30 10:35 android12-5.4 2bde2e268ec7 fef302b1 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/07/29 23:21 android12-5.4 2bde2e268ec7 fef302b1 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/07/28 02:15 android12-5.4 8368124477c8 fb95c74d .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/07/27 05:13 android12-5.4 397b3ca493cb ae971e66 .config log report info KASAN: use-after-free Write in __run_timers
ci2-android-5-4-perf-kasan 2022/10/27 11:43 android12-5.4 035e4939365c 86777b7f .config log report info KASAN: slab-out-of-bounds Write in __run_timers
ci2-android-5-4-perf-kasan 2022/10/08 22:44 android12-5.4 cc4340dfc7b2 aea5da89 .config log report info KASAN: slab-out-of-bounds Write in __run_timers
ci2-android-5-4-perf-kasan 2022/09/02 11:50 android12-5.4 f0306959ab7c a805568e .config log report info KASAN: slab-out-of-bounds Write in __run_timers
ci2-android-5-4-perf-kasan 2022/08/05 11:12 android12-5.4 19a66b6f3cd8 a65a7ce9 .config log report info KASAN: slab-out-of-bounds Write in __run_timers
ci2-android-5-4-perf-kasan 2022/08/01 20:05 android12-5.4 2bde2e268ec7 fef302b1 .config log report info KASAN: slab-out-of-bounds Write in __run_timers
ci2-android-5-4-kasan 2021/01/04 06:32 android12-5.4 e627b02af655 79264ae3 .config log report info
ci2-android-5-4-kasan 2020/07/11 21:22 https://android.googlesource.com/kernel/common android-5.4 9de16c6eb7c3 7ba05d2d .config log report
* Struck through repros no longer work on HEAD.