android_kernel_motorola_sm6375/net
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Xin Long eab83178ee vlan: move dev_put into vlan_dev_uninit
commit d6ff94afd90b0ce8d1715f8ef77d4347d7a7f2c0 upstream.

Shuang Li reported an QinQ issue by simply doing:

  # ip link add dummy0 type dummy
  # ip link add link dummy0 name dummy0.1 type vlan id 1
  # ip link add link dummy0.1 name dummy0.1.2 type vlan id 2
  # rmmod 8021q

 unregister_netdevice: waiting for dummy0.1 to become free. Usage count = 1

When rmmods 8021q, all vlan devs are deleted from their real_dev's vlan grp
and added into list_kill by unregister_vlan_dev(). dummy0.1 is unregistered
before dummy0.1.2, as it's using for_each_netdev() in __rtnl_kill_links().

When unregisters dummy0.1, dummy0.1.2 is not unregistered in the event of
NETDEV_UNREGISTER, as it's been deleted from dummy0.1's vlan grp. However,
due to dummy0.1.2 still holding dummy0.1, dummy0.1 will keep waiting in
netdev_wait_allrefs(), while dummy0.1.2 will never get unregistered and
release dummy0.1, as it delays dev_put until calling dev->priv_destructor,
vlan_dev_free().

This issue was introduced by Commit 563bcbae3ba2 ("net: vlan: fix a UAF in
vlan_dev_real_dev()"), and this patch is to fix it by moving dev_put() into
vlan_dev_uninit(), which is called after NETDEV_UNREGISTER event but before
netdev_wait_allrefs().

Fixes: 563bcbae3ba2 ("net: vlan: fix a UAF in vlan_dev_real_dev()")
Reported-by: Shuang Li <shuali@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Ivan Delalande <colona@arista.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-03-13 12:43:20 +01:00
..
6lowpan
9p 9p/xen: fix release of IRQ 2024-12-14 19:44:41 +01:00
802 net: 802: LLC+SNAP OID:PID lookup on start of skb data 2025-02-01 18:18:45 +01:00
8021q vlan: move dev_put into vlan_dev_uninit 2025-03-13 12:43:20 +01:00
appletalk
atm
ax25
batman-adv batman-adv: fix panic during interface removal 2025-03-13 12:43:14 +01:00
bluetooth Bluetooth: L2CAP: handle NULL sock pointer in l2cap_sock_alloc 2025-03-13 12:43:07 +01:00
bpf
bpfilter
bridge netfilter: Replace zero-length array with flexible-array member 2025-01-09 13:23:35 +01:00
caif
can can: j1939: j1939_sk_send_loop(): fix unable to send messages with data length zero 2025-03-13 12:43:16 +01:00
ceph
core neighbour: use RCU protection in __neigh_notify() 2025-03-13 12:43:17 +01:00
dcb
dccp net: fix data-races around sk->sk_forward_alloc 2025-02-01 18:18:52 +01:00
decnet
dns_resolver
dsa
ethernet
hsr
ieee802154 net: ieee802154: do not leave a dangling sk pointer in ieee802154_create() 2024-12-14 19:44:51 +01:00
ife
ipv4 arp: use RCU protection in arp_xmit() 2025-03-13 12:43:18 +01:00
ipv6 ndisc: extend RCU protection in ndisc_send_skb() 2025-03-13 12:43:18 +01:00
iucv
kcm
key
l2tp genetlink: hold RCU in genlmsg_mcast() 2024-11-08 16:20:50 +01:00
l3mdev
lapb
llc net: llc: reset skb->transport_header 2025-01-09 13:23:35 +01:00
mac80211 wifi: mac80211: wake the queues in case of failure in resume 2025-01-09 13:23:35 +01:00
mac802154 mac802154: check local interfaces before deleting sdata list 2025-02-01 18:18:50 +01:00
mpls
ncsi net/ncsi: wait for the last response to Deselect Package before configuring channel 2025-03-13 12:43:11 +01:00
netfilter netfilter: Replace zero-length array with flexible-array member 2025-01-09 13:23:35 +01:00
netlabel
netlink netlink: terminate outstanding dump on socket close 2024-12-14 19:44:18 +01:00
netrom netrom: check buffer length before accessing it 2025-01-09 13:23:35 +01:00
nfc NFC: nci: Add bounds checking in nci_hci_create_pipe() 2025-03-13 12:43:11 +01:00
nsh
openvswitch openvswitch: use RCU protection in ovs_vport_cmd_fill_info() 2025-03-13 12:43:18 +01:00
packet af_packet: fix vlan_get_protocol_dgram() vs MSG_PEEK 2025-01-09 13:23:35 +01:00
phonet
psample
qrtr net: qrtr: Update packets cloning when broadcasting 2024-11-08 16:20:33 +01:00
rds
rfkill net: rfkill: gpio: Add check for clk_enable() 2024-12-14 19:44:27 +01:00
rose net: rose: lock the socket in rose_bind() 2025-03-13 12:43:06 +01:00
rxrpc
sched netem: Update sch->q.qlen before qdisc_tree_reduce_backlog() 2025-03-13 12:43:06 +01:00
sctp sctp: sysctl: rto_min/max: avoid using current->nsproxy 2025-02-01 18:18:49 +01:00
smc net/smc: check sndbuf_space again after NOSPACE flag is set in smc_poll 2025-01-09 13:23:27 +01:00
strparser
sunrpc sunrpc: clear XPRT_SOCK_UPD_TIMEOUT when reset transport 2024-12-14 19:44:42 +01:00
switchdev
tipc tipc: fix NULL deref in cleanup_bearer() 2024-12-19 18:05:03 +01:00
tls tls: Fix tls_sw_sendmsg error handling 2025-02-01 18:18:45 +01:00
unix
vmw_vsock vsock: Allow retrying on connect() failure 2025-03-13 12:43:00 +01:00
wimax
wireless genetlink: hold RCU in genlmsg_mcast() 2024-11-08 16:20:50 +01:00
x25
xdp
xfrm xfrm: validate new SA's prefixlen using SA family when sel.family is unset 2024-11-08 16:20:52 +01:00
compat.c
Kconfig
Makefile
socket.c
sysctl_net.c