linux-stable/drivers/net
Cong Wang 4832756676 rtnetlink: fix double call of rtnl_link_get_net_ifla()
Currently rtnl_link_get_net_ifla() gets called twice when we create
peer devices, once in rtnl_add_peer_net() and once in each ->newlink()
implementation.

This looks safer, however, it leads to a classic Time-of-Check to
Time-of-Use (TOCTOU) bug since IFLA_NET_NS_PID is very dynamic. And
because of the lack of checking error pointer of the second call, it
also leads to a kernel crash as reported by syzbot.

Fix this by getting rid of the second call, which already becomes
redudant after Kuniyuki's work. We have to propagate the result of the
first rtnl_link_get_net_ifla() down to each ->newlink().

Reported-by: syzbot+21ba4d5adff0b6a7cfc6@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=21ba4d5adff0b6a7cfc6
Fixes: 0eb87b02a7 ("veth: Set VETH_INFO_PEER to veth_link_ops.peer_type.")
Fixes: 6b84e558e9 ("vxcan: Set VXCAN_INFO_PEER to vxcan_link_ops.peer_type.")
Fixes: fefd5d0821 ("netkit: Set IFLA_NETKIT_PEER_INFO to netkit_link_ops.peer_type.")
Cc: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20241129212519.825567-1-xiyou.wangcong@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2024-12-03 11:29:29 +01:00
..
arcnet
bonding Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-11-14 11:29:15 -08:00
caif
can rtnetlink: fix double call of rtnl_link_get_net_ifla() 2024-12-03 11:29:29 +01:00
dsa net: dsa: microchip: Add LAN9646 switch support to KSZ DSA driver 2024-11-13 19:54:58 -08:00
ethernet net/qed: allow old cards not supporting "num_images" to work 2024-12-03 10:50:21 +01:00
fddi
fjes net: fjes: use ethtool string helpers 2024-10-31 19:36:59 -07:00
hamradio net: hamradio: scc: Switch to irq_get_nr_irqs() 2024-10-16 21:56:57 +02:00
hippi
hyperv Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-10-25 09:08:22 +02:00
ieee802154 net: Switch back to struct platform_driver::remove() 2024-10-04 16:39:57 -07:00
ipa net: Switch back to struct platform_driver::remove() 2024-10-04 16:39:57 -07:00
ipvlan ipvlan: Prepare ipvlan_process_v4_outbound() to future .flowi4_tos conversion. 2024-11-03 14:28:37 -08:00
mctp net: mctp: Expose transport binding identifier via IFLA attribute 2024-11-09 09:04:54 -08:00
mdio net: mdio-ipq4019: add missing error check 2024-11-26 11:01:39 +01:00
netdevsim netdevsim: add more hw_features 2024-11-11 14:12:20 -08:00
pcs net: pcs: xpcs: remove return statements in void function 2024-10-23 16:10:16 +02:00
phy net: phy: microchip: Reset LAN88xx PHY to ensure clean link state on LAN7800/7850 2024-12-02 18:56:41 -08:00
plip net: plip: fix break; causing plip to never transmit 2024-10-19 16:06:55 -05:00
ppp ppp: fix ppp_async_encode() illegal access 2024-10-10 08:47:13 -07:00
pse-pd net: pse-pd: Fix out of bound for loop 2024-10-19 15:55:56 -05:00
slip slip: make slhc_remember() more robust against malicious packets 2024-10-10 09:06:32 -07:00
team netpoll: remove ndo_netpoll_setup() second argument 2024-10-23 13:31:32 +02:00
thunderbolt
usb net: usb: lan78xx: Fix refcounting and autosuspend on invalid WoL configuration 2024-11-24 16:50:55 -08:00
vmxnet3 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-10-21 09:14:18 +02:00
vxlan ndo_fdb_del: Add a parameter to report whether notification was sent 2024-11-15 16:39:18 -08:00
wan net: Switch back to struct platform_driver::remove() 2024-10-04 16:39:57 -07:00
wireguard wireguard: device: support big tcp GSO 2024-11-18 19:32:27 -08:00
wireless pci-v6.13-changes 2024-11-26 18:05:44 -08:00
wwan net: wwan: t7xx: Change PM_AUTOSUSPEND_MS to 5000 2024-11-18 18:38:20 -08:00
xen-netback
amt.c net: convert to nla_get_*_default() 2024-11-11 10:32:06 -08:00
bareudp.c bareudp: Use pcpu stats to update rx_dropped counter. 2024-10-28 11:16:32 +00:00
dummy.c rtnetlink: Remove __rtnl_link_register() 2024-11-11 17:26:51 -08:00
eql.c
geneve.c net: tunnel: make skb_vlan_inet_prepare() return drop reasons 2024-10-13 11:33:08 +01:00
gtp.c net: convert to nla_get_*_default() 2024-11-11 10:32:06 -08:00
ifb.c rtnetlink: Remove __rtnl_link_register() 2024-11-11 17:26:51 -08:00
Kconfig testing: net-drv: add basic shaper test 2024-10-10 08:30:23 -07:00
LICENSE.SRC
loopback.c
macsec.c macsec: inherit lower device's TSO limits when offloading 2024-11-11 14:12:21 -08:00
macvlan.c ndo_fdb_del: Add a parameter to report whether notification was sent 2024-11-15 16:39:18 -08:00
macvtap.c
Makefile
mdio.c mdio: Remove mdio45_ethtool_gset_npage() 2024-11-14 19:08:55 -08:00
mhi_net.c
mii.c
net_failover.c
netconsole.c net: netconsole: split send_msg_fragmented 2024-10-22 15:44:25 +02:00
netkit.c rtnetlink: fix double call of rtnl_link_get_net_ifla() 2024-12-03 11:29:29 +01:00
nlmon.c
ntb_netdev.c
pfcp.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
tun.c appletalk: Remove deadcode 2024-10-04 12:42:32 +01:00
veth.c rtnetlink: fix double call of rtnl_link_get_net_ifla() 2024-12-03 11:29:29 +01:00
virtio_net.c virtio_net: xdp_features add NETDEV_XDP_ACT_XSK_ZEROCOPY 2024-11-15 18:46:56 -08:00
vrf.c vrf: Prepare vrf_process_v4_outbound() to future .flowi4_tos conversion. 2024-11-03 14:29:05 -08:00
vsockmon.c
xen-netfront.c