1
0
Fork 0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-01-26 18:43:33 -05:00
linux/net
王贇 733c99ee8b net: fix NULL pointer reference in cipso_v4_doi_free
In netlbl_cipsov4_add_std() when 'doi_def->map.std' alloc
failed, we sometime observe panic:

  BUG: kernel NULL pointer dereference, address:
  ...
  RIP: 0010:cipso_v4_doi_free+0x3a/0x80
  ...
  Call Trace:
   netlbl_cipsov4_add_std+0xf4/0x8c0
   netlbl_cipsov4_add+0x13f/0x1b0
   genl_family_rcv_msg_doit.isra.15+0x132/0x170
   genl_rcv_msg+0x125/0x240

This is because in cipso_v4_doi_free() there is no check
on 'doi_def->map.std' when 'doi_def->type' equal 1, which
is possibe, since netlbl_cipsov4_add_std() haven't initialize
it before alloc 'doi_def->map.std'.

This patch just add the check to prevent panic happen for similar
cases.

Reported-by: Abaci <abaci@linux.alibaba.com>
Signed-off-by: Michael Wang <yun.wang@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-08-26 12:20:47 +01:00
..
6lowpan
9p
802
8021q
appletalk
atm
ax25
batman-adv
bluetooth Bluetooth: defer cleanup of resources in hci_unregister_dev() 2021-08-05 12:15:24 -07:00
bpf bpf: Add missing bpf_read_[un]lock_trace() for syscall program 2021-08-10 10:10:49 +02:00
bpfilter
bridge net: bridge: fix memleak in br_add_if() 2021-08-10 13:25:14 -07:00
caif
can can: j1939: j1939_xtp_rx_dat_one(): fix rxtimer value between consecutive TP.DT to 750ms 2021-07-24 19:02:24 +02:00
ceph
core rtnetlink: Return correct error on changing device netns 2021-08-26 12:08:08 +01:00
dcb
dccp dccp: add do-while-0 stubs for dccp_pr_debug macros 2021-08-09 10:00:02 +01:00
decnet
dns_resolver
dsa net: switchdev: zero-initialize struct switchdev_notifier_fdb_info emitted by drivers towards the bridge 2021-08-10 13:22:57 -07:00
ethernet
ethtool
hsr
ieee802154 net: Fix memory leak in ieee802154_raw_deliver 2021-08-10 12:18:10 +02:00
ife
ipv4 net: fix NULL pointer reference in cipso_v4_doi_free 2021-08-26 12:20:47 +01:00
ipv6 ipv6: use siphash in rt6_exception_hash() 2021-08-26 10:20:34 +01:00
iucv
kcm
key
l2tp
l3mdev
lapb
llc net: llc: fix skb_over_panic 2021-07-27 13:05:56 +01:00
mac80211 mac80211: fix locking in ieee80211_restart_work() 2021-08-17 06:51:43 -07:00
mac802154
mpls
mptcp mptcp: full fully established support after ADD_ADDR 2021-08-19 12:16:54 +01:00
ncsi
netfilter netfilter: nfnetlink_hook: translate inet ingress to netdev 2021-08-06 17:07:41 +02:00
netlabel
netlink
netrom
nfc
nsh
openvswitch ovs: clear skb->tstamp in forwarding path 2021-08-18 11:31:13 +01:00
packet
phonet
psample
qrtr net: qrtr: fix another OOB Read in qrtr_endpoint_post 2021-08-20 14:41:03 +01:00
rds net/rds: dma_map_sg is entitled to merge entries 2021-08-18 15:35:50 -07:00
rfkill
rose
rxrpc
sched net/sched: ets: fix crash when flipping from 'strict' to 'quantum' 2021-08-25 11:15:30 +01:00
sctp sctp: move the active_key update after sh_keys is added 2021-08-03 11:43:43 +01:00
smc net/smc: Correct smc link connection counter in case of smc client 2021-08-09 10:46:59 +01:00
strparser
sunrpc
switchdev
tipc tipc: call tipc_wait_for_connect only when dlen is not 0 2021-08-16 11:20:56 +01:00
tls
unix af_unix: fix garbage collect vs MSG_PEEK 2021-07-28 10:18:00 -07:00
vmw_vsock vsock/virtio: avoid potential deadlock when vsock device remove 2021-08-12 10:57:27 -07:00
wireless cfg80211: Fix possible memory leak in function cfg80211_bss_update 2021-07-23 10:38:18 +02:00
x25
xdp
xfrm Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec 2021-08-04 10:45:41 +01:00
compat.c
devres.c
Kconfig
Makefile
socket.c
sysctl_net.c