twx-linux/drivers/net
Cong Wang 28c67f0f84 gtp: fix a potential NULL pointer dereference
[ Upstream commit defd8b3c37b0f9cb3e0f60f47d3d78d459d57fda ]

When sockfd_lookup() fails, gtp_encap_enable_socket() returns a
NULL pointer, but its callers only check for error pointers thus miss
the NULL pointer case.

Fix it by returning an error pointer with the error code carried from
sockfd_lookup().

(I found this bug during code inspection.)

Fixes: 1e3a3abd8b28 ("gtp: make GTP sockets in gtp_newlink optional")
Cc: Andreas Schultz <aschultz@tpip.net>
Cc: Harald Welte <laforge@gnumonks.org>
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Pablo Neira Ayuso <pablo@netfilter.org>
Link: https://patch.msgid.link/20240825191638.146748-1-xiyou.wangcong@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-09-04 13:28:27 +02:00
..
appletalk
arcnet
bonding bonding: change ipsec_lock from spin lock to mutex 2024-09-04 13:28:27 +02:00
caif
can can: mcp251xfd: tef: update workaround for erratum DS80000789E 6 of mcp2518fd 2024-08-14 13:58:43 +02:00
dsa net: dsa: microchip: fix PTP config failure when using multiple ports 2024-08-29 17:33:53 +02:00
ethernet net: mana: Fix race of mana_hwc_post_rx_wqe and new hwc response 2024-09-04 13:28:19 +02:00
fddi
fjes
hamradio
hippi
hyperv
ieee802154
ipa
ipvlan ipvlan: Dont Use skb->sk in ipvlan_process_v{4,6}_outbound 2024-06-12 11:12:59 +02:00
mctp
mdio
netdevsim
pcs
phy net: phy: micrel: Fix the KSZ9131 MDI-X status issue 2024-08-11 12:47:21 +02:00
plip
ppp pppoe: Fix memory leak in pppoe_sendmsg() 2024-08-19 06:04:27 +02:00
pse-pd
slip
team
thunderbolt
usb net: usb: qmi_wwan: fix memory leak for not ip packets 2024-08-14 13:58:39 +02:00
vmxnet3 vmxnet3: disable rx data ring on dma allocation failure 2024-06-21 14:38:15 +02:00
vxlan vxlan: Fix regression when dropping packets due to invalid src addresses 2024-06-21 14:38:17 +02:00
wan
wireguard wireguard: send: annotate intentional data race in checking empty queue 2024-07-18 13:21:23 +02:00
wireless wifi: iwlwifi: fw: fix wgds rev 3 exact size 2024-09-04 13:28:26 +02:00
wwan net: wwan: iosm: Fix tainted pointer delete is case of region creation fail 2024-06-21 14:38:18 +02:00
xen-netback kthread: add kthread_stop_put 2024-06-12 11:12:52 +02:00
amt.c
bareudp.c
dummy.c
eql.c
geneve.c geneve: Fix incorrect inner network header offset when innerprotoinherit is set 2024-06-21 14:38:33 +02:00
gtp.c gtp: fix a potential NULL pointer dereference 2024-09-04 13:28:27 +02:00
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macsec.c
macvlan.c
macvtap.c
Makefile net: Always descend into dsa/ folder with CONFIG_NET_DSA enabled 2024-06-12 11:12:46 +02:00
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c net: netconsole: Disable target before netpoll cleanup 2024-08-03 08:54:13 +02:00
nlmon.c
ntb_netdev.c net: ntb_netdev: Move ntb_netdev_rx_handler() to call netif_rx() from __netif_rx() 2024-07-11 12:49:13 +02:00
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c tap: add missing verification for short frame 2024-07-27 11:34:11 +02:00
tun.c tun: add missing verification for short frame 2024-07-27 11:34:10 +02:00
veth.c
virtio_net.c virtio_net: fixing XDP for fully checksummed packets handling 2024-06-27 13:49:07 +02:00
vrf.c
vsockmon.c
xen-netfront.c