netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* KASAN: use-after-free Read in decode_session6
@ 2020-06-29  4:55 syzbot
  2020-10-31 16:43 ` syzbot
  2020-11-01  5:40 ` syzbot
  0 siblings, 2 replies; 5+ messages in thread
From: syzbot @ 2020-06-29  4:55 UTC (permalink / raw)
  To: davem, herbert, kuba, linux-kernel, netdev, steffen.klassert,
	syzkaller-bugs

Hello,

syzbot found the following crash on:

HEAD commit:    b08866f4 Merge branch 'net-atlantic-various-non-functional..
git tree:       net-next
console output: https://syzkaller.appspot.com/x/log.txt?x=17096b55100000
kernel config:  https://syzkaller.appspot.com/x/.config?x=2172f4d0dbc37e27
dashboard link: https://syzkaller.appspot.com/bug?extid=5be8aebb1b7dfa90ef31
compiler:       gcc (GCC) 10.1.0-syz 20200507

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+5be8aebb1b7dfa90ef31@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in decode_session6+0xe7c/0x1580 net/xfrm/xfrm_policy.c:3389
Read of size 1 at addr ffff88808f61c0ad by task syz-executor.3/13170

CPU: 0 PID: 13170 Comm: syz-executor.3 Not tainted 5.8.0-rc2-syzkaller #0
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+0x18f/0x20d lib/dump_stack.c:118
 print_address_description.constprop.0.cold+0xae/0x436 mm/kasan/report.c:383
 __kasan_report mm/kasan/report.c:513 [inline]
 kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530
 decode_session6+0xe7c/0x1580 net/xfrm/xfrm_policy.c:3389
 __xfrm_decode_session+0x50/0xb0 net/xfrm/xfrm_policy.c:3481
 xfrm_decode_session include/net/xfrm.h:1135 [inline]
 vti6_tnl_xmit+0x40d/0x1c80 net/ipv6/ip6_vti.c:577
 __netdev_start_xmit include/linux/netdevice.h:4611 [inline]
 netdev_start_xmit include/linux/netdevice.h:4625 [inline]
 xmit_one net/core/dev.c:3562 [inline]
 dev_hard_start_xmit+0x193/0x950 net/core/dev.c:3578
 sch_direct_xmit+0x2ea/0xc00 net/sched/sch_generic.c:313
 qdisc_restart net/sched/sch_generic.c:376 [inline]
 __qdisc_run+0x4b9/0x1630 net/sched/sch_generic.c:384
 __dev_xmit_skb net/core/dev.c:3801 [inline]
 __dev_queue_xmit+0x1995/0x2d60 net/core/dev.c:4106
 neigh_output include/net/neighbour.h:509 [inline]
 ip6_finish_output2+0x8b6/0x17b0 net/ipv6/ip6_output.c:117
 __ip6_finish_output net/ipv6/ip6_output.c:143 [inline]
 __ip6_finish_output+0x447/0xab0 net/ipv6/ip6_output.c:128
 ip6_finish_output+0x34/0x1f0 net/ipv6/ip6_output.c:153
 NF_HOOK_COND include/linux/netfilter.h:296 [inline]
 ip6_output+0x1db/0x520 net/ipv6/ip6_output.c:176
 dst_output include/net/dst.h:435 [inline]
 NF_HOOK include/linux/netfilter.h:307 [inline]
 NF_HOOK include/linux/netfilter.h:301 [inline]
 mld_sendpack+0x92a/0xdb0 net/ipv6/mcast.c:1679
 mld_send_cr net/ipv6/mcast.c:1975 [inline]
 mld_ifc_timer_expire+0x60a/0xf10 net/ipv6/mcast.c:2474
 call_timer_fn+0x1ac/0x760 kernel/time/timer.c:1404
 expire_timers kernel/time/timer.c:1449 [inline]
 __run_timers.part.0+0x54c/0xa20 kernel/time/timer.c:1773
 __run_timers kernel/time/timer.c:1745 [inline]
 run_timer_softirq+0xae/0x1a0 kernel/time/timer.c:1786
 __do_softirq+0x34c/0xa60 kernel/softirq.c:292
 asm_call_on_stack+0xf/0x20 arch/x86/entry/entry_64.S:711
 </IRQ>
 __run_on_irqstack arch/x86/include/asm/irq_stack.h:22 [inline]
 run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:48 [inline]
 do_softirq_own_stack+0x111/0x170 arch/x86/kernel/irq_64.c:77
 invoke_softirq kernel/softirq.c:387 [inline]
 __irq_exit_rcu kernel/softirq.c:417 [inline]
 irq_exit_rcu+0x229/0x270 kernel/softirq.c:429
 sysvec_apic_timer_interrupt+0x12d/0x220 arch/x86/kernel/apic/apic.c:1091
 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:596
RIP: 0010:ip_sk_use_pmtu include/net/ip.h:425 [inline]
RIP: 0010:ip_setup_cork+0x171/0x910 net/ipv4/ip_output.c:1265
Code: 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 0f b6 14 02 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 fd 05 00 00 44 89 7b 04 <e8> 2a ce cc fa 49 8d bc 24 df 04 00 00 48 b8 00 00 00 00 00 fc ff
RSP: 0018:ffffc90004b47260 EFLAGS: 00000246
RAX: dffffc0000000000 RBX: ffffc90004b47568 RCX: ffffc9000ff09000
RDX: 1ffff92000968e9a RSI: ffffffff86a680fc RDI: ffffc90004b474d0
RBP: ffffc90004b474b8 R08: 0000000000000008 R09: 0000000000000008
R10: 0000000000000000 R11: 0000000000000000 R12: ffff88809458a000
R13: ffffc90004b47498 R14: ffff8880a1c86400 R15: 0000000000000000
 ip_make_skb+0x174/0x2a0 net/ipv4/ip_output.c:1628
 udp_sendmsg+0x1c2d/0x26c0 net/ipv4/udp.c:1176
 udpv6_sendmsg+0x14dd/0x2b90 net/ipv6/udp.c:1286
 inet6_sendmsg+0x99/0xe0 net/ipv6/af_inet6.c:638
 sock_sendmsg_nosec net/socket.c:652 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:672
 ____sys_sendmsg+0x331/0x810 net/socket.c:2352
 ___sys_sendmsg+0xf3/0x170 net/socket.c:2406
 __sys_sendmmsg+0x195/0x480 net/socket.c:2496
 __do_sys_sendmmsg net/socket.c:2525 [inline]
 __se_sys_sendmmsg net/socket.c:2522 [inline]
 __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2522
 do_syscall_64+0x60/0xe0 arch/x86/entry/common.c:359
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45cb19
Code: Bad RIP value.
RSP: 002b:00007f459bcffc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 00000000004fd680 RCX: 000000000045cb19
RDX: 00000000000005c3 RSI: 0000000020000240 RDI: 0000000000000003
RBP: 000000000078bf00 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 0000000000000902 R14: 00000000004cbde8 R15: 00007f459bd006d4

Allocated by task 13105:
 save_stack+0x1b/0x40 mm/kasan/common.c:48
 set_track mm/kasan/common.c:56 [inline]
 __kasan_kmalloc.constprop.0+0xc2/0xd0 mm/kasan/common.c:494
 kmem_cache_alloc_trace+0x14f/0x2d0 mm/slab.c:3551
 kmalloc include/linux/slab.h:555 [inline]
 kzalloc include/linux/slab.h:669 [inline]
 kobject_uevent_env+0x227/0x12c0 lib/kobject_uevent.c:523
 netdev_queue_add_kobject net/core/net-sysfs.c:1554 [inline]
 netdev_queue_update_kobjects+0x2f9/0x3c0 net/core/net-sysfs.c:1588
 register_queue_kobjects net/core/net-sysfs.c:1649 [inline]
 netdev_register_kobject+0x2ee/0x3b0 net/core/net-sysfs.c:1892
 register_netdevice+0xd29/0x1540 net/core/dev.c:9522
 __tun_chr_ioctl.isra.0+0x2c09/0x4170 drivers/net/tun.c:2817
 vfs_ioctl fs/ioctl.c:48 [inline]
 ksys_ioctl+0x11a/0x180 fs/ioctl.c:753
 __do_sys_ioctl fs/ioctl.c:762 [inline]
 __se_sys_ioctl fs/ioctl.c:760 [inline]
 __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:760
 do_syscall_64+0x60/0xe0 arch/x86/entry/common.c:359
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

Freed by task 13110:
 save_stack+0x1b/0x40 mm/kasan/common.c:48
 set_track mm/kasan/common.c:56 [inline]
 kasan_set_free_info mm/kasan/common.c:316 [inline]
 __kasan_slab_free+0xf5/0x140 mm/kasan/common.c:455
 __cache_free mm/slab.c:3426 [inline]
 kfree+0x103/0x2c0 mm/slab.c:3757
 call_usermodehelper_freeinfo kernel/umh.c:47 [inline]
 umh_complete+0x74/0x90 kernel/umh.c:62
 call_usermodehelper_exec_async+0x460/0x710 kernel/umh.c:122
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:293

The buggy address belongs to the object at ffff88808f61c000
 which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 173 bytes inside of
 4096-byte region [ffff88808f61c000, ffff88808f61d000)
The buggy address belongs to the page:
page:ffffea00023d8700 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 head:ffffea00023d8700 order:1 compound_mapcount:0
flags: 0xfffe0000010200(slab|head)
raw: 00fffe0000010200 ffffea0001af9708 ffffea000140d688 ffff8880aa002000
raw: 0000000000000000 ffff88808f61c000 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88808f61bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88808f61c000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88808f61c080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                  ^
 ffff88808f61c100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88808f61c180: 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 syzkaller@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

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

* Re: KASAN: use-after-free Read in decode_session6
  2020-06-29  4:55 KASAN: use-after-free Read in decode_session6 syzbot
@ 2020-10-31 16:43 ` syzbot
  2020-11-01  5:40 ` syzbot
  1 sibling, 0 replies; 5+ messages in thread
From: syzbot @ 2020-10-31 16:43 UTC (permalink / raw)
  To: davem, herbert, kuba, linux-kernel, netdev, steffen.klassert,
	syzkaller-bugs

syzbot has found a reproducer for the following issue on:

HEAD commit:    68bb4665 Merge branch 'l2-multicast-forwarding-for-ocelot-..
git tree:       net-next
console output: https://syzkaller.appspot.com/x/log.txt?x=1219346c500000
kernel config:  https://syzkaller.appspot.com/x/.config?x=eac680ae76558a0e
dashboard link: https://syzkaller.appspot.com/bug?extid=5be8aebb1b7dfa90ef31
compiler:       gcc (GCC) 10.1.0-syz 20200507
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=11286398500000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=11bbf398500000

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

==================================================================
BUG: KASAN: use-after-free in decode_session6+0xe7c/0x1580 net/xfrm/xfrm_policy.c:3393
Read of size 1 at addr ffff88802c9d08af by task syz-executor061/8480

CPU: 1 PID: 8480 Comm: syz-executor061 Not tainted 5.10.0-rc1-syzkaller #0
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+0x107/0x163 lib/dump_stack.c:118
 print_address_description.constprop.0.cold+0xae/0x4c8 mm/kasan/report.c:385
 __kasan_report mm/kasan/report.c:545 [inline]
 kasan_report.cold+0x1f/0x37 mm/kasan/report.c:562
 decode_session6+0xe7c/0x1580 net/xfrm/xfrm_policy.c:3393
 __xfrm_decode_session net/xfrm/xfrm_policy.c:3485 [inline]
 __xfrm_policy_check+0x2fa/0x2850 net/xfrm/xfrm_policy.c:3540
 __xfrm_policy_check2 include/net/xfrm.h:1097 [inline]
 xfrm_policy_check include/net/xfrm.h:1106 [inline]
 sctp_rcv+0x12b0/0x2e30 net/sctp/input.c:202
 sctp6_rcv+0x22/0x40 net/sctp/ipv6.c:1078
 ip6_protocol_deliver_rcu+0x2e8/0x1680 net/ipv6/ip6_input.c:433
 ip6_input_finish+0x7f/0x160 net/ipv6/ip6_input.c:474
 NF_HOOK include/linux/netfilter.h:301 [inline]
 NF_HOOK include/linux/netfilter.h:295 [inline]
 ip6_input+0x9c/0xd0 net/ipv6/ip6_input.c:483
 dst_input include/net/dst.h:449 [inline]
 ip6_rcv_finish net/ipv6/ip6_input.c:76 [inline]
 NF_HOOK include/linux/netfilter.h:301 [inline]
 NF_HOOK include/linux/netfilter.h:295 [inline]
 ipv6_rcv+0x28e/0x3c0 net/ipv6/ip6_input.c:307
 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5315
 __netif_receive_skb+0x27/0x1c0 net/core/dev.c:5429
 process_backlog+0x232/0x6c0 net/core/dev.c:6319
 napi_poll net/core/dev.c:6763 [inline]
 net_rx_action+0x4dc/0x1100 net/core/dev.c:6833
 __do_softirq+0x2a0/0x9f6 kernel/softirq.c:298
 asm_call_irq_on_stack+0xf/0x20
 </IRQ>
 __run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline]
 run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline]
 do_softirq_own_stack+0xaa/0xd0 arch/x86/kernel/irq_64.c:77
 do_softirq kernel/softirq.c:343 [inline]
 do_softirq+0xb5/0xe0 kernel/softirq.c:330
 __local_bh_enable_ip+0xf0/0x110 kernel/softirq.c:195
 local_bh_enable include/linux/bottom_half.h:32 [inline]
 rcu_read_unlock_bh include/linux/rcupdate.h:730 [inline]
 ip6_finish_output2+0x71f/0x16c0 net/ipv6/ip6_output.c:118
 __ip6_finish_output net/ipv6/ip6_output.c:143 [inline]
 __ip6_finish_output+0x447/0xab0 net/ipv6/ip6_output.c:128
 ip6_finish_output+0x34/0x1f0 net/ipv6/ip6_output.c:153
 NF_HOOK_COND include/linux/netfilter.h:290 [inline]
 ip6_output+0x1db/0x520 net/ipv6/ip6_output.c:176
 dst_output include/net/dst.h:443 [inline]
 NF_HOOK include/linux/netfilter.h:301 [inline]
 NF_HOOK include/linux/netfilter.h:295 [inline]
 ip6_xmit+0x1258/0x1e80 net/ipv6/ip6_output.c:280
 sctp_v6_xmit+0xbf3/0xfe0 net/sctp/ipv6.c:223
 sctp_packet_transmit+0x1f44/0x32f0 net/sctp/output.c:627
 sctp_packet_singleton net/sctp/outqueue.c:773 [inline]
 sctp_outq_flush_ctrl.constprop.0+0x6d3/0xc40 net/sctp/outqueue.c:904
 sctp_outq_flush+0xf3/0x2580 net/sctp/outqueue.c:1186
 sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1801 [inline]
 sctp_side_effects net/sctp/sm_sideeffect.c:1185 [inline]
 sctp_do_sm+0x74e/0x5130 net/sctp/sm_sideeffect.c:1156
 sctp_primitive_ASSOCIATE+0x98/0xc0 net/sctp/primitive.c:73
 sctp_sendmsg_to_asoc+0xb5b/0x2140 net/sctp/socket.c:1823
 sctp_sendmsg+0x103b/0x1d30 net/sctp/socket.c:2013
 inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:817
 sock_sendmsg_nosec net/socket.c:651 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:671
 __sys_sendto+0x21c/0x320 net/socket.c:1992
 __do_sys_sendto net/socket.c:2004 [inline]
 __se_sys_sendto net/socket.c:2000 [inline]
 __x64_sys_sendto+0xdd/0x1b0 net/socket.c:2000
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x4413c9
Code: e8 fc ab 02 00 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 1b 09 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fff3d021208 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004413c9
RDX: 0000000000034000 RSI: 0000000020847fff RDI: 0000000000000004
RBP: 00000000006cb018 R08: 000000002005ffe4 R09: 000000000000001c
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000402170
R13: 0000000000402200 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 1:
 kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48
 kasan_set_track mm/kasan/common.c:56 [inline]
 __kasan_kmalloc.constprop.0+0xc2/0xd0 mm/kasan/common.c:461
 kmalloc include/linux/slab.h:557 [inline]
 tomoyo_realpath_from_path+0xc3/0x620 security/tomoyo/realpath.c:254
 tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
 tomoyo_path_perm+0x21b/0x400 security/tomoyo/file.c:822
 security_inode_getattr+0xcf/0x140 security/security.c:1279
 vfs_getattr fs/stat.c:121 [inline]
 vfs_statx+0x164/0x390 fs/stat.c:189
 vfs_fstatat fs/stat.c:207 [inline]
 vfs_lstat include/linux/fs.h:3109 [inline]
 __do_sys_newlstat+0x91/0x110 fs/stat.c:362
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

Freed by task 1:
 kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48
 kasan_set_track+0x1c/0x30 mm/kasan/common.c:56
 kasan_set_free_info+0x1b/0x30 mm/kasan/generic.c:355
 __kasan_slab_free+0x102/0x140 mm/kasan/common.c:422
 slab_free_hook mm/slub.c:1544 [inline]
 slab_free_freelist_hook+0x5d/0x150 mm/slub.c:1577
 slab_free mm/slub.c:3142 [inline]
 kfree+0xdb/0x360 mm/slub.c:4124
 tomoyo_realpath_from_path+0x191/0x620 security/tomoyo/realpath.c:291
 tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
 tomoyo_path_perm+0x21b/0x400 security/tomoyo/file.c:822
 security_inode_getattr+0xcf/0x140 security/security.c:1279
 vfs_getattr fs/stat.c:121 [inline]
 vfs_statx+0x164/0x390 fs/stat.c:189
 vfs_fstatat fs/stat.c:207 [inline]
 vfs_lstat include/linux/fs.h:3109 [inline]
 __do_sys_newlstat+0x91/0x110 fs/stat.c:362
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

The buggy address belongs to the object at ffff88802c9d0000
 which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 2223 bytes inside of
 4096-byte region [ffff88802c9d0000, ffff88802c9d1000)
The buggy address belongs to the page:
page:00000000a89e7c26 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2c9d0
head:00000000a89e7c26 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head)
raw: 00fff00000010200 0000000000000000 0000000100000001 ffff888010042140
raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88802c9d0780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88802c9d0800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88802c9d0880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                  ^
 ffff88802c9d0900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88802c9d0980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


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

* Re: KASAN: use-after-free Read in decode_session6
  2020-06-29  4:55 KASAN: use-after-free Read in decode_session6 syzbot
  2020-10-31 16:43 ` syzbot
@ 2020-11-01  5:40 ` syzbot
  2020-11-03 13:14   ` Xin Long
  1 sibling, 1 reply; 5+ messages in thread
From: syzbot @ 2020-11-01  5:40 UTC (permalink / raw)
  To: davem, herbert, kuba, linux-kernel, lucien.xin, marcelo.leitner,
	netdev, steffen.klassert, syzkaller-bugs

syzbot has bisected this issue to:

commit bcd623d8e9fa5f82bbd8cd464dc418d24139157b
Author: Xin Long <lucien.xin@gmail.com>
Date:   Thu Oct 29 07:05:05 2020 +0000

    sctp: call sk_setup_caps in sctp_packet_transmit instead

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=14df9cb8500000
start commit:   68bb4665 Merge branch 'l2-multicast-forwarding-for-ocelot-..
git tree:       net-next
final oops:     https://syzkaller.appspot.com/x/report.txt?x=16df9cb8500000
console output: https://syzkaller.appspot.com/x/log.txt?x=12df9cb8500000
kernel config:  https://syzkaller.appspot.com/x/.config?x=eac680ae76558a0e
dashboard link: https://syzkaller.appspot.com/bug?extid=5be8aebb1b7dfa90ef31
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=11286398500000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=11bbf398500000

Reported-by: syzbot+5be8aebb1b7dfa90ef31@syzkaller.appspotmail.com
Fixes: bcd623d8e9fa ("sctp: call sk_setup_caps in sctp_packet_transmit instead")

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 decode_session6
  2020-11-01  5:40 ` syzbot
@ 2020-11-03 13:14   ` Xin Long
  2020-11-03 13:52     ` Xin Long
  0 siblings, 1 reply; 5+ messages in thread
From: Xin Long @ 2020-11-03 13:14 UTC (permalink / raw)
  To: syzbot
  Cc: davem, Herbert Xu, Jakub Kicinski, LKML, Marcelo Ricardo Leitner,
	network dev, Steffen Klassert, syzkaller-bugs

On Sun, Nov 1, 2020 at 1:40 PM syzbot
<syzbot+5be8aebb1b7dfa90ef31@syzkaller.appspotmail.com> wrote:
>
> syzbot has bisected this issue to:
>
> commit bcd623d8e9fa5f82bbd8cd464dc418d24139157b
> Author: Xin Long <lucien.xin@gmail.com>
> Date:   Thu Oct 29 07:05:05 2020 +0000
>
>     sctp: call sk_setup_caps in sctp_packet_transmit instead
>
> bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=14df9cb8500000
> start commit:   68bb4665 Merge branch 'l2-multicast-forwarding-for-ocelot-..
> git tree:       net-next
> final oops:     https://syzkaller.appspot.com/x/report.txt?x=16df9cb8500000
> console output: https://syzkaller.appspot.com/x/log.txt?x=12df9cb8500000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=eac680ae76558a0e
> dashboard link: https://syzkaller.appspot.com/bug?extid=5be8aebb1b7dfa90ef31
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=11286398500000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=11bbf398500000
>
> Reported-by: syzbot+5be8aebb1b7dfa90ef31@syzkaller.appspotmail.com
> Fixes: bcd623d8e9fa ("sctp: call sk_setup_caps in sctp_packet_transmit instead")
>
> For information about bisection process see: https://goo.gl/tpsmEJ#bisection
I'm looking into this, Thanks.

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

* Re: KASAN: use-after-free Read in decode_session6
  2020-11-03 13:14   ` Xin Long
@ 2020-11-03 13:52     ` Xin Long
  0 siblings, 0 replies; 5+ messages in thread
From: Xin Long @ 2020-11-03 13:52 UTC (permalink / raw)
  To: syzbot
  Cc: davem, Herbert Xu, Jakub Kicinski, LKML, Marcelo Ricardo Leitner,
	network dev, Steffen Klassert, syzkaller-bugs

On Tue, Nov 3, 2020 at 9:14 PM Xin Long <lucien.xin@gmail.com> wrote:
>
> On Sun, Nov 1, 2020 at 1:40 PM syzbot
> <syzbot+5be8aebb1b7dfa90ef31@syzkaller.appspotmail.com> wrote:
> >
> > syzbot has bisected this issue to:
> >
> > commit bcd623d8e9fa5f82bbd8cd464dc418d24139157b
> > Author: Xin Long <lucien.xin@gmail.com>
> > Date:   Thu Oct 29 07:05:05 2020 +0000
> >
> >     sctp: call sk_setup_caps in sctp_packet_transmit instead
> >
> > bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=14df9cb8500000
> > start commit:   68bb4665 Merge branch 'l2-multicast-forwarding-for-ocelot-..
> > git tree:       net-next
> > final oops:     https://syzkaller.appspot.com/x/report.txt?x=16df9cb8500000
> > console output: https://syzkaller.appspot.com/x/log.txt?x=12df9cb8500000
> > kernel config:  https://syzkaller.appspot.com/x/.config?x=eac680ae76558a0e
> > dashboard link: https://syzkaller.appspot.com/bug?extid=5be8aebb1b7dfa90ef31
> > syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=11286398500000
> > C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=11bbf398500000
> >
> > Reported-by: syzbot+5be8aebb1b7dfa90ef31@syzkaller.appspotmail.com
> > Fixes: bcd623d8e9fa ("sctp: call sk_setup_caps in sctp_packet_transmit instead")
> >
> > For information about bisection process see: https://goo.gl/tpsmEJ#bisection
> I'm looking into this, Thanks.
This was actually caused by:

commit a1dd2cf2f1aedabc2ca9bb4f90231a521c52d8eb
Author: Xin Long <lucien.xin@gmail.com>
Date:   Thu Oct 29 15:05:03 2020 +0800

    sctp: allow changing transport encap_port by peer packets

where the IP6CB was overwritten by SCTP_INPUT_CB.

inet6_skb_parmI will fix it by bringing inet6_skb_parm back to sctp_input_cb:

 struct sctp_input_cb {
+       union {
+               struct inet_skb_parm    h4;
+#if IS_ENABLED(CONFIG_IPV6)
+               struct inet6_skb_parm   h6;
+#endif
+       } header;
+       __be16 encap_port;
        struct sctp_chunk *chunk;
        struct sctp_af *af;
-       __be16 encap_port;
 };

Will post it soon, Thanks.

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

end of thread, other threads:[~2020-11-03 13:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-29  4:55 KASAN: use-after-free Read in decode_session6 syzbot
2020-10-31 16:43 ` syzbot
2020-11-01  5:40 ` syzbot
2020-11-03 13:14   ` Xin Long
2020-11-03 13:52     ` Xin Long

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).