All of lore.kernel.org
 help / color / mirror / Atom feed
* KASAN: use-after-free Read in dump_schedule
@ 2020-09-03 16:37 syzbot
  2020-09-04  9:17 ` syzbot
  2021-01-22 17:21 ` syzbot
  0 siblings, 2 replies; 4+ messages in thread
From: syzbot @ 2020-09-03 16:37 UTC (permalink / raw)
  To: davem, jhs, jiri, kuba, linux-kernel, netdev, syzkaller-bugs,
	xiyou.wangcong

Hello,

syzbot found the following issue on:

HEAD commit:    fc3abb53 Merge branch 'for-linus' of git://git.kernel.org/..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=17b672f5900000
kernel config:  https://syzkaller.appspot.com/x/.config?x=e1c560d0f4e121c9
dashboard link: https://syzkaller.appspot.com/bug?extid=621fd33c0b53d15ee8de
compiler:       clang version 10.0.0 (https://github.com/llvm/llvm-project/ c2443155a0fb245c8f17f2c1c72b6ea391e86e81)
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=1129d0e9900000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=17fb6a25900000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+621fd33c0b53d15ee8de@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in dump_schedule+0x4b/0x850 net/sched/sch_taprio.c:1747
Read of size 8 at addr ffff88808f48cb40 by task syz-executor466/11250

CPU: 0 PID: 11250 Comm: syz-executor466 Not tainted 5.9.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1d6/0x29e lib/dump_stack.c:118
 print_address_description+0x66/0x620 mm/kasan/report.c:383
 __kasan_report mm/kasan/report.c:513 [inline]
 kasan_report+0x132/0x1d0 mm/kasan/report.c:530
 dump_schedule+0x4b/0x850 net/sched/sch_taprio.c:1747
 taprio_dump+0x701/0xcc0 net/sched/sch_taprio.c:1815
 tc_fill_qdisc+0x5c5/0x1150 net/sched/sch_api.c:916
 qdisc_notify+0x1df/0x370 net/sched/sch_api.c:983
 tc_modify_qdisc+0x1b1a/0x1d90 net/sched/sch_api.c:1635
 rtnetlink_rcv_msg+0x889/0xd40 net/core/rtnetlink.c:5563
 netlink_rcv_skb+0x190/0x3a0 net/netlink/af_netlink.c:2470
 netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline]
 netlink_unicast+0x786/0x940 net/netlink/af_netlink.c:1330
 netlink_sendmsg+0xa57/0xd70 net/netlink/af_netlink.c:1919
 sock_sendmsg_nosec net/socket.c:651 [inline]
 sock_sendmsg net/socket.c:671 [inline]
 kernel_sendmsg+0xe2/0x120 net/socket.c:691
 sock_no_sendpage+0xe0/0x120 net/core/sock.c:2852
 kernel_sendpage net/socket.c:3642 [inline]
 sock_sendpage+0xd0/0x120 net/socket.c:944
 pipe_to_sendpage+0x208/0x2d0 fs/splice.c:448
 splice_from_pipe_feed fs/splice.c:502 [inline]
 __splice_from_pipe+0x351/0x8b0 fs/splice.c:626
 splice_from_pipe fs/splice.c:661 [inline]
 generic_splice_sendpage+0x112/0x180 fs/splice.c:834
 do_splice_from fs/splice.c:846 [inline]
 do_splice+0xdd1/0x1a50 fs/splice.c:1144
 __do_sys_splice fs/splice.c:1419 [inline]
 __se_sys_splice fs/splice.c:1401 [inline]
 __x64_sys_splice+0x14f/0x1f0 fs/splice.c:1401
 do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x449fa9
Code: e8 9c e6 ff ff 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 bb 04 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fa469406d88 EFLAGS: 00000246 ORIG_RAX: 0000000000000113
RAX: ffffffffffffffda RBX: 00000000006e0c48 RCX: 0000000000449fa9
RDX: 0000000000000004 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 00000000006e0c40 R08: 0000000000010973 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006e0c4c
R13: 140b0024000000a4 R14: 0000000000000000 R15: 000000306d616574

Allocated by task 11229:
 kasan_save_stack mm/kasan/common.c:48 [inline]
 kasan_set_track mm/kasan/common.c:56 [inline]
 __kasan_kmalloc+0x100/0x130 mm/kasan/common.c:461
 kmem_cache_alloc_trace+0x1e4/0x2e0 mm/slab.c:3550
 kmalloc include/linux/slab.h:554 [inline]
 kzalloc include/linux/slab.h:666 [inline]
 taprio_change+0x3b5/0x5200 net/sched/sch_taprio.c:1436
 qdisc_change net/sched/sch_api.c:1331 [inline]
 tc_modify_qdisc+0x1793/0x1d90 net/sched/sch_api.c:1633
 rtnetlink_rcv_msg+0x889/0xd40 net/core/rtnetlink.c:5563
 netlink_rcv_skb+0x190/0x3a0 net/netlink/af_netlink.c:2470
 netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline]
 netlink_unicast+0x786/0x940 net/netlink/af_netlink.c:1330
 netlink_sendmsg+0xa57/0xd70 net/netlink/af_netlink.c:1919
 sock_sendmsg_nosec net/socket.c:651 [inline]
 sock_sendmsg net/socket.c:671 [inline]
 kernel_sendmsg+0xe2/0x120 net/socket.c:691
 sock_no_sendpage+0xe0/0x120 net/core/sock.c:2852
 kernel_sendpage net/socket.c:3642 [inline]
 sock_sendpage+0xd0/0x120 net/socket.c:944
 pipe_to_sendpage+0x208/0x2d0 fs/splice.c:448
 splice_from_pipe_feed fs/splice.c:502 [inline]
 __splice_from_pipe+0x351/0x8b0 fs/splice.c:626
 splice_from_pipe fs/splice.c:661 [inline]
 generic_splice_sendpage+0x112/0x180 fs/splice.c:834
 do_splice_from fs/splice.c:846 [inline]
 do_splice+0xdd1/0x1a50 fs/splice.c:1144
 __do_sys_splice fs/splice.c:1419 [inline]
 __se_sys_splice fs/splice.c:1401 [inline]
 __x64_sys_splice+0x14f/0x1f0 fs/splice.c:1401
 do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

Freed by task 9:
 kasan_save_stack mm/kasan/common.c:48 [inline]
 kasan_set_track+0x3d/0x70 mm/kasan/common.c:56
 kasan_set_free_info+0x17/0x30 mm/kasan/generic.c:355
 __kasan_slab_free+0xdd/0x110 mm/kasan/common.c:422
 __cache_free mm/slab.c:3418 [inline]
 kfree+0x113/0x200 mm/slab.c:3756
 rcu_do_batch kernel/rcu/tree.c:2428 [inline]
 rcu_core+0x79b/0x1130 kernel/rcu/tree.c:2656
 __do_softirq+0x256/0x6d5 kernel/softirq.c:298

Last call_rcu():
 kasan_save_stack+0x27/0x50 mm/kasan/common.c:48
 kasan_record_aux_stack+0x7b/0xb0 mm/kasan/generic.c:346
 __call_rcu kernel/rcu/tree.c:2894 [inline]
 call_rcu+0x141/0x830 kernel/rcu/tree.c:2968
 taprio_change+0x4202/0x5200 net/sched/sch_taprio.c:1554
 qdisc_change net/sched/sch_api.c:1331 [inline]
 tc_modify_qdisc+0x1793/0x1d90 net/sched/sch_api.c:1633
 rtnetlink_rcv_msg+0x889/0xd40 net/core/rtnetlink.c:5563
 netlink_rcv_skb+0x190/0x3a0 net/netlink/af_netlink.c:2470
 netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline]
 netlink_unicast+0x786/0x940 net/netlink/af_netlink.c:1330
 netlink_sendmsg+0xa57/0xd70 net/netlink/af_netlink.c:1919
 sock_sendmsg_nosec net/socket.c:651 [inline]
 sock_sendmsg net/socket.c:671 [inline]
 kernel_sendmsg+0xe2/0x120 net/socket.c:691
 sock_no_sendpage+0xe0/0x120 net/core/sock.c:2852
 kernel_sendpage net/socket.c:3642 [inline]
 sock_sendpage+0xd0/0x120 net/socket.c:944
 pipe_to_sendpage+0x208/0x2d0 fs/splice.c:448
 splice_from_pipe_feed fs/splice.c:502 [inline]
 __splice_from_pipe+0x351/0x8b0 fs/splice.c:626
 splice_from_pipe fs/splice.c:661 [inline]
 generic_splice_sendpage+0x112/0x180 fs/splice.c:834
 do_splice_from fs/splice.c:846 [inline]
 do_splice+0xdd1/0x1a50 fs/splice.c:1144
 __do_sys_splice fs/splice.c:1419 [inline]
 __se_sys_splice fs/splice.c:1401 [inline]
 __x64_sys_splice+0x14f/0x1f0 fs/splice.c:1401
 do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

Second to last call_rcu():
 kasan_save_stack+0x27/0x50 mm/kasan/common.c:48
 kasan_record_aux_stack+0x7b/0xb0 mm/kasan/generic.c:346
 __call_rcu kernel/rcu/tree.c:2894 [inline]
 call_rcu+0x141/0x830 kernel/rcu/tree.c:2968
 taprio_change+0x4202/0x5200 net/sched/sch_taprio.c:1554
 qdisc_change net/sched/sch_api.c:1331 [inline]
 tc_modify_qdisc+0x1793/0x1d90 net/sched/sch_api.c:1633
 rtnetlink_rcv_msg+0x889/0xd40 net/core/rtnetlink.c:5563
 netlink_rcv_skb+0x190/0x3a0 net/netlink/af_netlink.c:2470
 netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline]
 netlink_unicast+0x786/0x940 net/netlink/af_netlink.c:1330
 netlink_sendmsg+0xa57/0xd70 net/netlink/af_netlink.c:1919
 sock_sendmsg_nosec net/socket.c:651 [inline]
 sock_sendmsg net/socket.c:671 [inline]
 kernel_sendmsg+0xe2/0x120 net/socket.c:691
 sock_no_sendpage+0xe0/0x120 net/core/sock.c:2852
 kernel_sendpage net/socket.c:3642 [inline]
 sock_sendpage+0xd0/0x120 net/socket.c:944
 pipe_to_sendpage+0x208/0x2d0 fs/splice.c:448
 splice_from_pipe_feed fs/splice.c:502 [inline]
 __splice_from_pipe+0x351/0x8b0 fs/splice.c:626
 splice_from_pipe fs/splice.c:661 [inline]
 generic_splice_sendpage+0x112/0x180 fs/splice.c:834
 do_splice_from fs/splice.c:846 [inline]
 do_splice+0xdd1/0x1a50 fs/splice.c:1144
 __do_sys_splice fs/splice.c:1419 [inline]
 __se_sys_splice fs/splice.c:1401 [inline]
 __x64_sys_splice+0x14f/0x1f0 fs/splice.c:1401
 do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

The buggy address belongs to the object at ffff88808f48cb00
 which belongs to the cache kmalloc-96 of size 96
The buggy address is located 64 bytes inside of
 96-byte region [ffff88808f48cb00, ffff88808f48cb60)
The buggy address belongs to the page:
page:00000000cae6299d refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88808f48cd00 pfn:0x8f48c
flags: 0xfffe0000000200(slab)
raw: 00fffe0000000200 ffffea0002761e08 ffffea000275d888 ffff8880aa440300
raw: ffff88808f48cd00 ffff88808f48c000 000000010000001a 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88808f48ca00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
 ffff88808f48ca80: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
>ffff88808f48cb00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
                                           ^
 ffff88808f48cb80: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc
 ffff88808f48cc00: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc
==================================================================


---
This report 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 issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

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

* Re: KASAN: use-after-free Read in dump_schedule
  2020-09-03 16:37 KASAN: use-after-free Read in dump_schedule syzbot
@ 2020-09-04  9:17 ` syzbot
  2021-01-22 17:21 ` syzbot
  1 sibling, 0 replies; 4+ messages in thread
From: syzbot @ 2020-09-04  9:17 UTC (permalink / raw)
  To: davem, jhs, jiri, kuba, leandro.maciel.dorileo, linux-kernel,
	netdev, syzkaller-bugs, vedang.patel, xiyou.wangcong

syzbot has bisected this issue to:

commit 7b9eba7ba0c1b24df42b70b62d154b284befbccf
Author: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
Date:   Mon Apr 8 17:12:17 2019 +0000

    net/sched: taprio: fix picos_per_byte miscalculation

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=15464af9900000
start commit:   fc3abb53 Merge branch 'for-linus' of git://git.kernel.org/..
git tree:       upstream
final oops:     https://syzkaller.appspot.com/x/report.txt?x=17464af9900000
console output: https://syzkaller.appspot.com/x/log.txt?x=13464af9900000
kernel config:  https://syzkaller.appspot.com/x/.config?x=e1c560d0f4e121c9
dashboard link: https://syzkaller.appspot.com/bug?extid=621fd33c0b53d15ee8de
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=1129d0e9900000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=17fb6a25900000

Reported-by: syzbot+621fd33c0b53d15ee8de@syzkaller.appspotmail.com
Fixes: 7b9eba7ba0c1 ("net/sched: taprio: fix picos_per_byte miscalculation")

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

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

* Re: KASAN: use-after-free Read in dump_schedule
  2020-09-03 16:37 KASAN: use-after-free Read in dump_schedule syzbot
  2020-09-04  9:17 ` syzbot
@ 2021-01-22 17:21 ` syzbot
  2021-01-25  9:35   ` Dmitry Vyukov
  1 sibling, 1 reply; 4+ messages in thread
From: syzbot @ 2021-01-22 17:21 UTC (permalink / raw)
  To: anant.thazhemadam, anmol.karan123, coreteam, davem, fw, jhs,
	jiri, kadlec, kuba, leandro.maciel.dorileo, linux-kernel, netdev,
	netfilter-devel, pablo, subashab, syzkaller-bugs, vedang.patel,
	xiyou.wangcong, yoshfuji

syzbot suspects this issue was fixed by commit:

commit cc00bcaa589914096edef7fb87ca5cee4a166b5c
Author: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Date:   Wed Nov 25 18:27:22 2020 +0000

    netfilter: x_tables: Switch synchronization to RCU

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=10879d68d00000
start commit:   59126901 Merge tag 'perf-tools-fixes-for-v5.9-2020-09-03' ..
git tree:       upstream
kernel config:  https://syzkaller.appspot.com/x/.config?x=3c5f6ce8d5b68299
dashboard link: https://syzkaller.appspot.com/bug?extid=621fd33c0b53d15ee8de
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=152c3af9900000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=12213b71900000

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

#syz fix: netfilter: x_tables: Switch synchronization to RCU

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

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

* Re: KASAN: use-after-free Read in dump_schedule
  2021-01-22 17:21 ` syzbot
@ 2021-01-25  9:35   ` Dmitry Vyukov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Vyukov @ 2021-01-25  9:35 UTC (permalink / raw)
  To: syzbot
  Cc: Anant Thazhemadam, anmol.karan123, coreteam, David Miller,
	Florian Westphal, Jamal Hadi Salim, Jiří Pírko,
	Jozsef Kadlecsik, Jakub Kicinski, leandro.maciel.dorileo, LKML,
	netdev, NetFilter, Pablo Neira Ayuso, subashab, syzkaller-bugs,
	vedang.patel, Cong Wang, Hideaki YOSHIFUJI

On Fri, Jan 22, 2021 at 6:21 PM syzbot
<syzbot+621fd33c0b53d15ee8de@syzkaller.appspotmail.com> wrote:
>
> syzbot suspects this issue was fixed by commit:
>
> commit cc00bcaa589914096edef7fb87ca5cee4a166b5c
> Author: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
> Date:   Wed Nov 25 18:27:22 2020 +0000
>
>     netfilter: x_tables: Switch synchronization to RCU
>
> bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=10879d68d00000
> start commit:   59126901 Merge tag 'perf-tools-fixes-for-v5.9-2020-09-03' ..
> git tree:       upstream
> kernel config:  https://syzkaller.appspot.com/x/.config?x=3c5f6ce8d5b68299
> dashboard link: https://syzkaller.appspot.com/bug?extid=621fd33c0b53d15ee8de
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=152c3af9900000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=12213b71900000
>
> If the result looks correct, please mark the issue as fixed by replying with:
>
> #syz fix: netfilter: x_tables: Switch synchronization to RCU
>
> For information about bisection process see: https://goo.gl/tpsmEJ#bisection

#syz fix: netfilter: x_tables: Switch synchronization to RCU

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

end of thread, other threads:[~2021-01-26  5:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-03 16:37 KASAN: use-after-free Read in dump_schedule syzbot
2020-09-04  9:17 ` syzbot
2021-01-22 17:21 ` syzbot
2021-01-25  9:35   ` Dmitry Vyukov

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.