OpenCloudOS-Kernel/samples
Jason Gunthorpe 3689c75e50 vfio/mbochs: Fix close when multiple device FDs are open
commit 3cb2482714 upstream.

mbochs_close() iterates over global device state and frees it. Currently
this is done every time a device FD is closed, but if multiple device FDs
are open this could corrupt other still active FDs.

Change this to use close_device() so it only runs on the last close.

Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/11-v4-9ea22c5e6afb+1adf-vfio_reflck_jgg@nvidia.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Chen Zhuo <sagazchen@tencent.com>
Signed-off-by: Xinghui Li <korantli@tencent.com>
2024-06-11 21:15:41 +08:00
..
auxdisplay auxdisplay: Fix a typo in cfag12864b-example.c 2019-08-08 20:00:18 +02:00
binderfs treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
bpf ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
configfs treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 145 2019-05-30 11:25:18 -07:00
connector treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
hidraw HID: samples/hidraw: fix typo in printed message 2018-11-21 00:31:58 +01:00
hw_breakpoint treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
kdb treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
kfifo ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
kobject treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
kprobes treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
livepatch treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
mei samples: mei: use /dev/mei0 instead of /dev/mei 2019-01-30 15:24:45 +01:00
mic/mpssd ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
pidfd samples: make pidfd-metadata fail gracefully on older kernels 2019-06-24 15:55:50 +02:00
pktgen tkernel: add base tlinux kernel interfaces 2024-06-11 20:09:33 +08:00
qmi treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
rpmsg samples/rpmsg: Introduce a module parameter for message count 2019-08-26 22:10:39 -07:00
seccomp tkernel: add base tlinux kernel interfaces 2024-06-11 20:09:33 +08:00
timers License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_events sched/core: Provide a pointer to the valid CPU mask 2019-06-03 11:49:37 +02:00
trace_printk tkernel: add base tlinux kernel interfaces 2024-06-11 20:09:33 +08:00
uhid treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
v4l media: v4l2-pci-skeleton.c: fix doc warning 2019-05-28 13:14:28 -04:00
vfio-mdev vfio/mbochs: Fix close when multiple device FDs are open 2024-06-11 21:15:41 +08:00
vfs ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
watchdog License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig vfio/mdev: Remove CONFIG_VFIO_MDEV_DEVICE 2024-06-11 21:15:31 +08:00
Makefile kbuild: add CONFIG_HEADERS_INSTALL and loosen the dependency of samples 2019-06-15 19:57:01 +09:00