android_kernel_motorola_sm6375/net/9p
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Zheng Wang fcd084e199 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 <[email protected]>
Reviewed-by: Michal Swiatkowski <[email protected]>
Signed-off-by: Eric Van Hensbergen <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2023-04-20 12:07:36 +02:00
..
client.c net/9p: Initialize the iounit field during fid creation 2022-08-25 11:18:17 +02:00
error.c
Kconfig
Makefile
mod.c
protocol.c
protocol.h
trans_common.c
trans_common.h
trans_fd.c 9p/fd: Use P9_HDRSZ for header size 2022-12-14 11:30:41 +01:00
trans_rdma.c 9p/rdma: unmap receive dma buffer in rdma_request()/post_recv() 2023-03-11 16:44:12 +01:00
trans_virtio.c 9p/trans_virtio: Remove sysfs file on probe failure 2021-09-26 14:07:08 +02:00
trans_xen.c 9p/xen : Fix use after free bug in xen_9pfs_front_remove due to race condition 2023-04-20 12:07:36 +02:00