android_kernel_motorola_sm6225/net
Zheng Wang c078fcd3f0 9p/xen : Fix use after free bug in xen_9pfs_front_remove due to race condition
[ Upstream commit ea4f1009408efb4989a0f139b70fb338e7f687d0 ]

In xen_9pfs_front_probe, it calls xen_9pfs_front_alloc_dataring
to init priv->rings and bound &ring->work with p9_xen_response.

When it calls xen_9pfs_front_event_handler to handle IRQ requests,
it will finally call schedule_work to start the work.

When we call xen_9pfs_front_remove to remove the driver, there
may be a sequence as follows:

Fix it by finishing the work before cleanup in xen_9pfs_front_free.

Note that, this bug is found by static analysis, which might be
false positive.

CPU0                  CPU1

                     |p9_xen_response
xen_9pfs_front_remove|
  xen_9pfs_front_free|
kfree(priv)          |
//free priv          |
                     |p9_tag_lookup
                     |//use priv->client

Fixes: 71ebd71921 ("xen/9pfs: connect to the backend")
Signed-off-by: Zheng Wang <zyytlz.wz@163.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Signed-off-by: Eric Van Hensbergen <ericvh@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-04-20 12:04:40 +02:00
..
6lowpan
9p 9p/xen : Fix use after free bug in xen_9pfs_front_remove due to race condition 2023-04-20 12:04:40 +02:00
802 mrp: introduce active flags to prevent UAF when applicant uninit 2023-01-18 11:30:36 +01:00
8021q
appletalk
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: Fix race condition in hidp_session_thread 2023-04-20 12:04:39 +02:00
bpf bpf, test_run: Fix alignment problem in bpf_prog_test_run_skb() 2022-11-25 17:40:29 +01:00
bpfilter
bridge netfilter: ebtables: fix memory leak when blob is malformed 2022-09-28 11:02:56 +02:00
caif net: caif: Fix use-after-free in cfusbl_device_notify() 2023-03-17 08:31:44 +01:00
can can: bcm: bcm_tx_setup(): fix KMSAN uninit-value in vfs_write 2023-04-05 11:15:40 +02:00
ceph
core net: don't let netpoll invoke NAPI if in xmit context 2023-04-20 12:04:38 +02:00
dcb
dccp dccp/tcp: Avoid negative sk_forward_alloc by ipv6_pinfo.pktoptions. 2023-02-22 12:47:21 +01:00
decnet
dns_resolver
dsa
ethernet
hsr net: hsr: Fix potential use-after-free 2022-12-08 11:18:33 +01:00
ieee802154 net: ieee802154: fix error return code in dgram_bind() 2022-11-03 23:52:30 +09:00
ife
ipv4 icmp: guard against too small mtu 2023-04-20 12:04:38 +02:00
ipv6 ipv6: Fix an uninit variable access bug in __ip6_make_skb() 2023-04-20 12:04:38 +02:00
iucv net/iucv: Fix size of interrupt data 2023-03-22 13:27:10 +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
llc llc: only change llc->dev when bind() succeeds 2022-03-28 08:41:44 +02:00
mac80211 wifi: mac80211: fix invalid drv_sta_pre_rcu_remove calls for non-uploaded sta 2023-04-20 12:04:38 +02:00
mac802154 mac802154: fix missing INIT_LIST_HEAD in ieee802154_if_add() 2022-12-14 11:28:28 +01:00
mpls net: mpls: fix stale pointer if allocation fails during device rename 2023-02-22 12:47:21 +01:00
ncsi
netfilter netfilter: ctnetlink: fix possible refcount leak in ctnetlink_create_conntrack() 2023-03-11 16:31:58 +01:00
netlabel
netlink netlink: annotate data races around sk_state 2023-02-06 07:49:43 +01:00
netrom netrom: Fix use-after-free caused by accept on already connected socket 2023-02-22 12:47:12 +01:00
nfc nfc: change order inside nfc_se_io error path 2023-03-17 08:31:42 +01:00
nsh
openvswitch net: openvswitch: fix flow memory leak in ovs_flow_cmd_new 2023-02-22 12:47:12 +01:00
packet packet: do not set TP_STATUS_CSUM_VALID on CHECKSUM_COMPLETE 2022-12-08 11:18:33 +01:00
phonet
psample
qrtr
rds rds: rds_rm_zerocopy_callback() correct order for list_add_tail() 2023-03-11 16:31:37 +01:00
rfkill
rose net/rose: Fix to not accept on connected socket 2023-02-22 12:47:19 +01:00
rxrpc rxrpc: Fix missing unlock in rxrpc_do_sendmsg() 2023-01-18 11:30:33 +01:00
sched net: sched: cbq: dont intepret cls results when asked to drop 2023-04-05 11:15:42 +02:00
sctp sctp: check send stream number after wait_for_sndbuf 2023-04-20 12:04:38 +02:00
smc net/smc: Remove redundant refcount increase 2022-09-15 12:17:03 +02:00
strparser
sunrpc SUNRPC: ensure the matching upcall is in-flight upon downcall 2023-01-18 11:30:49 +01:00
switchdev
tipc tipc: improve function tipc_wait_for_cond() 2023-03-17 08:31:44 +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 net: vmw_vsock: vmci: Check memcpy_from_msg() 2023-01-18 11:30:18 +01:00
wimax
wireless wifi: cfg80211: Partial revert "wifi: cfg80211: Fix use after free for wext" 2023-03-13 10:17:15 +01:00
x25 net/x25: Fix to not accept on connected socket 2023-02-22 12:47:12 +01:00
xdp
xfrm xfrm: Update ipcomp_scratches with NULL when freed 2022-10-26 13:19:37 +02:00
compat.c
Kconfig
Makefile
socket.c net: Fix a data-race around sysctl_somaxconn. 2022-09-05 10:26:31 +02:00
sysctl_net.c