mirror-linux/drivers/net
Florent Revest 6a1472d9be team: Fix use-after-free when an option instance allocation fails
commit c12296bbec upstream.

In __team_options_register, team_options are allocated and appended to
the team's option_list.
If one option instance allocation fails, the "inst_rollback" cleanup
path frees the previously allocated options but doesn't remove them from
the team's option_list.
This leaves dangling pointers that can be dereferenced later by other
parts of the team driver that iterate over options.

This patch fixes the cleanup path to remove the dangling pointers from
the list.

As far as I can tell, this uaf doesn't have much security implications
since it would be fairly hard to exploit (an attacker would need to make
the allocation of that specific small object fail) but it's still nice
to fix.

Cc: stable@vger.kernel.org
Fixes: 80f7c6683f ("team: add support for per-port options")
Signed-off-by: Florent Revest <revest@chromium.org>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>
Link: https://lore.kernel.org/r/20231206123719.1963153-1-revest@chromium.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-12-20 17:00:25 +01:00
..
appletalk
arcnet arcnet: restoring support for multiple Sohard Arcnet cards 2023-12-13 18:39:07 +01:00
bonding bonding: stop the device in bond_setup_by_slave() 2023-11-28 17:07:05 +00:00
caif
can can: dev: can_put_echo_skb(): don't crash kernel if can_priv::echo_skb is accessed out of bounds 2023-11-20 11:51:53 +01:00
dsa net: dsa: lan9303: consequently nested-lock physical MDIO 2023-11-28 17:07:18 +00:00
ethernet stmmac: dwmac-loongson: Add architecture dependency 2023-12-20 17:00:21 +01:00
fddi
fjes
hamradio
hippi
hyperv hv_netvsc: rndis_filter needs to select NLS 2023-12-13 18:39:06 +01:00
ieee802154 net: ieee802154: adf7242: Fix some potential buffer overflow in adf7242_stats_show() 2023-11-02 09:35:27 +01:00
ipa
ipvlan ipvlan: add ipvlan_route_v6_outbound() helper 2023-11-28 17:07:04 +00:00
mctp
mdio
netdevsim
pcs
phy net: phylink: initialize carrier state at creation 2023-11-28 17:07:18 +00:00
plip
ppp ppp: limit MRU to 64K 2023-11-28 17:07:05 +00:00
pse-pd
slip
team team: Fix use-after-free when an option instance allocation fails 2023-12-20 17:00:25 +01:00
usb net: usb: qmi_wwan: claim interface 4 for ZTE MF290 2023-12-20 17:00:24 +01:00
vmxnet3
vxlan neighbour: annotate lockless accesses to n->nud_state 2023-10-10 22:00:42 +02:00
wan drivers/net: process the result of hdlc_open() and add call of hdlc_close() in uhdlc_close() 2023-10-10 22:00:40 +02:00
wireguard wireguard: use DEV_STATS_INC() 2023-12-03 07:32:07 +01:00
wireless wifi: wilc1000: use vmm_table as array in wilc struct 2023-11-28 17:07:11 +00:00
wwan
xen-netback xen-netback: use default TX queue size for vifs 2023-10-19 23:08:53 +02:00
Kconfig
LICENSE.SRC
Makefile
Space.c
amt.c
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c gtp: fix fragmentation needed check with gso 2023-11-02 09:35:28 +01:00
ifb.c
loopback.c
macsec.c net: add DEV_STATS_READ() helper 2023-11-20 11:51:55 +01:00
macvlan.c macvlan: Don't propagate promisc change to lower dev in passthru 2023-11-28 17:07:06 +00:00
macvtap.c
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tap.c
thunderbolt.c net: thunderbolt: Fix TCPv6 GSO checksum calculation 2023-10-06 14:57:04 +02:00
tun.c tun: prevent negative ifindex 2023-10-25 12:03:06 +02:00
veth.c veth: Fixing transmit return status for dropped packets 2023-09-19 12:28:02 +02:00
virtio_net.c
vrf.c vrf: Fix lockdep splat in output path 2023-10-10 22:00:46 +02:00
vsockmon.c
xen-netfront.c