All of lore.kernel.org
 help / color / mirror / Atom feed
* KASAN: use-after-free Read in tick_sched_handle (3)
@ 2018-11-19 21:39 syzbot
  2018-11-20  4:10 ` Frederic Weisbecker
  2019-11-07 13:42 ` syzbot
  0 siblings, 2 replies; 5+ messages in thread
From: syzbot @ 2018-11-19 21:39 UTC (permalink / raw)
  To: fweisbec, linux-kernel, mingo, syzkaller-bugs, tglx

Hello,

syzbot found the following crash on:

HEAD commit:    bae4e109837b mlxsw: spectrum: Expose discard counters via ..
git tree:       net-next
console output: https://syzkaller.appspot.com/x/log.txt?x=11b5e77b400000
kernel config:  https://syzkaller.appspot.com/x/.config?x=d86f24333880b605
dashboard link: https://syzkaller.appspot.com/bug?extid=999bca54de2ee169c021
compiler:       gcc (GCC) 8.0.1 20180413 (experimental)
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=14b7d093400000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1487a225400000

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

IPv6: ADDRCONF(NETDEV_CHANGE): veth1: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): veth0: link becomes ready
8021q: adding VLAN 0 to HW filter on device team0
==================================================================
kasan: CONFIG_KASAN_INLINE enabled
BUG: KASAN: use-after-free in tick_sched_handle+0x16c/0x180  
kernel/time/tick-sched.c:164
Read of size 8 at addr ffff8881c0895a30 by task syz-executor949/6058
kasan: GPF could be caused by NULL-ptr deref or user memory access

CPU: 0 PID: 6058 Comm: syz-executor949 Not tainted 4.20.0-rc2+ #303
general protection fault: 0000 [#1] PREEMPT SMP KASAN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
CPU: 1 PID: 2938 Comm: kworker/1:2 Not tainted 4.20.0-rc2+ #303
Call Trace:
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
  <IRQ>
Workqueue: ipv6_addrconf addrconf_dad_work
  __dump_stack lib/dump_stack.c:77 [inline]
  dump_stack+0x244/0x39d lib/dump_stack.c:113
RIP: 0010:sk_fullsock include/net/sock.h:2402 [inline]
RIP: 0010:skb_set_owner_w+0xb4/0x320 net/core/sock.c:1842
Code: ff df 48 c1 ea 03 80 3c 02 00 0f 85 30 02 00 00 49 8d 7c 24 12 4c 89  
63 18 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 04 02 48  
89 fa 83 e2 07 38 d0 7f 08 84 c0 0f 85 cd 01 00 00
RSP: 0018:ffff8881cb9274a8 EFLAGS: 00010203
RAX: dffffc0000000000 RBX: ffff8881c2cf4bc0 RCX: ffffffff86273988
  print_address_description.cold.7+0x9/0x1ff mm/kasan/report.c:256
RDX: 000000000000000e RSI: ffffffff8625bddf RDI: 0000000000000074
  kasan_report_error mm/kasan/report.c:354 [inline]
  kasan_report.cold.8+0x242/0x309 mm/kasan/report.c:412
RBP: ffff8881cb9274d0 R08: ffff8881cb98e280 R09: ffffed103701800c
R10: ffffed103701800c R11: ffff8881b80c0063 R12: 0000000000000062
  __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433
R13: ffff8881c2cf4bd8 R14: ffff8881c2cf4c20 R15: 0000000000000020
  tick_sched_handle+0x16c/0x180 kernel/time/tick-sched.c:164
FS:  0000000000000000(0000) GS:ffff8881daf00000(0000) knlGS:0000000000000000
  tick_sched_timer+0x45/0x130 kernel/time/tick-sched.c:1274
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  __run_hrtimer kernel/time/hrtimer.c:1398 [inline]
  __hrtimer_run_queues+0x41c/0x10d0 kernel/time/hrtimer.c:1460
CR2: 00007fff57a32ff8 CR3: 00000001cb905000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
  ndisc_alloc_skb+0x284/0x340 net/ipv6/ndisc.c:419
  ndisc_send_ns+0x194/0x8e0 net/ipv6/ndisc.c:609
  hrtimer_interrupt+0x313/0x780 kernel/time/hrtimer.c:1518
  local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1034 [inline]
  smp_apic_timer_interrupt+0x1a1/0x760 arch/x86/kernel/apic/apic.c:1059
  addrconf_dad_work+0xbf2/0x1310 net/ipv6/addrconf.c:4077
  process_one_work+0xc90/0x1c40 kernel/workqueue.c:2153
  apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:804
  </IRQ>

Allocated by task 3230256160:
  worker_thread+0x17f/0x1390 kernel/workqueue.c:2296
  kthread+0x35a/0x440 kernel/kthread.c:246
  ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352
Modules linked in:
BUG: unable to handle kernel paging request at ffffffff8caa3e08
---[ end trace 6c1017c956f17b9c ]---
PGD 946d067 P4D 946d067 PUD 946e063 PMD 0
Thread overran stack, or stack corrupted
Oops: 0000 [#2] PREEMPT SMP KASAN
RIP: 0010:sk_fullsock include/net/sock.h:2402 [inline]
RIP: 0010:skb_set_owner_w+0xb4/0x320 net/core/sock.c:1842
CPU: 0 PID: 6058 Comm: syz-executor949 Tainted: G      D            
4.20.0-rc2+ #303
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:depot_fetch_stack+0x10/0x30 lib/stackdepot.c:201
Code: 89 e8 44 96 1c fe e9 87 fd ff ff e8 8a b0 a2 fd 90 90 90 90 90 90 90  
90 90 90 89 f8 c1 ef 11 25 ff ff 1f 00 81 e7 f0 3f 00 00 <48> 03 3c c5 00  
fa ad 8b 8b 47 0c 48 83 c7 18 c7 46 10 00 00 00 00
Code: ff df 48 c1 ea 03 80 3c 02 00 0f 85 30 02 00 00 49 8d 7c 24 12 4c 89  
63 18 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 04 02 48  
89 fa 83 e2 07 38 d0 7f 08 84 c0 0f 85 cd 01 00 00
RSP: 0018:ffff8881dae07a38 EFLAGS: 00010006
RAX: 00000000001f8881 RBX: ffff8881c089cb84 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffff8881dae07a40 RDI: 0000000000003ff0
RBP: ffff8881dae07a68 R08: ffff8881c1da0080 R09: ffffed103b5c3ef8
R10: ffffed103b5c3ef8 R11: ffff8881dae1f7c7 R12: ffffea0007022400
RSP: 0018:ffff8881cb9274a8 EFLAGS: 00010203
R13: ffff8881c0894b80 R14: ffff8881da802380 R15: ffff8881c089cb80
FS:  000000000137f880(0000) GS:ffff8881dae00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffff8caa3e08 CR3: 00000001c3bee000 CR4: 00000000001406f0
RAX: dffffc0000000000 RBX: ffff8881c2cf4bc0 RCX: ffffffff86273988
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
RDX: 000000000000000e RSI: ffffffff8625bddf RDI: 0000000000000074
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
  <IRQ>
  describe_object mm/kasan/report.c:243 [inline]
  print_address_description.cold.7+0x15b/0x1ff mm/kasan/report.c:263
RBP: ffff8881cb9274d0 R08: ffff8881cb98e280 R09: ffffed103701800c
  kasan_report_error mm/kasan/report.c:354 [inline]
  kasan_report.cold.8+0x242/0x309 mm/kasan/report.c:412
R10: ffffed103701800c R11: ffff8881b80c0063 R12: 0000000000000062
  __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433
  tick_sched_handle+0x16c/0x180 kernel/time/tick-sched.c:164
R13: ffff8881c2cf4bd8 R14: ffff8881c2cf4c20 R15: 0000000000000020
  tick_sched_timer+0x45/0x130 kernel/time/tick-sched.c:1274
FS:  0000000000000000(0000) GS:ffff8881daf00000(0000) knlGS:0000000000000000
  __run_hrtimer kernel/time/hrtimer.c:1398 [inline]
  __hrtimer_run_queues+0x41c/0x10d0 kernel/time/hrtimer.c:1460
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600400 CR3: 00000001cb905000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


---
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 syzkaller@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#bug-status-tracking for how to communicate with  
syzbot.
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: KASAN: use-after-free Read in tick_sched_handle (3)
  2018-11-19 21:39 KASAN: use-after-free Read in tick_sched_handle (3) syzbot
@ 2018-11-20  4:10 ` Frederic Weisbecker
  2018-11-20  4:42   ` Dmitry Vyukov
  2019-11-07 13:42 ` syzbot
  1 sibling, 1 reply; 5+ messages in thread
From: Frederic Weisbecker @ 2018-11-20  4:10 UTC (permalink / raw)
  To: syzbot; +Cc: fweisbec, linux-kernel, mingo, syzkaller-bugs, tglx

On Mon, Nov 19, 2018 at 01:39:02PM -0800, syzbot wrote:
> Hello,
> 
> syzbot found the following crash on:
> 
> HEAD commit:    bae4e109837b mlxsw: spectrum: Expose discard counters via ..
> git tree:       net-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=11b5e77b400000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=d86f24333880b605
> dashboard link: https://syzkaller.appspot.com/bug?extid=999bca54de2ee169c021
> compiler:       gcc (GCC) 8.0.1 20180413 (experimental)
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=14b7d093400000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1487a225400000
> 
> IMPORTANT: if you fix the bug, please add the following tag to the commit:
> Reported-by: syzbot+999bca54de2ee169c021@syzkaller.appspotmail.com
> 
> IPv6: ADDRCONF(NETDEV_CHANGE): veth1: link becomes ready
> IPv6: ADDRCONF(NETDEV_CHANGE): veth0: link becomes ready
> 8021q: adding VLAN 0 to HW filter on device team0
> ==================================================================
> kasan: CONFIG_KASAN_INLINE enabled
> BUG: KASAN: use-after-free in tick_sched_handle+0x16c/0x180
> kernel/time/tick-sched.c:164

So tick_sched_timer() -> tick_sched_handle() is passed regs returned by
get_irq_regs() that seem to be junk.

Those regs should come from smp_apic_timer_interrupt().

Thoughts?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: KASAN: use-after-free Read in tick_sched_handle (3)
  2018-11-20  4:10 ` Frederic Weisbecker
@ 2018-11-20  4:42   ` Dmitry Vyukov
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Vyukov @ 2018-11-20  4:42 UTC (permalink / raw)
  To: Frederic Weisbecker
  Cc: syzbot, Frédéric Weisbecker, LKML, Ingo Molnar,
	syzkaller-bugs, Thomas Gleixner, netdev

On Mon, Nov 19, 2018 at 8:10 PM, Frederic Weisbecker
<frederic@kernel.org> wrote:
> On Mon, Nov 19, 2018 at 01:39:02PM -0800, syzbot wrote:
>> Hello,
>>
>> syzbot found the following crash on:
>>
>> HEAD commit:    bae4e109837b mlxsw: spectrum: Expose discard counters via ..
>> git tree:       net-next
>> console output: https://syzkaller.appspot.com/x/log.txt?x=11b5e77b400000
>> kernel config:  https://syzkaller.appspot.com/x/.config?x=d86f24333880b605
>> dashboard link: https://syzkaller.appspot.com/bug?extid=999bca54de2ee169c021
>> compiler:       gcc (GCC) 8.0.1 20180413 (experimental)
>> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=14b7d093400000
>> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1487a225400000
>>
>> IMPORTANT: if you fix the bug, please add the following tag to the commit:
>> Reported-by: syzbot+999bca54de2ee169c021@syzkaller.appspotmail.com
>>
>> IPv6: ADDRCONF(NETDEV_CHANGE): veth1: link becomes ready
>> IPv6: ADDRCONF(NETDEV_CHANGE): veth0: link becomes ready
>> 8021q: adding VLAN 0 to HW filter on device team0
>> ==================================================================
>> kasan: CONFIG_KASAN_INLINE enabled
>> BUG: KASAN: use-after-free in tick_sched_handle+0x16c/0x180
>> kernel/time/tick-sched.c:164
>
> So tick_sched_timer() -> tick_sched_handle() is passed regs returned by
> get_irq_regs() that seem to be junk.
>
> Those regs should come from smp_apic_timer_interrupt().
>
> Thoughts?


Looking at the reproducer it looks like some memory corruption in
networking stack. +netdev

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: KASAN: use-after-free Read in tick_sched_handle (3)
  2018-11-19 21:39 KASAN: use-after-free Read in tick_sched_handle (3) syzbot
  2018-11-20  4:10 ` Frederic Weisbecker
@ 2019-11-07 13:42 ` syzbot
  2019-11-08 12:51   ` Stefano Brivio
  1 sibling, 1 reply; 5+ messages in thread
From: syzbot @ 2019-11-07 13:42 UTC (permalink / raw)
  To: davem, dvyukov, frederic, fweisbec, kuznet, linux-kernel, mingo,
	netdev, sbrivio, syzkaller-bugs, tglx, yoshfuji

syzbot suspects this bug was fixed by commit:

commit bc6e019b6ee65ff4ebf3ca272f774cf6c67db669
Author: Stefano Brivio <sbrivio@redhat.com>
Date:   Thu Jan 3 20:43:34 2019 +0000

     fou: Prevent unbounded recursion in GUE error handler also with UDP-Lite

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=119c0bc2600000
start commit:   1c7fc5cb Linux 5.0-rc2
git tree:       upstream
kernel config:  https://syzkaller.appspot.com/x/.config?x=817708c0a0300f84
dashboard link: https://syzkaller.appspot.com/bug?extid=999bca54de2ee169c021
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=12c95a30c00000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=11df0107400000

If the result looks correct, please mark the bug fixed by replying with:

#syz fix: fou: Prevent unbounded recursion in GUE error handler also with  
UDP-Lite

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: KASAN: use-after-free Read in tick_sched_handle (3)
  2019-11-07 13:42 ` syzbot
@ 2019-11-08 12:51   ` Stefano Brivio
  0 siblings, 0 replies; 5+ messages in thread
From: Stefano Brivio @ 2019-11-08 12:51 UTC (permalink / raw)
  To: syzbot
  Cc: davem, dvyukov, frederic, fweisbec, kuznet, linux-kernel, mingo,
	netdev, syzkaller-bugs, tglx, yoshfuji

On Thu, 07 Nov 2019 05:42:07 -0800
syzbot <syzbot+999bca54de2ee169c021@syzkaller.appspotmail.com> wrote:

> syzbot suspects this bug was fixed by commit:
> 
> commit bc6e019b6ee65ff4ebf3ca272f774cf6c67db669
> Author: Stefano Brivio <sbrivio@redhat.com>
> Date:   Thu Jan 3 20:43:34 2019 +0000
> 
>      fou: Prevent unbounded recursion in GUE error handler also with UDP-Lite
> 
> bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=119c0bc2600000
> start commit:   1c7fc5cb Linux 5.0-rc2
> git tree:       upstream
> kernel config:  https://syzkaller.appspot.com/x/.config?x=817708c0a0300f84
> dashboard link: https://syzkaller.appspot.com/bug?extid=999bca54de2ee169c021
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=12c95a30c00000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=11df0107400000
> 
> If the result looks correct, please mark the bug fixed by replying with:
> 
> #syz fix: fou: Prevent unbounded recursion in GUE error handler also with  
> UDP-Lite
> 
> For information about bisection process see: https://goo.gl/tpsmEJ#bisection

#syz fix: fou: Prevent unbounded recursion in GUE error handler also with UDP-Lite


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-11-08 12:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-19 21:39 KASAN: use-after-free Read in tick_sched_handle (3) syzbot
2018-11-20  4:10 ` Frederic Weisbecker
2018-11-20  4:42   ` Dmitry Vyukov
2019-11-07 13:42 ` syzbot
2019-11-08 12:51   ` Stefano Brivio

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.