From: Artem Dinaburg <artem@trailofbits.com>
To: stable@vger.kernel.org
Cc: axboe@kernel.dk, kbusch@kernel.org, kch@nvidia.com,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 6.6.y 2/2] blk-mq: reinsert cached request to the list
Date: Fri, 16 Oct 2026 14:47:53 -0400 [thread overview]
Message-ID: <20261016184753.27189-3-artem@trailofbits.com> (raw)
In-Reply-To: <20261016184753.27189-1-artem@trailofbits.com>
From: Keith Busch <kbusch@kernel.org>
[ Upstream commit b051bb6bf0a231117036aa607cadf55be8e63910 ]
A previous commit removed an optimization out of caution for a scenario
that turns out not to be real: all the "queue_exit" goto's are safe to
reinsert the request into the cached_rq's plug list as they are either
from a non-blocking path, or a successful merge that already holds the
queue reference. This optimization is most needed for small sequential
workloads that successfully merge into larger requests.
Fixes: dc278e9bf2b9 ("blk-mq: pop cached request if it is usable")
Suggested-by: Ming Lei <tom.leiming@gmail.com>
Suggested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Link: https://patch.msgid.link/20260526153531.2365935-1-kbusch@meta.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Assisted-by: LLM
[ Backport to 6.6.y: Reinsert with rq_list_add() on each of the three
target preparation or merge exits; the target has a single cached_rq
list and no shared queue_exit label. ]
Signed-off-by: Artem Dinaburg <artem@trailofbits.com>
---
Hi,
Please consider this backport of the corrective follow-up for
CVE-2026-64017 to 6.6.y.
The backport reinserts the cached request at each of the three older
preparation or merge exits. See the bracketed backport note above.
The complete fix is already present in 6.12.y, 6.18.y and 7.2.y.
Build-tested as part of a cumulative 6.6.y series on x86_64
(allmodconfig, CONFIG_WERROR=y).
Thanks,
Artem Dinaburg
block/blk-mq.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 1ad77737b27d3233489b4d9f690c9e6ab77d2130..e3fb9222c5ee00c1fa2105e1194d5f9eba831092 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -3024,16 +3024,16 @@ void blk_mq_submit_bio(struct bio *bio)
if (unlikely(bio_may_exceed_limits(bio, &q->limits))) {
bio = __bio_split_to_limits(bio, &q->limits, &nr_segs);
if (!bio) {
- blk_mq_free_request(rq);
+ rq_list_add(&plug->cached_rq, rq);
return;
}
}
if (!bio_integrity_prep(bio)) {
- blk_mq_free_request(rq);
+ rq_list_add(&plug->cached_rq, rq);
return;
}
if (blk_mq_attempt_bio_merge(q, bio, nr_segs)) {
- blk_mq_free_request(rq);
+ rq_list_add(&plug->cached_rq, rq);
return;
}
rq_qos_throttle(rq->q, bio);
prev parent reply other threads:[~2026-10-16 18:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 18:47 [PATCH 6.6.y 0/2] CVE-2026-64017: backport fix series Artem Dinaburg
2026-10-16 18:47 ` [PATCH 6.6.y 1/2] blk-mq: pop cached request if it is usable Artem Dinaburg
2026-10-16 18:47 ` Artem Dinaburg [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261016184753.27189-3-artem@trailofbits.com \
--to=artem@trailofbits.com \
--cc=axboe@kernel.dk \
--cc=kbusch@kernel.org \
--cc=kch@nvidia.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox