android_kernel_motorola_sm6225/net
Chen Zhongjin c3e4fb05ec xfrm: Fix ignored return value in xfrm6_init()
[ Upstream commit 40781bfb836eda57d19c0baa37c7e72590e05fdc ]

When IPv6 module initializing in xfrm6_init(), register_pernet_subsys()
is possible to fail but its return value is ignored.

If IPv6 initialization fails later and xfrm6_fini() is called,
removing uninitialized list in xfrm6_net_ops will cause null-ptr-deref:

KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
CPU: 1 PID: 330 Comm: insmod
RIP: 0010:unregister_pernet_operations+0xc9/0x450
Call Trace:
 <TASK>
 unregister_pernet_subsys+0x31/0x3e
 xfrm6_fini+0x16/0x30 [ipv6]
 ip6_route_init+0xcd/0x128 [ipv6]
 inet6_init+0x29c/0x602 [ipv6]
 ...

Fix it by catching the error return value of register_pernet_subsys().

Fixes: 8d068875ca ("xfrm: make gc_thresh configurable in all namespaces")
Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-08 11:18:30 +01:00
..
6lowpan 6lowpan: Off by one handling ->nexthdr 2020-01-27 14:50:41 +01:00
9p 9p/fd: fix issue of list_del corruption in p9_fd_cancel() 2022-12-08 11:18:29 +01:00
802 net/802/garp: fix memleak in garp_request_join() 2021-07-31 08:22:37 +02:00
8021q net: vlan: avoid leaks on register_vlan_dev() failures 2021-01-17 14:04:19 +01:00
appletalk appletalk: Fix skb allocation size in loopback case 2021-04-07 12:48:49 +02:00
atm net/atm: fix proc_mpc_write incorrect return value 2022-11-03 23:52:26 +09:00
ax25 ax25: Fix UAF bugs in ax25 timers 2022-04-27 13:39:46 +02:00
batman-adv batman-adv: Don't skb_split skbuffs with frag_list 2022-05-18 09:42:47 +02:00
bluetooth Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm 2022-11-25 17:40:22 +01:00
bpf bpf, test_run: Fix alignment problem in bpf_prog_test_run_skb() 2022-11-25 17:40:29 +01:00
bpfilter signal/bpfilter: Fix bpfilter_kernl to use send_sig not force_sig 2020-01-27 14:50:51 +01:00
bridge netfilter: ebtables: fix memory leak when blob is malformed 2022-09-28 11:02:56 +02:00
caif net: caif: fix double disconnect client in chnl_net_open() 2022-11-25 17:40:24 +01:00
can can: bcm: check the result of can_send() in bcm_can_tx() 2022-10-26 13:19:37 +02:00
ceph libceph: clear con->out_msg on Policy::stateful_server faults 2020-11-05 11:08:53 +01:00
core net: gso: fix panic on frag_list with mixed head alloc types 2022-11-25 17:40:16 +01:00
dcb net: dcb: disable softirqs in dcbnl_flush_dev() 2022-03-08 19:04:10 +01:00
dccp dccp: put dccp_qpolicy_full() and dccp_qpolicy_push() in the same lock 2022-08-25 11:15:13 +02:00
decnet net: decnet: Fix sleeping inside in af_decnet 2021-07-28 11:13:48 +02:00
dns_resolver KEYS: Don't write out to userspace while holding key semaphore 2020-04-23 10:30:24 +02:00
dsa net: dsa: Add missing of_node_put() in dsa_port_parse_of 2022-03-23 09:10:44 +01:00
ethernet net: add annotations on hh->hh_len lockless accesses 2020-01-09 10:19:09 +01:00
hsr hsr: use netdev_err() instead of WARN_ONCE() 2021-05-22 10:59:24 +02:00
ieee802154 net: ieee802154: fix error return code in dgram_bind() 2022-11-03 23:52:30 +09:00
ife
ipv4 tcp: cdg: allow tcp_cdg_release() to be called multiple times 2022-11-25 17:40:28 +01:00
ipv6 xfrm: Fix ignored return value in xfrm6_init() 2022-12-08 11:18:30 +01:00
iucv net/af_iucv: set correct sk_protocol for child sockets 2020-12-08 10:18:52 +01:00
kcm kcm: close race conditions on sk_receive_queue 2022-11-25 17:40:29 +01:00
key af_key: Fix send_acquire race with pfkey_register 2022-12-08 11:18:29 +01:00
l2tp ipv6: Fix signed integer overflow in l2tp_ip6_sendmsg 2022-06-25 11:49:15 +02:00
l3mdev
lapb net: lapb: Copy the skb before sending a packet 2021-02-10 09:21:06 +01:00
llc llc: only change llc->dev when bind() succeeds 2022-03-28 08:41:44 +02:00
mac80211 wifi: mac80211: Fix ack frame idr leak when mesh has no route 2022-12-08 11:18:28 +01:00
mac802154 mac802154: Fix LQI recording 2022-11-03 23:52:28 +09:00
mpls net: mpls: Fix notifications when deleting a device 2021-12-08 08:50:13 +01:00
ncsi net/ncsi: Avoid channel_monitor hrtimer deadlock 2021-04-14 08:22:35 +02:00
netfilter ipvs: fix WARNING in ip_vs_app_net_cleanup() 2022-11-10 17:46:52 +01:00
netlabel net: fix NULL pointer reference in cipso_v4_doi_free 2021-09-22 11:48:09 +02:00
netlink netlink: do not reset transport header in netlink_recvmsg() 2022-05-18 09:42:47 +02:00
netrom netrom: Decrease sock refcount when sock timers expire 2021-07-28 11:13:48 +02:00
nfc nfc/nci: fix race with opening and closing 2022-12-08 11:18:29 +01:00
nsh
openvswitch openvswitch: switch from WARN to pr_warn 2022-11-03 23:52:33 +09:00
packet net/packet: fix packet_sock xmit return value checking 2022-04-27 13:39:43 +02:00
phonet phonet: refcount leak in pep_sock_accep 2022-01-11 13:58:50 +01:00
psample net: psample: fix skb_over_panic 2019-12-05 09:21:30 +01:00
qrtr net: qrtr: fix another OOB Read in qrtr_endpoint_post 2021-09-03 09:58:00 +02:00
rds net: rds: don't hold sock lock when cancelling work from rds_tcp_reset_callbacks() 2022-10-26 13:19:26 +02:00
rfkill rfkill: Fix incorrect check to avoid NULL pointer dereference 2020-01-12 12:17:17 +01:00
rose rose: Fix NULL pointer dereference in rose_send_frame() 2022-11-10 17:46:52 +01:00
rxrpc rxrpc: Fix local destruction being repeated 2022-09-28 11:02:52 +02:00
sched net: sched: Fix use after free in red_enqueue() 2022-11-10 17:46:52 +01:00
sctp sctp: handle the error returned from sctp_auth_asoc_init_active_key 2022-10-26 13:19:26 +02:00
smc net/smc: Remove redundant refcount increase 2022-09-15 12:17:03 +02:00
strparser net: strparser: partially revert "strparser: Call skb_unclone conditionally" 2019-05-16 19:41:27 +02:00
sunrpc SUNRPC: use _bh spinlocking on ->transport_lock 2022-09-15 12:17:06 +02:00
switchdev
tipc tipc: check skb_linearize() return value in tipc_disc_rcv() 2022-12-08 11:18:30 +01:00
tls net/tls: Fix race in TLS device down flow 2022-07-29 17:10:32 +02:00
unix af_unix: Fix a data-race in unix_dgram_peer_wake_me(). 2022-06-14 16:59:35 +02:00
vmw_vsock vhost/vsock: Use kvmalloc/kvfree for larger packets. 2022-10-26 13:19:26 +02:00
wimax
wireless wifi: cfg80211: fix memory leak in query_regdb_file() 2022-11-25 17:40:16 +01:00
x25 net/x25: Fix skb leak in x25_lapb_receive_frame() 2022-11-25 17:40:24 +01:00
xdp xsk: Simplify detection of empty and full rings 2021-05-22 10:59:48 +02:00
xfrm xfrm: Update ipcomp_scratches with NULL when freed 2022-10-26 13:19:37 +02:00
compat.c net: Return the correct errno code 2021-06-30 08:48:13 -04:00
Kconfig
Makefile net: split out functions related to registering inflight socket files 2021-07-31 08:22:37 +02:00
socket.c net: Fix a data-race around sysctl_somaxconn. 2022-09-05 10:26:31 +02:00
sysctl_net.c