No description
Find a file
Daniel Stodden 1d83c85922 PCI: switchtec: Fix stdev_release() crash after surprise hot remove
[ Upstream commit df25461119 ]

A PCI device hot removal may occur while stdev->cdev is held open. The call
to stdev_release() then happens during close or exit, at a point way past
switchtec_pci_remove(). Otherwise the last ref would vanish with the
trailing put_device(), just before return.

At that later point in time, the devm cleanup has already removed the
stdev->mmio_mrpc mapping. Also, the stdev->pdev reference was not a counted
one. Therefore, in DMA mode, the iowrite32() in stdev_release() will cause
a fatal page fault, and the subsequent dma_free_coherent(), if reached,
would pass a stale &stdev->pdev->dev pointer.

Fix by moving MRPC DMA shutdown into switchtec_pci_remove(), after
stdev_kill(). Counting the stdev->pdev ref is now optional, but may prevent
future accidents.

Reproducible via the script at
https://lore.kernel.org/r/20231113212150.96410-1-dns@arista.com

Link: https://lore.kernel.org/r/20231122042316.91208-2-dns@arista.com
Signed-off-by: Daniel Stodden <dns@arista.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-02-05 20:12:58 +00:00
arch um: time-travel: fix time corruption 2024-02-05 20:12:57 +00:00
block block: prevent an integer overflow in bvec_try_merge_hw_page 2024-02-05 20:12:53 +00:00
certs certs: Fix build error when PKCS#11 URI contains semicolon 2023-02-09 11:28:11 +01:00
crypto crypto: api - Disallow identical driver names 2024-01-31 16:16:58 -08:00
Documentation ASoC: doc: Fix undefined SND_SOC_DAPM_NOPM argument 2024-02-05 20:12:54 +00:00
drivers PCI: switchtec: Fix stdev_release() crash after surprise hot remove 2024-02-05 20:12:58 +00:00
fs f2fs: fix to tag gcing flag on page during block migration 2024-02-05 20:12:56 +00:00
include PCI: add INTEL_HDA_ARL to pci_ids.h 2024-02-05 20:12:55 +00:00
init rootfs: Fix support for rootfstype= when root= is given 2024-01-25 15:27:43 -08:00
io_uring io_uring/rw: ensure io->bytes_done is always initialized 2024-01-25 15:27:41 -08:00
ipc
kernel bpf: Set uattr->batch.count as zero before batched update or deletion 2024-02-05 20:12:51 +00:00
lib debugobjects: Stop accessing objects after releasing hash bucket lock 2024-02-05 20:12:47 +00:00
LICENSES
mm mm: page_alloc: unreserve highatomic page blocks before oom 2024-01-31 16:17:03 -08:00
net bridge: cfm: fix enum typo in br_cc_ccm_tx_parse 2024-02-05 20:12:54 +00:00
rust rust: allocator: Prevent mis-aligned allocation 2023-08-11 12:08:18 +02:00
samples fprobe: Pass entry_data to handlers 2023-10-25 12:03:12 +02:00
scripts scripts/get_abi: fix source path leak 2024-01-31 16:17:01 -08:00
security lsm: new security_file_ioctl_compat() hook 2024-01-31 16:17:00 -08:00
sound ALSA: hda/conexant: Fix headset auto detect fail in cx8070 and SN6140 2024-02-05 20:12:57 +00:00
tools libbpf: Fix NULL pointer dereference in bpf_object__collect_prog_relos 2024-02-05 20:12:53 +00:00
usr
virt kvm/vfio: ensure kvg instance stays around in kvm_vfio_group_add() 2023-09-13 09:42:46 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS genirq/affinity: Move group_cpus_evenly() into lib/ 2024-01-10 17:10:33 +01:00
Makefile Linux 6.1.76 2024-01-31 16:17:12 -08:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.