KASAN: use-after-free Read in dev_queue_xmit_nit

12 views
Skip to first unread message

syzbot

unread,
Jun 22, 2019, 7:17:06 PM6/22/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: a5758c53 Linux 4.14.129
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=157036b2a00000
kernel config: https://syzkaller.appspot.com/x/.config?x=9116f86b1594833c
dashboard link: https://syzkaller.appspot.com/bug?extid=0c52cd816b9faf3571e4
compiler: gcc (GCC) 9.0.0 20181231 (experimental)

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

IPVS: sync thread started: state = BACKUP, mcast_ifn = gre0, syncid = 1, id
= 0
protocol 88fb is buggy, dev hsr_slave_0
protocol 88fb is buggy, dev hsr_slave_1
protocol 88fb is buggy, dev hsr_slave_0
==================================================================
BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:186
[inline]
BUG: KASAN: use-after-free in dev_queue_xmit_nit+0x74b/0x8c0
net/core/dev.c:1929
Read of size 8 at addr ffff888061264e68 by task kworker/u4:2/29

CPU: 0 PID: 29 Comm: kworker/u4:2 Not tainted 4.14.129 #23
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Workqueue: bat_events batadv_nc_worker
Call Trace:
<IRQ>
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x138/0x19c lib/dump_stack.c:53
print_address_description.cold+0x7c/0x1dc mm/kasan/report.c:252
kasan_report_error mm/kasan/report.c:351 [inline]
kasan_report mm/kasan/report.c:409 [inline]
kasan_report.cold+0xa9/0x2af mm/kasan/report.c:393
__asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430
__read_once_size include/linux/compiler.h:186 [inline]
dev_queue_xmit_nit+0x74b/0x8c0 net/core/dev.c:1929
xmit_one net/core/dev.c:3005 [inline]
dev_hard_start_xmit+0xa7/0x8b0 net/core/dev.c:3025
__dev_queue_xmit+0x1d95/0x25e0 net/core/dev.c:3525
dev_queue_xmit+0x18/0x20 net/core/dev.c:3558
hsr_xmit net/hsr/hsr_forward.c:237 [inline]
hsr_forward_do net/hsr/hsr_forward.c:295 [inline]
hsr_forward_skb+0xbbe/0x1940 net/hsr/hsr_forward.c:373
send_hsr_supervision_frame+0x892/0xec0 net/hsr/hsr_device.c:319
hsr_announce+0xf5/0x340 net/hsr/hsr_device.c:348
call_timer_fn+0x161/0x670 kernel/time/timer.c:1279
expire_timers kernel/time/timer.c:1318 [inline]
__run_timers kernel/time/timer.c:1634 [inline]
__run_timers kernel/time/timer.c:1602 [inline]
run_timer_softirq+0x5b4/0x1570 kernel/time/timer.c:1647
__do_softirq+0x244/0x9a0 kernel/softirq.c:288
invoke_softirq kernel/softirq.c:368 [inline]
irq_exit+0x160/0x1b0 kernel/softirq.c:409
exiting_irq arch/x86/include/asm/apic.h:648 [inline]
smp_apic_timer_interrupt+0x146/0x5e0 arch/x86/kernel/apic/apic.c:1064
apic_timer_interrupt+0x8e/0xa0 arch/x86/entry/entry_64.S:789
</IRQ>
RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:778
[inline]
RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160
[inline]
RIP: 0010:_raw_spin_unlock_irqrestore+0x95/0xe0
kernel/locking/spinlock.c:192
RSP: 0018:ffff8880a9ef7b80 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff10
RAX: 1ffffffff0ee29f1 RBX: 0000000000000286 RCX: 1ffff110153dc121
RDX: dffffc0000000000 RSI: ffff8880a9ee0910 RDI: 0000000000000286
RBP: ffff8880a9ef7b90 R08: ffff8880a9ee0040 R09: ffff8880a9ee0908
R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff87792760
R13: 0000000000000286 R14: ffffffff877927a8 R15: ffffffff87791628
swake_up+0x4d/0x60 kernel/sched/swait.c:39
rcu_gp_kthread_wake+0x8d/0xd0 kernel/rcu/tree.c:1812
rcu_report_qs_rsp+0x12c/0x1a0 kernel/rcu/tree.c:2390
rcu_report_unblock_qs_rnp.constprop.0+0x19e/0x1e0 kernel/rcu/tree.c:2488
rcu_read_unlock_special+0x895/0xd40 kernel/rcu/tree_plugin.h:526
__rcu_read_unlock+0x161/0x170 kernel/rcu/update.c:260
rcu_read_unlock include/linux/rcupdate.h:684 [inline]
batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:420 [inline]
batadv_nc_worker+0x1bb/0x6d0 net/batman-adv/network-coding.c:726
process_one_work+0x863/0x1600 kernel/workqueue.c:2114
worker_thread+0x5d9/0x1050 kernel/workqueue.c:2248
kthread+0x319/0x430 kernel/kthread.c:232
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

Allocated by task 19953:
save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
save_stack+0x45/0xd0 mm/kasan/kasan.c:447
set_track mm/kasan/kasan.c:459 [inline]
kasan_kmalloc mm/kasan/kasan.c:551 [inline]
kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:529
kmem_cache_alloc_trace+0x152/0x790 mm/slab.c:3618
kmalloc include/linux/slab.h:488 [inline]
kzalloc include/linux/slab.h:661 [inline]
fanout_add net/packet/af_packet.c:1735 [inline]
packet_setsockopt+0x1c07/0x2830 net/packet/af_packet.c:3849
SYSC_setsockopt net/socket.c:1865 [inline]
SyS_setsockopt+0x13c/0x210 net/socket.c:1844
do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 19951:
save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
save_stack+0x45/0xd0 mm/kasan/kasan.c:447
set_track mm/kasan/kasan.c:459 [inline]
kasan_slab_free+0x75/0xc0 mm/kasan/kasan.c:524
__cache_free mm/slab.c:3496 [inline]
kfree+0xcc/0x270 mm/slab.c:3815
packet_release+0x776/0xb50 net/packet/af_packet.c:3059
__sock_release+0xce/0x2b0 net/socket.c:602
sock_close+0x1b/0x30 net/socket.c:1139
__fput+0x275/0x7a0 fs/file_table.c:210
____fput+0x16/0x20 fs/file_table.c:244
task_work_run+0x114/0x190 kernel/task_work.c:113
tracehook_notify_resume include/linux/tracehook.h:191 [inline]
exit_to_usermode_loop+0x1da/0x220 arch/x86/entry/common.c:164
prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline]
syscall_return_slowpath arch/x86/entry/common.c:270 [inline]
do_syscall_64+0x4bc/0x640 arch/x86/entry/common.c:297
entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff8880612645c0
which belongs to the cache kmalloc-4096 of size 4096
The buggy address is located 2216 bytes inside of
4096-byte region [ffff8880612645c0, ffff8880612655c0)
The buggy address belongs to the page:
page:ffffea0001849900 count:1 mapcount:0 mapping:ffff8880612645c0 index:0x0
compound_mapcount: 0
flags: 0x1fffc0000008100(slab|head)
raw: 01fffc0000008100 ffff8880612645c0 0000000000000000 0000000100000001
raw: ffffea00024b2e20 ffffea00018c2e20 ffff8880aa800dc0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff888061264d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888061264d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
> ffff888061264e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888061264e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888061264f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
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#status for how to communicate with syzbot.

syzbot

unread,
Feb 8, 2020, 2:01:06 AM2/8/20
to syzkaller...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages