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

5 views
Skip to first unread message

syzbot

unread,
Jul 12, 2018, 10:59:04 PM7/12/18
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 671dffa7de7b Merge branch 'bpf-bpftool-improved-prog-load'
git tree: bpf-next
console output: https://syzkaller.appspot.com/x/log.txt?x=17500794400000
kernel config: https://syzkaller.appspot.com/x/.config?x=a501a01deaf0fe9
dashboard link: https://syzkaller.appspot.com/bug?extid=0f60a0cf3cedc327c080
compiler: gcc (GCC) 8.0.1 20180413 (experimental)
CC: [ak...@osdl.org jl...@engr.sgi.com
linux-...@vger.kernel.org mi...@kernel.org ol...@tv-sign.ru
tg...@linutronix.de]

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+0f60a0...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: stack-out-of-bounds in atomic64_read
include/asm-generic/atomic-instrumented.h:27 [inline]
BUG: KASAN: stack-out-of-bounds in atomic_long_read
include/asm-generic/atomic-long.h:47 [inline]
BUG: KASAN: stack-out-of-bounds in get_mm_counter include/linux/mm.h:1577
[inline]
BUG: KASAN: stack-out-of-bounds in get_mm_rss include/linux/mm.h:1622
[inline]
BUG: KASAN: stack-out-of-bounds in __acct_update_integrals+0x19f/0x510
kernel/tsacct.c:147
Read of size 8 at addr ffff88019e1531c0 by task syz-executor5/7318

CPU: 1 PID: 7318 Comm: syz-executor5 Not tainted 4.18.0-rc3+ #50
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+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
check_memory_region_inline mm/kasan/kasan.c:260 [inline]
check_memory_region+0x13e/0x1b0 mm/kasan/kasan.c:267
kasan_check_read+0x11/0x20 mm/kasan/kasan.c:272
atomic64_read include/asm-generic/atomic-instrumented.h:27 [inline]
atomic_long_read include/asm-generic/atomic-long.h:47 [inline]
get_mm_counter include/linux/mm.h:1577 [inline]
get_mm_rss include/linux/mm.h:1622 [inline]
__acct_update_integrals+0x19f/0x510 kernel/tsacct.c:147
acct_account_cputime+0x63/0x80 kernel/tsacct.c:172
account_system_index_time+0x32b/0x5c0 kernel/sched/cputime.c:174
account_system_time+0x7f/0xb0 kernel/sched/cputime.c:199
account_process_tick+0x76/0x240 kernel/sched/cputime.c:498
update_process_times+0x21/0x70 kernel/time/timer.c:1634
tick_sched_handle+0x9f/0x180 kernel/time/tick-sched.c:164
tick_sched_timer+0x45/0x130 kernel/time/tick-sched.c:1274
__run_hrtimer kernel/time/hrtimer.c:1398 [inline]
__hrtimer_run_queues+0x3eb/0x10c0 kernel/time/hrtimer.c:1460
hrtimer_interrupt+0x2f3/0x750 kernel/time/hrtimer.c:1518
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
apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:863
</IRQ>

Allocated by task 0:
(stack is not available)

Freed by task 1102416563:
(stack is not available)

The buggy address belongs to the object at ffff88019e152e40
which belongs to the cache mm_struct(129:syz5) of size 1496
The buggy address is located 896 bytes inside of
1496-byte region [ffff88019e152e40, ffff88019e153418)
The buggy address belongs to the page:
page:ffffea0006785480 count:1 mapcount:0 mapping:ffff8801c5bcfb40 index:0x0
compound_mapcount: 0
flags: 0x2fffc0000008100(slab|head)
raw: 02fffc0000008100 ffffea0006c51708 ffff8801c73f8248 ffff8801c5bcfb40
raw: 0000000000000000 ffff88019e152140 0000000100000004 ffff8801b8cc6280
page dumped because: kasan: bad access detected
page->mem_cgroup:ffff8801b8cc6280

Memory state around the buggy address:
ffff88019e153080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1
ffff88019e153100: f1 f1 00 f2 f2 f2 f2 f2 f2 f2 00 f2 f2 f2 f2 f2
> ffff88019e153180: f2 f2 00 f2 f2 f2 f2 f2 f2 f2 f8 f2 f2 f2 f2 f2
^
ffff88019e153200: f2 f2 00 f2 f2 f2 00 00 00 00 00 00 00 00 00 00
ffff88019e153280: 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00
==================================================================


---
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,
Jul 13, 2018, 4:02:58 AM7/13/18
to syzbot, 'Dmitry Vyukov' via syzkaller-upstream-moderation
#syz fix: bpf: sockhash, disallow bpf_tcp_close and update in parallel
> --
> 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/0000000000009899ed0570d8a9a6%40google.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages