linux-stable/drivers/net
Xiaomeng Tong fd3f70b907 net: dsa: bcm_sf2_cfp: fix an incorrect NULL check on list iterator
[ Upstream commit 6da69b1da1 ]

The bug is here:
	return rule;

The list iterator value 'rule' will *always* be set and non-NULL
by list_for_each_entry(), so it is incorrect to assume that the
iterator value will be NULL if the list is empty or no element
is found.

To fix the bug, return 'rule' when found, otherwise return NULL.

Fixes: ae7a5aff78 ("net: dsa: bcm_sf2: Keep copy of inserted rules")
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com>
Link: https://lore.kernel.org/r/20220328032431.22538-1-xiam0nd.tong@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-08 14:23:54 +02:00
..
appletalk
arcnet net: arcnet: com20020: Fix null-ptr-deref in com20020pci_probe() 2022-03-08 19:12:46 +01:00
bonding bonding: fix data-races around agg_select_timer 2022-02-23 12:03:12 +01:00
caif
can vxcan: enable local echo for sent CAN frames 2022-04-08 14:23:39 +02:00
dsa net: dsa: bcm_sf2_cfp: fix an incorrect NULL check on list iterator 2022-04-08 14:23:54 +02:00
ethernet octeontx2-af: initialize action variable 2022-04-08 14:23:53 +02:00
fddi
fjes
hamradio drivers: hamradio: 6pack: fix UAF bug caused by mod_timer() 2022-04-08 14:22:59 +02:00
hippi
hyperv hv_netvsc: Add check for kvmalloc_array 2022-03-23 09:16:42 +01:00
ieee802154 net: ieee802154: ca8210: Fix lifs/sifs periods 2022-02-23 12:03:11 +01:00
ipa net: ipa: add an interconnect dependency 2022-03-08 19:12:45 +01:00
ipvlan
mctp
mdio net: mdio-ipq4019: add delay after clock enable 2022-03-02 11:47:58 +01:00
netdevsim ipv6: fix data-race in fib6_info_hw_flags_set / fib6_purge_rt 2022-02-23 12:03:10 +01:00
pcs
phy net: phy: broadcom: Fix brcm_fet_config_init() 2022-04-08 14:23:52 +02:00
plip
ppp ppp: ensure minimum packet size in ppp_write() 2022-01-27 11:03:52 +01:00
slip slip: fix macro redefine warning 2022-03-11 12:22:31 +01:00
team
usb net: asix: add proper error handling of usb read errors 2022-04-08 14:23:29 +02:00
vmxnet3
wan
wireguard
wireless mt76: mt7921: fix mt7921_queues_acq implementation 2022-04-08 14:23:40 +02:00
wwan net: wwan: Fix MRU mismatch issue which may lead to data connection lost 2022-01-27 11:05:40 +01:00
xen-netback Revert "xen-netback: Check for hotplug-status existence before watching" 2022-03-16 14:23:41 +01:00
bareudp.c bareudp: use ipv6_mod_enabled to check if IPv6 enabled 2022-04-08 14:23:41 +02:00
dummy.c
eql.c
geneve.c
gtp.c
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macsec.c net: macsec: Verify that send_sci is on when setting Tx sci explicitly 2022-02-08 18:34:09 +01:00
macvlan.c
macvtap.c
Makefile
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c
veth.c veth: fix races around rq->rx_notify_masked 2022-02-16 12:56:30 +01:00
virtio_net.c
vrf.c
vsockmon.c
vxlan.c
xen-netfront.c xen/netfront: react properly to failing gnttab_end_foreign_access_ref() 2022-03-11 12:22:37 +01:00