syzbot


KASAN: stack-out-of-bounds Read in switch_mm_irqs_off

Status: closed as dup on 2018/07/05 16:21
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+6cea61a6cd1e9ae6b195@syzkaller.appspotmail.com
First crash: 2116d, last: 2098d
Duplicate of
Title Repro Cause bisect Fix bisect Count Last Reported
KASAN: stack-out-of-bounds Read in timerqueue_add kernel C 4 2099d 2115d
Discussions (1)
Title Replies (including bot) Last reply
KASAN: stack-out-of-bounds Read in switch_mm_irqs_off 1 (2) 2018/07/05 16:21

Sample crash report:
EXT4-fs (sda1): Unrecognized mount option "ÿ" or missing value
==================================================================
BUG: KASAN: stack-out-of-bounds in switch_mm_irqs_off+0x13db/0x16c0 arch/x86/mm/tlb.c:275
Read of size 8 at addr ffff8801958099f0 by task syz-executor4/4475

CPU: 1 PID: 4475 Comm: syz-executor4 Not tainted 4.18.0-rc3+ #58
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113
 print_address_description+0x6c/0x20b mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:412
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433
 switch_mm_irqs_off+0x13db/0x16c0 arch/x86/mm/tlb.c:275
 context_switch kernel/sched/core.c:2850 [inline]
 __schedule+0x79c/0x1ed0 kernel/sched/core.c:3504
 preempt_schedule_common+0x22/0x60 kernel/sched/core.c:3628
 _cond_resched+0x1d/0x30 kernel/sched/core.c:4994
 copy_pte_range mm/memory.c:1109 [inline]
 copy_pmd_range mm/memory.c:1148 [inline]
 copy_pud_range mm/memory.c:1182 [inline]
 copy_p4d_range mm/memory.c:1204 [inline]
 copy_page_range+0x15b2/0x24d0 mm/memory.c:1266
 dup_mmap kernel/fork.c:520 [inline]
 dup_mm kernel/fork.c:1243 [inline]
 copy_mm kernel/fork.c:1297 [inline]
 copy_process.part.40+0x4e69/0x7220 kernel/fork.c:1803
 copy_process kernel/fork.c:1616 [inline]
 _do_fork+0x291/0x12a0 kernel/fork.c:2099
 __do_sys_clone kernel/fork.c:2206 [inline]
 __se_sys_clone kernel/fork.c:2200 [inline]
 __x64_sys_clone+0xbf/0x150 kernel/fork.c:2200
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x45416a
Code: f7 d8 64 89 04 25 d4 02 00 00 64 4c 8b 0c 25 10 00 00 00 31 d2 4d 8d 91 d0 02 00 00 31 f6 bf 11 00 20 01 b8 38 00 00 00 0f 05 <48> 3d 00 f0 ff ff 0f 87 f5 00 00 00 85 c0 41 89 c5 0f 85 fc 00 00 
RSP: 002b:00007ffe9ef40750 EFLAGS: 00000246 ORIG_RAX: 0000000000000038
RAX: ffffffffffffffda RBX: 00007ffe9ef40750 RCX: 000000000045416a
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011
RBP: 00007ffe9ef40790 R08: 0000000000000001 R09: 0000000001f5d940
R10: 0000000001f5dc10 R11: 0000000000000246 R12: 0000000000000001
R13: 0000000000000000 R14: 0000000000000000 R15: 00000000007034c0

Allocated by task 917528:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 kasan_kmalloc+0xc4/0xe0 mm/kasan/kasan.c:553
 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:490
 kmem_cache_alloc+0x12e/0x760 mm/slab.c:3554
 dup_mm kernel/fork.c:1234 [inline]
 copy_mm kernel/fork.c:1297 [inline]
 copy_process.part.40+0x235f/0x7220 kernel/fork.c:1803
 copy_process kernel/fork.c:1616 [inline]
 _do_fork+0x291/0x12a0 kernel/fork.c:2099
 __do_sys_clone kernel/fork.c:2206 [inline]
 __se_sys_clone kernel/fork.c:2200 [inline]
 __x64_sys_clone+0xbf/0x150 kernel/fork.c:2200
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 0:
(stack is not available)

The buggy address belongs to the object at ffff880195809640
 which belongs to the cache mm_struct(17:syz3) of size 1496
The buggy address is located 944 bytes inside of
 1496-byte region [ffff880195809640, ffff880195809c18)
The buggy address belongs to the page:
page:ffffea0006560200 count:1 mapcount:0 mapping:ffff8801cae9fc80 index:0x0 compound_mapcount: 0
flags: 0x2fffc0000008100(slab|head)
raw: 02fffc0000008100 ffffea0006799f08 ffff8801d74c6248 ffff8801cae9fc80
raw: 0000000000000000 ffff8801958082c0 0000000100000004 ffff8801ae0ae900
page dumped because: kasan: bad access detected
page->mem_cgroup:ffff8801ae0ae900

Memory state around the buggy address:
 ffff880195809880: f2 f2 f2 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff880195809900: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 f2 f2 f2
>ffff880195809980: f2 f2 f2 f2 00 f2 f2 f2 f2 f2 f2 f2 00 f2 f2 f2
                                                             ^
 ffff880195809a00: f2 f2 f2 f2 f8 f2 f2 f2 f2 f2 f2 f2 00 f2 f2 f2
 ffff880195809a80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/07/21 20:56 bpf-next 8ae71e76cf1f 8cc079c3 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/13 01:19 bpf-next 6fd066604123 06c33b3a .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/04 09:50 bpf-next 2bdea157b999 317fc8ea .config console log report ci-upstream-bpf-next-kasan-gce
* Struck through repros no longer work on HEAD.