KASAN: use-after-free Read in __gtp_encap_destroy

Status: closed as invalid on 2021/10/06 01:29
Subsystems: net
[Documentation on labels]
First crash: 2133d, last: 2116d
Cause bisection: failed (error log, bisect log)
  
Fix bisection the fix commit could be any of (bisect log):
commit 5fc4053df3d9af1bf728feff90b8494dc036aae2
Author: Danielle Ratson <danieller@nvidia.com>
Date: Tue Feb 2 18:06:09 2021 +0000

  mlxsw: ethtool: Remove max lanes filtering

commit 7dc33f0914a9c8f992592cddfab2bab7faf162b9
Author: Danielle Ratson <danieller@nvidia.com>
Date: Tue Feb 2 18:06:08 2021 +0000

  ethtool: Expose the number of lanes in use

commit 763ece86f0c27c751d6fac6b15863f5124f79a52
Author: Danielle Ratson <danieller@nvidia.com>
Date: Tue Feb 2 18:06:10 2021 +0000

  mlxsw: ethtool: Add support for setting lanes when autoneg is off

commit c8907043c6ac9ed58e6c1a76f2824be714b42228
Author: Danielle Ratson <danieller@nvidia.com>
Date: Tue Feb 2 18:06:07 2021 +0000

  ethtool: Get link mode in use instead of speed and duplex parameters

commit 012ce4dd3102a0f4d80167de343e9d44b257c1b8
Author: Danielle Ratson <danieller@nvidia.com>
Date: Tue Feb 2 18:06:06 2021 +0000

  ethtool: Extend link modes settings uAPI with lanes

commit 25a96f057a0fab318376c85bd83afda267f8ad33
Author: Danielle Ratson <danieller@nvidia.com>
Date: Tue Feb 2 18:06:11 2021 +0000

  mlxsw: ethtool: Pass link mode in use to ethtool

commit 189e7a8d94208a26b7f7876d155cf695393f8efa
Author: Danielle Ratson <danieller@nvidia.com>
Date: Tue Feb 2 18:06:05 2021 +0000

  ethtool: Validate master slave configuration before rtnl_lock()

commit f72e2f48c71051f54e6fa214dc57f586386173b5
Author: Danielle Ratson <danieller@nvidia.com>
Date: Tue Feb 2 18:06:12 2021 +0000

  net: selftests: Add lanes setting test

commit 6fd5eeee1f107e2fb805609779994e3526de184f
Author: Jakub Kicinski <kuba@kernel.org>
Date: Thu Feb 4 02:37:31 2021 +0000

  Merge branch 'support-setting-lanes-via-ethtool'

commit 99b8202b179fc3dbbca69e8af6da660224c9d676
Author: Vladimir Oltean <vladimir.oltean@nxp.com>
Date: Tue Feb 2 23:31:09 2021 +0000

  net: dsa: fix SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING getting ignored

commit 75b8f78fb91fd7bbd730f2a5795f1f926b3bf0b2
Author: Jakub Kicinski <kuba@kernel.org>
Date: Thu Feb 4 01:41:03 2021 +0000

  Merge branch 'chelsio-cxgb-use-threaded-interrupts-for-deferred-work'

commit f5a5589c72509abaeb705123b64e7f5a078becf0
Author: Wei Wang <weiwan@google.com>
Date: Tue Feb 2 19:34:08 2021 +0000

  tcp: use a smaller percpu_counter batch size for sk_alloc

commit 3dd344ea84e122f791ab55498aab985535f32cba
Author: Hariharan Ananthakrishnan <hari@netflix.com>
Date: Fri Jan 29 00:12:10 2021 +0000

  net: tracepoint: exposing sk_family in all tcp:tracepoints

commit 82154580a7f72ed5b16f0b7829a6514542a6bd98
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Tue Feb 2 17:01:04 2021 +0000

  chelsio: cxgb: Disable the card on error in threaded interrupt

commit 49ecc587dca2754571791bebd36e9e36e2a0d973
Author: Jonas Bonn <jonas@norrbonn.se>
Date: Wed Feb 3 07:07:59 2021 +0000

  Revert "GTP: add support for flow based tunneling API"

commit fec7fa0a750c2127b01adb626e4945509da96462
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Tue Feb 2 17:01:03 2021 +0000

  chelsio: cxgb: Replace the workqueue with threaded interrupt

commit 462e99a18b22609ed40ee0c096775169c2859b21
Author: Jakub Kicinski <kuba@kernel.org>
Date: Thu Feb 4 01:31:35 2021 +0000

  Merge branch 'support-for-octeontx2-98xx-cpt-block'

commit e21eb3a065a2d90ee3bb06cc2e77acad403ec7cd
Author: Jonas Bonn <jonas@norrbonn.se>
Date: Wed Feb 3 07:08:00 2021 +0000

  gtp: set initial MTU

commit c57c58fd5c4fd288f5aca0970982c9bd547d6288
Author: Srujana Challa <schalla@marvell.com>
Date: Tue Feb 2 15:27:09 2021 +0000

  octeontx2-af: Handle CPT function level reset

commit e1b2914e645caa702ad6ddf4f1c48bdedb3d43cf
Author: Jonas Bonn <jonas@norrbonn.se>
Date: Wed Feb 3 07:08:01 2021 +0000

  gtp: include role in link info

commit a9c0df76d002111d0796cf04b5ad16f4f5a8d794
Author: Jonas Bonn <jonas@norrbonn.se>
Date: Wed Feb 3 07:08:02 2021 +0000

  gtp: really check namespaces before xmit

commit b0f60fab7805cb013311ede0127f8abbf1bdc986
Author: Srujana Challa <schalla@marvell.com>
Date: Tue Feb 2 15:27:08 2021 +0000

  octeontx2-af: Add support for CPT1 in debugfs

commit 70d132462998dcef701180e047c91933bda33ae2
Author: Jonas Bonn <jonas@norrbonn.se>
Date: Wed Feb 3 07:08:03 2021 +0000

  gtp: drop unnecessary call to skb_dst_drop

commit de2854c87c64788f94e34217d06e60422e4a1842
Author: Srujana Challa <schalla@marvell.com>
Date: Tue Feb 2 15:27:07 2021 +0000

  octeontx2-af: Mailbox changes for 98xx CPT block

commit 29f53b5c00c1deb27d31603ccf6ee161bd5ebb2f
Author: Jonas Bonn <jonas@norrbonn.se>
Date: Wed Feb 3 07:08:04 2021 +0000

  gtp: set device type

commit e0183b974d3008ae769d769cabfa2051c896dd48
Author: Mike Looijmans <mike.looijmans@topic.nl>
Date: Tue Feb 2 14:32:39 2021 +0000

  net: mdiobus: Prevent spike on MDIO bus reset signal

commit 4160d9ec5b41738e3a020b5a18cb5e99e2e9244d
Author: Dan Carpenter <dan.carpenter@oracle.com>
Date: Tue Feb 2 09:13:44 2021 +0000

  net: mscc: ocelot: fix error code in mscc_ocelot_probe()

commit 9716178a3abd7e4eb00ac44d664cfb2311e88c3b
Author: Jonas Bonn <jonas@norrbonn.se>
Date: Wed Feb 3 07:08:05 2021 +0000

  gtp: update rx_length_errors for abnormally short packets

commit 493007c1fa8902b9a211532c2849dbfbeec18f7e
Author: Jakub Kicinski <kuba@kernel.org>
Date: Thu Feb 4 17:30:00 2021 +0000

  Merge branch 'gtp'

commit e0c16233577fb8dde90760632df535d7b7846267
Author: Dan Carpenter <dan.carpenter@oracle.com>
Date: Tue Feb 2 09:12:38 2021 +0000

  net: mscc: ocelot: fix error handling bugs in mscc_ocelot_init_ports()

commit 2d912da016a7c4754b1ede9d953f6b00181f8954
Author: Jakub Kicinski <kuba@kernel.org>
Date: Wed Feb 3 22:51:41 2021 +0000

  Merge branch 'net-use-indirect_call-in-some-dst_ops'

commit e93fac3b51617401df46332499daae000e322ff8
Author: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Date: Tue Feb 2 10:17:49 2021 +0000

  drivers: net: xen-netfront: Simplify the calculation of variables

commit 7e3ce05e7f650371061d0b9eec1e1cf74ed6fca0
Author: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Date: Thu Feb 4 01:48:16 2021 +0000

  netlink: add tracepoint at NL_SET_ERR_MSG

commit bbd807dfbf20506f5548b0297c430a09326e7c4b
Author: Brian Vazquez <brianvv@google.com>
Date: Mon Feb 1 17:41:32 2021 +0000

  net: indirect call helpers for ipv4/ipv6 dst_check functions

commit 0053859496baa17c7675526936677c9213bf5a0d
Author: Brian Vazquez <brianvv@google.com>
Date: Thu Feb 4 18:18:38 2021 +0000

  net: add EXPORT_INDIRECT_CALLABLE wrapper

commit f67fbeaebdc0356e0cbc94f4b099f45ebe174b02
Author: Brian Vazquez <brianvv@google.com>
Date: Mon Feb 1 17:41:31 2021 +0000

  net: use indirect call helpers for dst_mtu

commit 9c97921a51a013917cfc387998882ecd0795937c
Author: Brian Vazquez <brianvv@google.com>
Date: Thu Feb 4 18:18:39 2021 +0000

  net: fix building errors on powerpc when CONFIG_RETPOLINE is not set
  

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __gtp_encap_destroy+0x194/0x1b0 drivers/net/gtp.c:359
Read of size 8 at addr ffff88801a106bd0 by task syz-executor495/8468

CPU: 1 PID: 8468 Comm: syz-executor495 Not tainted 5.11.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:79 [inline]
 dump_stack+0x107/0x163 lib/dump_stack.c:120
 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:230
 __kasan_report mm/kasan/report.c:396 [inline]
 kasan_report.cold+0x79/0xd5 mm/kasan/report.c:413
 __gtp_encap_destroy+0x194/0x1b0 drivers/net/gtp.c:359
 gtp_encap_destroy+0x16/0x20 drivers/net/gtp.c:373
 udpv6_destroy_sock+0x1df/0x220 net/ipv6/udp.c:1609
 sk_common_release+0x64/0x390 net/core/sock.c:3256
 inet_release+0x12e/0x280 net/ipv4/af_inet.c:431
 inet6_release+0x4c/0x70 net/ipv6/af_inet6.c:475
 __sock_release+0xcd/0x280 net/socket.c:597
 sock_close+0x18/0x20 net/socket.c:1256
 __fput+0x283/0x920 fs/file_table.c:280
 task_work_run+0xdd/0x190 kernel/task_work.c:140
 exit_task_work include/linux/task_work.h:30 [inline]
 do_exit+0xc5c/0x2ae0 kernel/exit.c:825
 do_group_exit+0x125/0x310 kernel/exit.c:922
 __do_sys_exit_group kernel/exit.c:933 [inline]
 __se_sys_exit_group kernel/exit.c:931 [inline]
 __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:931
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x43f078
Code: Unable to access opcode bytes at RIP 0x43f04e.
RSP: 002b:00007ffd4a550178 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043f078
RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000
RBP: 00000000004be888 R08: 00000000000000e7 R09: ffffffffffffffd0
R10: 0000000000000001 R11: 0000000000000246 R12: 0000000000000001
R13: 00000000006d0180 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 8468:
 kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:401 [inline]
 ____kasan_kmalloc.constprop.0+0x82/0xa0 mm/kasan/common.c:429
 kmalloc_node include/linux/slab.h:575 [inline]
 kvmalloc_node+0x61/0xf0 mm/util.c:587
 kvmalloc include/linux/mm.h:781 [inline]
 kvzalloc include/linux/mm.h:789 [inline]
 alloc_netdev_mqs+0x97/0xea0 net/core/dev.c:10525
 rtnl_create_link+0x219/0xad0 net/core/rtnetlink.c:3171
 __rtnl_newlink+0xf9b/0x16e0 net/core/rtnetlink.c:3433
 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3491
 rtnetlink_rcv_msg+0x44e/0xad0 net/core/rtnetlink.c:5553
 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2494
 netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline]
 netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1330
 netlink_sendmsg+0x856/0xd90 net/netlink/af_netlink.c:1919
 sock_sendmsg_nosec net/socket.c:652 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:672
 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2345
 ___sys_sendmsg+0xf3/0x170 net/socket.c:2399
 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2432
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

Freed by task 8468:
 kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38
 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46
 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:356
 ____kasan_slab_free+0xe1/0x110 mm/kasan/common.c:362
 kasan_slab_free include/linux/kasan.h:188 [inline]
 slab_free_hook mm/slub.c:1547 [inline]
 slab_free_freelist_hook+0x5d/0x150 mm/slub.c:1580
 slab_free mm/slub.c:3142 [inline]
 kfree+0xdb/0x3b0 mm/slub.c:4124
 kvfree+0x42/0x50 mm/util.c:616
 netdev_freemem net/core/dev.c:10479 [inline]
 free_netdev+0x4a9/0x5e0 net/core/dev.c:10648
 __rtnl_newlink+0x1484/0x16e0 net/core/rtnetlink.c:3447
 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3491
 rtnetlink_rcv_msg+0x44e/0xad0 net/core/rtnetlink.c:5553
 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2494
 netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline]
 netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1330
 netlink_sendmsg+0x856/0xd90 net/netlink/af_netlink.c:1919
 sock_sendmsg_nosec net/socket.c:652 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:672
 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2345
 ___sys_sendmsg+0xf3/0x170 net/socket.c:2399
 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2432
 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 ffff88801a106000
 which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 3024 bytes inside of
 4096-byte region [ffff88801a106000, ffff88801a107000)
The buggy address belongs to the page:
page:0000000052ee4c3d refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1a100
head:0000000052ee4c3d order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head)
raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888010042140
raw: 0000000000000000 0000000080040004 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88801a106a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88801a106b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88801a106b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                 ^
 ffff88801a106c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88801a106c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (22):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/01/16 15:00 net-next-old 9ab7e76aefc9 65a7a854 .config console log report syz C ci-upstream-net-kasan-gce
2021/02/03 09:45 net-next-old 9ae4bdc6e4c1 624dad51 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in __gtp_encap_destroy
2021/02/03 03:35 net-next-old 9ae4bdc6e4c1 624dad51 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in __gtp_encap_destroy
2021/02/01 03:41 net-next-old 14e8e0f60088 fc9fd31e .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in __gtp_encap_destroy
2021/01/28 17:58 net-next-old d1f3bdd4eaae 7df34f59 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in __gtp_encap_destroy
2021/01/21 10:40 net-next-old 0fe2f273ab89 d4f4eca5 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in __gtp_encap_destroy
2021/01/19 22:54 net-next-old 99d518970c5a 63631df1 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in __gtp_encap_destroy
2021/01/18 13:35 net-next-old 213b97b12580 fd103621 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in __gtp_encap_destroy
2021/01/28 20:41 linux-next d03154e8bb6a 7df34f59 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __gtp_encap_destroy
2021/01/25 13:23 linux-next bc085f8fc88f 52e37319 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __gtp_encap_destroy
2021/01/21 14:33 linux-next bc085f8fc88f d4f4eca5 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __gtp_encap_destroy
2021/01/18 12:38 linux-next 93bf8b946e5f fd103621 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __gtp_encap_destroy
2021/01/18 12:10 linux-next 93bf8b946e5f fd103621 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __gtp_encap_destroy
2021/01/18 11:31 linux-next 93bf8b946e5f fd103621 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __gtp_encap_destroy
2021/01/18 11:22 linux-next 93bf8b946e5f fd103621 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __gtp_encap_destroy
2021/01/18 10:22 linux-next 93bf8b946e5f fd103621 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __gtp_encap_destroy
2021/01/18 09:33 linux-next 93bf8b946e5f fd103621 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __gtp_encap_destroy
2021/01/18 08:49 linux-next 93bf8b946e5f fd103621 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __gtp_encap_destroy
2021/01/16 14:35 net-next-old 9ab7e76aefc9 65a7a854 .config console log report info ci-upstream-net-kasan-gce
2021/01/16 14:19 net-next-old 9ab7e76aefc9 65a7a854 .config console log report info ci-upstream-net-kasan-gce
2021/01/16 14:13 net-next-old 9ab7e76aefc9 65a7a854 .config console log report info ci-upstream-net-kasan-gce
2021/01/16 14:11 net-next-old 9ab7e76aefc9 65a7a854 .config console log report info ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.