Wei Yongjun
7410f4d122
mac802154: fix missing INIT_LIST_HEAD in ieee802154_if_add()
...
[ Upstream commit b3d72d3135d2ef68296c1ee174436efd65386f04 ]
Kernel fault injection test reports null-ptr-deref as follows:
BUG: kernel NULL pointer dereference, address: 0000000000000008
RIP: 0010:cfg802154_netdev_notifier_call+0x120/0x310 include/linux/list.h:114
Call Trace:
<TASK>
raw_notifier_call_chain+0x6d/0xa0 kernel/notifier.c:87
call_netdevice_notifiers_info+0x6e/0xc0 net/core/dev.c:1944
unregister_netdevice_many_notify+0x60d/0xcb0 net/core/dev.c:1982
unregister_netdevice_queue+0x154/0x1a0 net/core/dev.c:10879
register_netdevice+0x9a8/0xb90 net/core/dev.c:10083
ieee802154_if_add+0x6ed/0x7e0 net/mac802154/iface.c:659
ieee802154_register_hw+0x29c/0x330 net/mac802154/main.c:229
mcr20a_probe+0xaaa/0xcb1 drivers/net/ieee802154/mcr20a.c:1316
ieee802154_if_add() allocates wpan_dev as netdev's private data, but not
init the list in struct wpan_dev. cfg802154_netdev_notifier_call() manage
the list when device register/unregister, and may lead to null-ptr-deref.
Use INIT_LIST_HEAD() on it to initialize it correctly.
Fixes: fcf39e6e88 ("ieee802154: add wpan_dev_list")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Alexander Aring <aahringo@redhat.com>
Link: https://lore.kernel.org/r/20221130091705.1831140-1-weiyongjun@huaweicloud.com
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-14 11:24:34 +01:00
..
6lowpan
6lowpan: Off by one handling ->nexthdr
2020-01-29 10:24:22 +01:00
9p
net/9p: Fix a potential socket leak in p9_socket_open
2022-12-08 11:15:41 +01:00
802
net/802/garp: fix memleak in garp_request_join()
2021-08-04 11:58:02 +02:00
8021q
vlan: fix memory leak in vlan_dev_set_egress_priority
2020-01-12 11:24:27 +01:00
appletalk
appletalk: Fix skb allocation size in loopback case
2021-04-07 12:05:39 +02:00
atm
net/atm: fix proc_mpc_write incorrect return value
2022-11-03 23:49:15 +09:00
ax25
ax25: Fix NULL pointer dereference in ax25_kill_by_device
2022-03-16 12:49:00 +01:00
batman-adv
batman-adv: Don't expect inter-netns unique iflink indices
2022-03-16 12:49:01 +01:00
bluetooth
Bluetooth: 6LoWPAN: add missing hci_dev_put() in get_l2cap_conn()
2022-12-14 11:24:34 +01:00
bridge
netfilter: br_netfilter: Drop dst references before setting.
2022-09-15 12:39:46 +02:00
caif
net: caif: fix double disconnect client in chnl_net_open()
2022-11-25 17:35:39 +01:00
can
can: bcm: check the result of can_send() in bcm_can_tx()
2022-10-26 13:15:46 +02:00
ceph
libceph: clear con->out_msg on Policy::stateful_server faults
2020-11-10 10:23:59 +01:00
core
net: gso: fix panic on frag_list with mixed head alloc types
2022-11-25 17:35:35 +01:00
dcb
net: dcb: disable softirqs in dcbnl_flush_dev()
2022-03-08 19:00:59 +01:00
dccp
dccp: don't duplicate ccid when cloning dccp sock
2021-09-22 11:43:09 +02:00
decnet
net: decnet: Fix sleeping inside in af_decnet
2021-07-28 09:14:27 +02:00
dns_resolver
KEYS: DNS: fix parsing multiple options
2018-07-22 14:27:39 +02:00
dsa
net: dsa: tag_brcm: Fix skb->fwd_offload_mark location
2020-04-13 10:32:53 +02:00
ethernet
net: add annotations on hh->hh_len lockless accesses
2020-01-12 11:24:19 +01:00
hsr
net: hsr: Fix potential use-after-free
2022-12-08 11:15:41 +01:00
ieee802154
net: ieee802154: fix error return code in dgram_bind()
2022-11-03 23:49:17 +09:00
ipv4
tcp: configurable source port perturb table size
2022-12-08 11:15:40 +01:00
ipv6
tcp/udp: Fix memory leak in ipv6_renew_options().
2022-12-08 11:15:42 +01:00
ipx
ipx: call ipxitf_put() in ioctl error path
2017-05-25 15:44:41 +02:00
irda
irda: Only insert new objects into the global database via setsockopt
2018-09-15 09:43:01 +02:00
iucv
net/af_iucv: set correct sk_protocol for child sockets
2020-12-11 13:37:56 +01:00
kcm
kcm: avoid potential race in kcm_tx_work
2022-11-25 17:35:42 +01:00
key
af_key: Fix send_acquire race with pfkey_register
2022-12-08 11:15:39 +01:00
l2tp
l2tp: fix race in pppol2tp_release with session object destroy
2022-06-25 11:45:19 +02:00
l3mdev
lapb
net: lapb: Copy the skb before sending a packet
2021-02-10 09:09:25 +01:00
llc
llc: only change llc->dev when bind() succeeds
2022-03-28 08:06:06 +02:00
mac80211
wifi: mac80211: Fix ack frame idr leak when mesh has no route
2022-12-08 11:15:39 +01:00
mac802154
mac802154: fix missing INIT_LIST_HEAD in ieee802154_if_add()
2022-12-14 11:24:34 +01:00
mpls
net: avoid infinite loop in mpls_gso_segment when mpls_hlen == 0
2021-03-17 16:10:13 +01:00
ncsi
net/ncsi: Use real net-device for response handler
2021-01-12 19:49:01 +01:00
netfilter
ipvs: use explicitly signed chars
2022-11-10 15:46:05 +01:00
netlabel
cipso,calipso: resolve a number of problems with the DOI refcounts
2022-01-27 08:47:42 +01:00
netlink
netlink: do not reset transport header in netlink_recvmsg()
2022-05-18 09:15:43 +02:00
netrom
netrom: Decrease sock refcount when sock timers expire
2021-07-28 09:14:27 +02:00
nfc
NFC: nci: fix memory leak in nci_rx_data_packet()
2022-12-08 11:15:39 +01:00
openvswitch
openvswitch: switch from WARN to pr_warn
2022-11-03 23:49:19 +09:00
packet
packet: do not set TP_STATUS_CSUM_VALID on CHECKSUM_COMPLETE
2022-12-08 11:15:41 +01:00
phonet
phonet: refcount leak in pep_sock_accep
2022-01-11 13:38:12 +01:00
qrtr
net: qrtr: fix a kernel-infoleak in qrtr_recvmsg()
2021-03-30 14:41:42 +02:00
rds
net: rds: don't hold sock lock when cancelling work from rds_tcp_reset_callbacks()
2022-10-26 13:15:40 +02:00
rfkill
rfkill: Fix incorrect check to avoid NULL pointer dereference
2020-01-12 11:24:23 +01:00
rose
rose: Fix NULL pointer dereference in rose_send_frame()
2022-11-10 15:46:05 +01:00
rxrpc
rxrpc: Don't try to resend the request if we're receiving the reply
2022-06-14 16:52:33 +02:00
sched
net: sched: Fix use after free in red_enqueue()
2022-11-10 15:46:05 +01:00
sctp
sctp: read sk->sk_bound_dev_if once in sctp_rcv()
2022-06-14 16:52:32 +02:00
strparser
strparser: Fix incorrect strp->need_bytes value.
2018-04-29 11:32:02 +02:00
sunrpc
SUNRPC: use _bh spinlocking on ->transport_lock
2022-09-15 12:39:46 +02:00
switchdev
switchdev: Execute bridge ndos only for bridge ports
2016-10-19 10:58:04 -04:00
tipc
tipc: fix the msg->req tlv len check in tipc_nl_compat_name_table_dump_header
2022-11-25 17:35:36 +01:00
unix
af_unix: annote lockless accesses to unix_tot_inflight & gc_in_progress
2022-01-27 08:47:41 +01:00
vmw_vsock
vsock: Fix memory leak in vsock_connect()
2022-08-25 11:09:29 +02:00
wimax
wireless
wifi: cfg80211: debugfs: fix return type in ht40allow_map_read()
2022-09-15 12:39:44 +02:00
x25
net/x25: Fix skb leak in x25_lapb_receive_frame()
2022-11-25 17:35:40 +01:00
xfrm
xfrm: Update ipcomp_scratches with NULL when freed
2022-10-26 13:15:45 +02:00
compat.c
net: Return the correct errno code
2021-06-30 08:49:12 -04:00
Kconfig
Makefile
net: split out functions related to registering inflight socket files
2021-08-04 11:58:01 +02:00
socket.c
net: Fix a data-race around sysctl_somaxconn.
2022-09-05 10:23:55 +02:00
sysctl_net.c