Linux-HyperV List
 help / color / mirror / Atom feed
From: "Srivatsa S. Bhat" <srivatsa@csail.mit.edu>
To: Keith Busch <kbusch@kernel.org>
Cc: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>,
	Jens Axboe <axboe@kernel.dk>, Daniel Wagner <dwagner@suse.de>,
	Christoph Hellwig <hch@lst.de>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-hyperv@vger.kernel.org
Subject: Re: [PATCH] block: Fix NULL pointer dereference in blk_mq_complete_request_remote
Date: Thu, 19 Nov 2026 08:59:08 +0530	[thread overview]
Message-ID: <av5tBNfe4TWqywzS@csail.mit.edu> (raw)
In-Reply-To: <av4b9EN8n9t0jjeC@kbusch-mbp>

On Wed, Nov 18, 2026 at 02:43:16PM -0700, Keith Busch wrote:
> On Wed, Nov 18, 2026 at 03:53:31PM -0500, Hamza Mahfooz wrote:
> > On Thu, Nov 19, 2026 at 12:58:44AM +0530, Srivatsa S. Bhat (Microsoft) wrote:
> > > Add NULL pointer validation in blk_mq_complete_request_remote() to
> > > prevent kernel crashes when block drivers pass freed request structures.
> > > 
> > 
> > This looks a lot like a driver bug, so it's probably best to hunt that
> > down instead of trying to work around it here.
> 
> It would be better to go another level lower and fix the broken
> hardware. The "bug" is describing device behavior too far outside
> protocol to be usable.

Ah, I see. It was actually a firmware bug and it was root-caused and
fixed already, and that's why I'm not able to reproduce the crash
anymore (as it is not that straight-forward for me to revert back to
the buggy firmware environment).

Thank you Hamza and Keith for the feedback - I can now see where the
pushback is coming from. My bad, I should've been clearer about the
firmware fix -- without that clarification about the firmware bug being
fixed, I can totally see why this sounds like adding a workaround in
the kernel instead. I did add a note in the patch notes saying I'm not
able to repro the crash anymore, but I should've been clearer as to
*why* that's the case and not leave it as a mystery :-)

My motivation for this patch was to reduce the severity of the impact,
should a similar underlying hardware/firmware bug occur in the future
for any other platform. Instead of causing a kernel panic and bringing
down the entire system, I was hoping that the NULL check could help
isolate it down to just failed I/O operations (along with a warning to
help with investigation).

But the sashiko review also seems to be hinting that such a NULL check
is insufficient and won't be race-free, even if we wanted to go down
that route of isolating the fault than panicking the kernel. (I had
also noted down my own question and uncertainty about the rq->state
management in the patch notes).

So, my takeaway from this discussion is that this is probably best
left as is in the kernel, since it complicates blk-mq recovery (a
simple NULL check being insufficient), and instead rely on the
firmware/hardware working correctly for this scenario.

Thank you!

Regards,
Srivatsa

      reply	other threads:[~2026-11-19  3:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 19:28 [PATCH] block: Fix NULL pointer dereference in blk_mq_complete_request_remote Srivatsa S. Bhat (Microsoft)
2026-11-18 19:57 ` sashiko-bot
2026-11-18 20:12 ` Jens Axboe
2026-11-19  3:34   ` Srivatsa S. Bhat
2026-11-18 20:53 ` Hamza Mahfooz
2026-11-18 21:43   ` Keith Busch
2026-11-19  3:29     ` Srivatsa S. Bhat [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=av5tBNfe4TWqywzS@csail.mit.edu \
    --to=srivatsa@csail.mit.edu \
    --cc=axboe@kernel.dk \
    --cc=dwagner@suse.de \
    --cc=hamzamahfooz@linux.microsoft.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@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