Go to file
Yu Kuai 76c6babc71 blk-throttle: fix throtl_data leak during disk release
[ Upstream commit 336aec7b06 ]

Tightening the throttle activation check in blk_throtl_activated() to
require both q->td presence and policy bit set introduced a memory leak
during disk release:

blkg_destroy_all() clears the policy bit first during queue deactivation,
causing subsequent blk_throtl_exit() to skip throtl_data cleanup when
blk_throtl_activated() fails policy check.

Idealy we should avoid modifying blk_throtl_exit() activation check because
it's intuitive that blk-throtl start from blk_throtl_init() and end in
blk_throtl_exit(). However, call blk_throtl_exit() before
blkg_destroy_all() will make a long term deadlock problem easier to
trigger[1], hence fix this problem by checking if q->td is NULL from
blk_throtl_exit(), and remove policy deactivation as well since it's
useless.

[1] https://lore.kernel.org/all/CAHj4cs9p9H5yx+ywsb3CMUdbqGPhM+8tuBvhW=9ADiCjAqza9w@mail.gmail.com/#t

Fixes: bd9fd5be6b ("blk-throttle: fix access race during throttle policy activation")
Reported-by: Yi Zhang <yi.zhang@redhat.com>
Closes: https://lore.kernel.org/all/CAHj4cs-p-ZwBEKigBj7T6hQCOo-H68-kVwCrV6ZvRovrr9Z+HA@mail.gmail.com/
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-10-15 12:03:34 +02:00
arch riscv, bpf: Sign extend struct ops return values properly 2025-10-15 12:03:33 +02:00
block blk-throttle: fix throtl_data leak during disk release 2025-10-15 12:03:34 +02:00
certs sign-file,extract-cert: use pkcs11 provider for OPENSSL MAJOR >= 3 2024-09-20 19:52:48 +03:00
crypto crypto: rng - Ensure set_ent is always present 2025-10-12 13:01:57 +02:00
Documentation dt-bindings: vendor-prefixes: Add undocumented vendor prefixes 2025-10-15 12:03:23 +02:00
drivers i3c: master: svc: Recycle unused IBI slot 2025-10-15 12:03:33 +02:00
fs btrfs: fix symbolic link reading when bs > ps 2025-10-15 12:03:18 +02:00
include ACPICA: Apply ACPI_NONSTRING 2025-10-15 12:03:33 +02:00
init Fix CC_HAS_ASM_GOTO_OUTPUT on non-x86 architectures 2025-10-15 12:03:13 +02:00
io_uring io_uring-6.17-20250919 2025-09-19 12:10:49 -07:00
ipc vfs-6.17-rc1.mmap_prepare 2025-07-28 13:43:25 -07:00
kernel tick: Do not set device to detached state in tick_shutdown() 2025-10-15 12:03:26 +02:00
lib vdso/datastore: Gate time data behind CONFIG_GENERIC_GETTIMEOFDAY 2025-10-15 12:03:24 +02:00
LICENSES LICENSES: Replace the obsolete address of the FSF in the GFDL-1.2 2025-07-24 11:15:39 +02:00
mm mm: swap: check for stable address space before operating on the VMA 2025-10-06 11:20:05 +02:00
net net/9p: fix double req put in p9_fd_cancelled 2025-10-12 13:01:57 +02:00
rust rust: cpumask: Mark CpumaskVar as transparent 2025-10-15 12:03:19 +02:00
samples 15 hotfixes. 11 are cc:stable and the remainder address post-6.16 issues 2025-09-17 21:34:26 -07:00
scripts scripts/misc-check: update export checks for EXPORT_SYMBOL_FOR_MODULES() 2025-10-15 12:03:22 +02:00
security lsm: CONFIG_LSM can depend on CONFIG_SECURITY 2025-10-15 12:03:17 +02:00
sound ASoC: qcom: audioreach: fix potential null pointer dereference 2025-10-06 11:20:06 +02:00
tools selftests/kselftest_harness: Add harness-selftest.expected to TEST_FILES 2025-10-15 12:03:34 +02:00
usr usr/include: openrisc: don't HDRTEST bpf_perf_event.h 2025-05-12 15:03:17 +09:00
virt Merge tag 'kvm-x86-no_assignment-6.17' of https://github.com/kvm-x86/linux into HEAD 2025-07-29 08:36:42 -04:00
.clang-format Linux 6.15-rc5 2025-05-06 16:39:25 +10:00
.clippy.toml rust: clean Rust 1.88.0's warning about clippy::disallowed_macros configuration 2025-05-07 00:11:47 +02:00
.cocciconfig
.editorconfig
.get_maintainer.ignore MAINTAINERS: remove Alyssa Rosenzweig 2025-09-18 21:17:31 +02:00
.gitattributes
.gitignore gitignore: allow .pylintrc to be tracked 2025-07-02 17:10:04 -06:00
.mailmap 7 hotfixes. 4 are cc:stable and the remainder address post-6.16 issues or 2025-09-28 09:32:00 -07:00
.pylintrc docs: add a .pylintrc file with sys path for docs scripts 2025-04-09 12:10:33 -06:00
.rustfmt.toml
COPYING
CREDITS MAINTAINERS: retire Boris from TLS maintainers 2025-08-26 17:36:01 -07:00
Kbuild drm: ensure drm headers are self-contained and pass kernel-doc 2025-02-12 10:44:43 +02:00
Kconfig io_uring: Rename KConfig to Kconfig 2025-02-19 14:53:27 -07:00
MAINTAINERS i2c-for-6.17-rc8 2025-09-28 13:19:23 -07:00
Makefile Linux 6.17.2 2025-10-12 13:01:58 +02: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 reStructuredText 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.