Go to file
Lance Richardson d1c8a2a4f8 dma: fix call order in dmam_free_coherent
BugLink: https://bugs.launchpad.net/bugs/2078388

[ Upstream commit 28e8b7406d3a1f5329a03aa25a43aa28e087cb20 ]

dmam_free_coherent() frees a DMA allocation, which makes the
freed vaddr available for reuse, then calls devres_destroy()
to remove and free the data structure used to track the DMA
allocation. Between the two calls, it is possible for a
concurrent task to make an allocation with the same vaddr
and add it to the devres list.

If this happens, there will be two entries in the devres list
with the same vaddr and devres_destroy() can free the wrong
entry, triggering the WARN_ON() in dmam_match.

Fix by destroying the devres entry before freeing the DMA
allocation.

Tested:
  kokonut //net/encryption
    http://sponge2/b9145fe6-0f72-4325-ac2f-a84d81075b03

Fixes: 9ac7849e35 ("devres: device resource management")
Signed-off-by: Lance Richardson <rlance@google.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
2024-09-27 10:50:16 +02:00
Documentation ASoC: dt-bindings: rt5645: add cbj sleeve gpio property 2024-07-05 10:51:55 +02:00
LICENSES
arch um: time-travel: fix time-travel-start option 2024-09-27 10:50:16 +02:00
block block: prevent division by zero in blk_rq_stat_sum() 2024-06-07 15:01:41 +02:00
certs certs/blacklist_hashes.c: fix const confusion in certs blacklist 2022-08-26 11:10:49 +02:00
crypto crypto: ecrdsa - Fix module auto-load on add_key 2024-07-05 10:52:03 +02:00
debian UBUNTU: [Packaging] Remove fips-checks script 2024-03-28 15:18:45 +01:00
debian.master UBUNTU: Upstream stable to v5.4.281 2024-09-27 10:50:10 +02:00
drivers Bluetooth: btusb: Add Realtek RTL8852BE support ID 0x13d3:0x3591 2024-09-27 10:50:16 +02:00
fs jfs: Fix array-index-out-of-bounds in diFree 2024-09-27 10:50:16 +02:00
include m68k: amiga: Turn off Warp1260 interrupts during boot 2024-09-27 10:50:14 +02:00
init init: open /initrd.image with O_LARGEFILE 2024-06-07 15:01:40 +02:00
ipc ipc: replace costly bailout check in sysvipc_find_ipc() 2023-02-24 14:01:18 +01:00
kernel dma: fix call order in dmam_free_coherent 2024-09-27 10:50:16 +02:00
lib kobject_uevent: Fix OOB access within zap_modalias_env() 2024-09-27 10:50:15 +02:00
mm mm: swap: fix race between free_swap_and_cache() and swapoff() 2024-09-27 10:50:08 +02:00
net ipv6: take care of scope when choosing the src addr 2024-09-27 10:50:14 +02:00
samples media: rename VFL_TYPE_GRABBER to _VIDEO 2024-06-07 15:01:29 +02:00
scripts kconfig: remove wrong expr_trans_bool() 2024-09-27 10:50:08 +02:00
security ima: Fix use-after-free on a dentry's dname.name 2024-08-28 13:31:45 +02:00
sound ASoC: max98088: Check for clk_prepare_enable() error 2024-09-27 10:50:13 +02:00
tools libbpf: Fix no-args func prototype BTF dumping syntax 2024-09-27 10:50:16 +02:00
ubuntu
usr
virt KVM: async_pf: Cleanup kvm_setup_async_pf() 2024-06-07 15:01:45 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS iio: stx104: Move to addac subdirectory 2023-10-30 11:41:56 +01:00
Makefile Linux 5.4.281 2024-09-27 10:50:10 +02:00
README
Ubuntu.md
dropped.txt
snapcraft.yaml

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.