KASAN: slab-out-of-bounds Write in __internal_add_timer

7 views
Skip to first unread message

syzbot

unread,
Nov 1, 2017, 3:59:47 PM11/1/17
to syzkaller-upst...@googlegroups.com
Hello,

syzkaller hit the following crash on
58bcd35f859bdb69da2b20df042a2d3575c784fe
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/master
compiler: gcc (GCC) 7.1.1 20170620
.config is attached
Raw console output is attached.


CC: [john....@linaro.org linux-...@vger.kernel.org
sb...@codeaurora.org tg...@linutronix.de]

==================================================================
BUG: KASAN: slab-out-of-bounds in hlist_add_head include/linux/list.h:673
[inline]
BUG: KASAN: slab-out-of-bounds in enqueue_timer kernel/time/timer.c:520
[inline]
BUG: KASAN: slab-out-of-bounds in __internal_add_timer+0x275/0x2d0
kernel/time/timer.c:531
Write of size 8 at addr ffff880039eb3ac8 by task rs:main Q:Reg/2865

CPU: 1 PID: 2865 Comm: rs:main Q:Reg Not tainted 4.13.0-next-20170908+ #18
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
Call Trace:
<IRQ>
__dump_stack lib/dump_stack.c:16 [inline]
dump_stack+0x194/0x257 lib/dump_stack.c:52
print_address_description+0x73/0x250 mm/kasan/report.c:252
kasan_report_error mm/kasan/report.c:351 [inline]
kasan_report+0x24e/0x340 mm/kasan/report.c:409
__asan_report_store8_noabort+0x17/0x20 mm/kasan/report.c:435
hlist_add_head include/linux/list.h:673 [inline]
enqueue_timer kernel/time/timer.c:520 [inline]
__internal_add_timer+0x275/0x2d0 kernel/time/timer.c:531
internal_add_timer kernel/time/timer.c:573 [inline]
__mod_timer kernel/time/timer.c:1024 [inline]
mod_timer+0x622/0x15b0 kernel/time/timer.c:1071
rpm_suspend+0x126b/0x1610 drivers/base/power/runtime.c:533
pm_suspend_timer_fn+0x166/0x1d0 drivers/base/power/runtime.c:909
call_timer_fn+0x246/0x850 kernel/time/timer.c:1281
expire_timers kernel/time/timer.c:1320 [inline]
__run_timers+0x7fd/0xb90 kernel/time/timer.c:1620
run_timer_softirq+0x4c/0xb0 kernel/time/timer.c:1646
__do_softirq+0x2bb/0xbd0 kernel/softirq.c:284
invoke_softirq kernel/softirq.c:364 [inline]
irq_exit+0x1d3/0x210 kernel/softirq.c:405
exiting_irq arch/x86/include/asm/apic.h:638 [inline]
smp_apic_timer_interrupt+0x177/0x710 arch/x86/kernel/apic/apic.c:1048
TCP: request_sock_TCPv6: Possible SYN flooding on port 20001. Sending
cookies. Check SNMP counters.
apic_timer_interrupt+0x9d/0xb0 arch/x86/entry/entry_64.S:577
</IRQ>
RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:814
[inline]
RIP: 0010:kmem_cache_free+0x170/0x280 mm/slab.c:3764
RSP: 0018:ffff88003ab6f3f0 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff10
RAX: 0000000000000007 RBX: ffff880038c14100 RCX: 0000000000000006
RDX: 0000000000000000 RSI: 1ffff10007c71db3 RDI: 0000000000000282
RBP: ffff88003ab6f410 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffff88003c3d6a80
R13: 0000000000000282 R14: ffffffff81e43bb2 R15: ffff88003e38e480
jbd2_free_handle include/linux/jbd2.h:1321 [inline]
jbd2_journal_stop+0x482/0x1490 fs/jbd2/transaction.c:1781
__ext4_journal_stop+0x12c/0x1c0 fs/ext4/ext4_jbd2.c:102
ext4_dirty_inode+0x85/0xa0 fs/ext4/inode.c:5865
__mark_inode_dirty+0x912/0x1170 fs/fs-writeback.c:2096
generic_update_time+0x1b2/0x270 fs/inode.c:1649
update_time fs/inode.c:1665 [inline]
file_update_time+0x2a7/0x470 fs/inode.c:1876
__generic_file_write_iter+0x1ca/0x5b0 mm/filemap.c:3066
ext4_file_write_iter+0x5c2/0x10c0 fs/ext4/file.c:282
call_write_iter include/linux/fs.h:1771 [inline]
new_sync_write fs/read_write.c:468 [inline]
__vfs_write+0x68a/0x970 fs/read_write.c:481
vfs_write+0x18f/0x510 fs/read_write.c:543
SYSC_write fs/read_write.c:588 [inline]
SyS_write+0xef/0x220 fs/read_write.c:580
entry_SYSCALL_64_fastpath+0x1f/0xbe
RIP: 0033:0x7f110bec719d
RSP: 002b:00007f110a468000 EFLAGS: 00000293 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00000000000000f8 RCX: 00007f110bec719d
RDX: 00000000000000f8 RSI: 00000000025a0340 RDI: 0000000000000006
RBP: 0000000000000082 R08: 0a796c7265706f72 R09: 6f6320676e697474
R10: 0000000000000000 R11: 0000000000000293 R12: 00000000025bdc70
R13: 00000000025bdc50 R14: 0000000002596a40 R15: 00000000025c0630

Allocated by task 3977:
save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
save_stack+0x43/0xd0 mm/kasan/kasan.c:447
set_track mm/kasan/kasan.c:459 [inline]
kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551
__do_kmalloc mm/slab.c:3725 [inline]
__kmalloc+0x162/0x760 mm/slab.c:3734
kmalloc_array include/linux/slab.h:612 [inline]
kcalloc include/linux/slab.h:623 [inline]
__rds_conn_create+0x4cc/0x1870 net/rds/connection.c:176
rds_conn_create_outgoing+0x3f/0x50 net/rds/connection.c:303
rds_sendmsg+0xd6c/0x1f90 net/rds/send.c:1108
sock_sendmsg_nosec net/socket.c:633 [inline]
sock_sendmsg+0xca/0x110 net/socket.c:643
SYSC_sendto+0x358/0x5a0 net/socket.c:1750
SyS_sendto+0x40/0x50 net/socket.c:1718
entry_SYSCALL_64_fastpath+0x1f/0xbe

Freed by task 3640:
save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
save_stack+0x43/0xd0 mm/kasan/kasan.c:447
sg_write: data in/out 327773/154 bytes for SCSI command 0x54-- guessing
data in;
program syz-executor3 not setting count and/or reply_len properly
set_track mm/kasan/kasan.c:459 [inline]
kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524
__cache_free mm/slab.c:3503 [inline]
kfree+0xca/0x250 mm/slab.c:3820
kvfree+0x36/0x60 mm/util.c:416
netdev_freemem net/core/dev.c:7963 [inline]
free_netdev+0x2cf/0x360 net/core/dev.c:8125
tun_set_iff drivers/net/tun.c:2105 [inline]
__tun_chr_ioctl+0x2cf6/0x3d20 drivers/net/tun.c:2276
tun_chr_ioctl+0x2a/0x40 drivers/net/tun.c:2521
vfs_ioctl fs/ioctl.c:45 [inline]
do_vfs_ioctl+0x1b1/0x1530 fs/ioctl.c:685
SYSC_ioctl fs/ioctl.c:700 [inline]
SyS_ioctl+0x8f/0xc0 fs/ioctl.c:691
entry_SYSCALL_64_fastpath+0x1f/0xbe

The buggy address belongs to the object at ffff880039eb06c0
which belongs to the cache kmalloc-16384 of size 16384
The buggy address is located 13320 bytes inside of
16384-byte region [ffff880039eb06c0, ffff880039eb46c0)
The buggy address belongs to the page:
page:ffffea0000e7ac00 count:1 mapcount:0 mapping:ffff880039eb06c0 index:0x0
compound_mapcount: 0
flags: 0x100000000008100(slab|head)
raw: 0100000000008100 ffff880039eb06c0 0000000000000000 0000000100000001
raw: ffffea0000e24020 ffffea0000e0ae20 ffff88003e802200 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff880039eb3980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff880039eb3a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
> ffff880039eb3a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff880039eb3b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff880039eb3b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


---
This bug is generated by a dumb bot. It may contain errors.
See https://goo.gl/tpsmEJ for details.
Direct all questions to syzk...@googlegroups.com.
Please credit me with: Reported-by: syzbot <syzk...@googlegroups.com>

syzbot will keep track of this bug report.
Once a fix for this bug is committed, please reply to this email with:
#syz fix: exact-commit-title
To mark this as a duplicate of another syzbot report, please reply with:
#syz dup: exact-subject-of-another-report
If it's a one-off invalid bug report, please reply with:
#syz invalid
Note: if the crash happens again, it will cause creation of a new bug
report.
Note: all commands must start from beginning of the line.
To upstream this report, please reply with:
#syz upstream
config.txt
raw.log

Dmitry Vyukov

unread,
Nov 5, 2017, 3:51:05 AM11/5/17
to syzbot, 'Dmitry Vyukov' via syzkaller-upstream-moderation
Stopped happening in September and there were some fixes to tun timers

#syz invalid

On Wed, Nov 1, 2017 at 10:59 PM, syzbot
<bot+3bf528ba61d06d90b9...@syzkaller.appspotmail.com>
wrote:
> --
> 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 post to this group, send email to
> syzkaller-upst...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/syzkaller-upstream-moderation/001a1142e23817b5c6055cf15032%40google.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages