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

6 views
Skip to first unread message

syzbot

unread,
Jul 18, 2018, 12:29:03 AM7/18/18
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: dc989d2ce2c2 tools: bpftool: don't pass FEATURES_DUMP to l..
git tree: bpf-next
console output: https://syzkaller.appspot.com/x/log.txt?x=12aebf94400000
kernel config: https://syzkaller.appspot.com/x/.config?x=89129667b46496c3
dashboard link: https://syzkaller.appspot.com/bug?extid=57b32d12585583f370eb
compiler: gcc (GCC) 8.0.1 20180413 (experimental)
CC: [alexand...@verizon.com b...@suse.de
dave....@linux.intel.com h...@zytor.com linux-...@vger.kernel.org
mi...@redhat.com tg...@linutronix.de thomas....@amd.com x...@kernel.org]

Unfortunately, I don't have any reproducer for this crash yet.

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+57b32d...@syzkaller.appspotmail.com

syz-executor3[6745] is installing a program with bpf_probe_write_user
helper that may corrupt user memory!
protocol 0000 is buggy, dev sit0
==================================================================
kasan: CONFIG_KASAN_INLINE enabled
BUG: KASAN: stack-out-of-bounds in __purge_vmap_area_lazy+0x247/0x270
mm/vmalloc.c:666
kasan: GPF could be caused by NULL-ptr deref or user memory access
Read of size 8 at addr ffff8801ae5ed380 by task syz-executor4/6761
general protection fault: 0000 [#1] SMP KASAN

CPU: 1 PID: 6761 Comm: syz-executor4 Not tainted 4.18.0-rc3+ #57
CPU: 0 PID: 6732 Comm: syz-executor7 Not tainted 4.18.0-rc3+ #57
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
RIP: 0010:cpuacct_account_field+0x17b/0x3b0 kernel/sched/cpuacct.c:366
Call Trace:
Code:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113
0f
84 81
00 00
00
4c
print_address_description+0x6c/0x20b mm/kasan/report.c:256
63
ad
kasan_report_error mm/kasan/report.c:354 [inline]
kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:412
74
__asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433
ff
__purge_vmap_area_lazy+0x247/0x270 mm/vmalloc.c:666
ff
vm_unmap_aliases+0x4a1/0x610 mm/vmalloc.c:1108
ff
48
b8
00
00 00
change_page_attr_set_clr+0x82b/0x11d0 arch/x86/mm/pageattr.c:1473
00
00
fc ff
df
49
c1 e5
03
49
change_page_attr_clear arch/x86/mm/pageattr.c:1533 [inline]
set_memory_ro+0x7b/0xa0 arch/x86/mm/pageattr.c:1762
8d
bc 24
bpf_jit_binary_lock_ro include/linux/filter.h:690 [inline]
bpf_int_jit_compile+0xbba/0xe96 arch/x86/net/bpf_jit_comp.c:1168
38
01 00
00
48
89 fa
bpf_prog_select_runtime+0x46d/0x650 kernel/bpf/core.c:1487
48
c1
ea
bpf_prog_load+0x11b3/0x1c90 kernel/bpf/syscall.c:1356
03
<80>
3c
02
00
0f
85
af
01
__do_sys_bpf kernel/bpf/syscall.c:2305 [inline]
__se_sys_bpf kernel/bpf/syscall.c:2267 [inline]
__x64_sys_bpf+0x36c/0x510 kernel/bpf/syscall.c:2267
00
00
49
do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
8b
9c
24
38
01
00 00
65
48
entry_SYSCALL_64_after_hwframe+0x49/0xbe
03
RIP: 0033:0x455ab9
1d
Code:
1d
RSP: 0018:ffff8801dae078e8 EFLAGS: 00010006
ba
fb
RAX: dffffc0000000000 RBX: ffff8801dae00000 RCX: ffffffff815d8e34
ff
RDX: 0000000000000027 RSI: 0000000000000008 RDI: 0000000000000138
c3
RBP: ffff8801dae07978 R08: 0000000000000000 R09: 0000000000000001
66 2e
R10: ffff8801dae07950 R11: ffffffff88fa1263 R12: 0000000000000000
0f
R13: 0000000000000010 R14: 1ffff1003b5c0f1e R15: 00000000000f4240
1f 84
FS: 0000000001cf9940(0000) GS:ffff8801dae00000(0000) knlGS:0000000000000000
00
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
00
CR2: 0000000001e68e80 CR3: 00000001a8e98000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
00
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
00 00
Call Trace:
66
<IRQ>
90
48
89
f8
48
cgroup_account_cputime_field include/linux/cgroup.h:739 [inline]
task_group_account_field kernel/sched/cputime.c:108 [inline]
account_system_index_time+0x1dc/0x5c0 kernel/sched/cputime.c:171
89
f7
48
89
d6
48
89
account_system_time+0x7f/0xb0 kernel/sched/cputime.c:199
ca
account_process_tick+0x76/0x240 kernel/sched/cputime.c:498
4d
update_process_times+0x21/0x70 kernel/time/timer.c:1634
89
tick_sched_handle+0x9f/0x180 kernel/time/tick-sched.c:164
c2
tick_sched_timer+0x45/0x130 kernel/time/tick-sched.c:1274
4d
__run_hrtimer kernel/time/hrtimer.c:1398 [inline]
__hrtimer_run_queues+0x3eb/0x10c0 kernel/time/hrtimer.c:1460
89
c8
4c
8b
4c
24 08
0f
05
<48>
3d
hrtimer_interrupt+0x2f3/0x750 kernel/time/hrtimer.c:1518
01
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1025 [inline]
smp_apic_timer_interrupt+0x165/0x730 arch/x86/kernel/apic/apic.c:1050
f0
ff
ff
0f
83
eb
apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:863
b9
</IRQ>
fb ff
Modules linked in:
c3
66
Dumping ftrace buffer:
2e
(ftrace buffer empty)
0f
---[ end trace abd783641bce5f3b ]---
1f
RIP: 0010:cpuacct_account_field+0x17b/0x3b0 kernel/sched/cpuacct.c:366
84
Code:
00
0f
00
84
00
81
00
00
00
RSP: 002b:00007f617a17ac68 EFLAGS: 00000246
00
ORIG_RAX: 0000000000000141
4c 63
RAX: ffffffffffffffda RBX: 00007f617a17b6d4 RCX: 0000000000455ab9
ad 74
RDX: 0000000000000048 RSI: 000000002000e000 RDI: 0000000000000005
ff
RBP: 000000000072bea0 R08: 0000000000000000 R09: 0000000000000000
ff
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
ff
R13: 00000000004bb7f3 R14: 00000000004c8c08 R15: 0000000000000000
48 b8

00
Allocated by task 6544:
00
save_stack+0x43/0xd0 mm/kasan/kasan.c:448
00
set_track mm/kasan/kasan.c:460 [inline]
kasan_kmalloc+0xc4/0xe0 mm/kasan/kasan.c:553
00 00
kmem_cache_alloc_node_trace+0x150/0x770 mm/slab.c:3663
fc
kmalloc_node include/linux/slab.h:551 [inline]
alloc_vmap_area+0x14a/0xa70 mm/vmalloc.c:419
ff df
__get_vm_area_node+0x17e/0x390 mm/vmalloc.c:1396
49
__vmalloc_node_range+0xc4/0x760 mm/vmalloc.c:1741
c1
__vmalloc_node mm/vmalloc.c:1791 [inline]
__vmalloc+0x45/0x50 mm/vmalloc.c:1797
e5
bpf_prog_alloc+0xe3/0x3e0 kernel/bpf/core.c:85
03
bpf_prog_load+0x435/0x1c90 kernel/bpf/syscall.c:1306
49
__do_sys_bpf kernel/bpf/syscall.c:2305 [inline]
__se_sys_bpf kernel/bpf/syscall.c:2267 [inline]
__x64_sys_bpf+0x36c/0x510 kernel/bpf/syscall.c:2267
8d
do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe
bc

24
Freed by task 0:
38
(stack is not available)
01

00 00 48
The buggy address belongs to the object at ffff8801ae5ed380
which belongs to the cache kmalloc-96 of size 96
89
The buggy address is located 0 bytes inside of
96-byte region [ffff8801ae5ed380, ffff8801ae5ed3e0)
fa
The buggy address belongs to the page:
48
page:ffffea0006b97b40 count:1 mapcount:0 mapping:ffff8801da8004c0 index:0x0
c1
ea
flags: 0x2fffc0000000100(slab)
03
raw: 02fffc0000000100 ffffea000725ffc8 ffffea000750d088 ffff8801da8004c0
<80>
raw: 0000000000000000 ffff8801ae5ed000 0000000100000020 0000000000000000
3c
page dumped because: kasan: bad access detected
02

00
Memory state around the buggy address:
0f
ffff8801ae5ed280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
85
ffff8801ae5ed300: 00 f1 f1 f1 f1 00 f2 f2 f2 f2 f2 f2 f2 00 f2 f2
af
> ffff8801ae5ed380: f2 f2 f2 f2 f2 00 f2 f2 f2 f2 f2 f2 f2 f8 f2 f2
01 00
^
00 49
ffff8801ae5ed400: f2 f2 f2 f2 f2 00 f2 f2 f2 00 00 00 00 00 00 00
8b
ffff8801ae5ed480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1
9c 24
==================================================================
38
kasan: CONFIG_KASAN_INLINE enabled
01 00
kasan: GPF could be caused by NULL-ptr deref or user memory access
00
general protection fault: 0000 [#2] SMP KASAN
65
CPU: 1 PID: 6761 Comm: syz-executor4 Tainted: G B D
4.18.0-rc3+ #57
48
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
03
RIP: 0010:rq_clock_task kernel/sched/sched.h:976 [inline]
RIP: 0010:update_curr+0x130/0xc00 kernel/sched/fair.c:807
1d
Code: a3
RSP: 0018:ffff8801dae078e8 EFLAGS: 00010006
07
00
RAX: dffffc0000000000 RBX: ffff8801dae00000 RCX: ffffffff815d8e34
RDX: 0000000000000027 RSI: 0000000000000008 RDI: 0000000000000138
00
RBP: ffff8801dae07978 R08: 0000000000000000 R09: 0000000000000001
8b
R10: ffff8801dae07950 R11: ffffffff88fa1263 R12: 0000000000000000
R13: 0000000000000010 R14: 1ffff1003b5c0f1e R15: 00000000000f4240
0d a0
FS: 0000000001cf9940(0000) GS:ffff8801dae00000(0000) knlGS:0000000000000000
0d d2
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
07
CR2: 0000000001e68e80 CR3: 00000001a8e98000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
85
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
c9


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#bug-status-tracking for how to communicate with
syzbot.

Dmitry Vyukov

unread,
Dec 31, 2018, 2:01:03 AM12/31/18
to syzbot, 'Dmitry Vyukov' via syzkaller-upstream-moderation
#syz invalid

Happened once, does not look actionable. Looks like an old bpf-related
memory corruption.
> --
> You received this message because you are subscribed to the Google Groups "syzkaller-upstream-moderation" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-upstream-m...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller-upstream-moderation/0000000000009388bd05713e80ef%40google.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages