public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Ming Lei <ming.lei@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Cheyenne Wills <cheyenne.wills@gmail.com>
Subject: Re: [PATCH] block: fix NULL pointer dereferenced within __blk_rq_map_sg
Date: Fri, 14 Feb 2025 15:10:10 +0100	[thread overview]
Message-ID: <20250214141010.GA24011@lst.de> (raw)
In-Reply-To: <20250214084638.58437-1-ming.lei@redhat.com>

On Fri, Feb 14, 2025 at 04:46:38PM +0800, Ming Lei wrote:
> Discard request may use special payload only and doesn't have bio
> attached, so the request iterator has to be initialized from valid
> req->bio, otherwise NULL pointer dereferenced is triggered.

So while the code changes here look good to me, the commit message is
wrong.  discard requests always have at least one bio attached, so we're
not going to hit this condition.  Discard requests also aren't even
handled by the function in Cheyenne's report.  I'm pretty sure this is
a flush request, as these are the only non-passthrough requests without
a bio.

> +	/* discard request may not have bio attached */
> +	if (iter.bio)
> +		iter.iter = iter.bio->bi_iter;

Same for the comment.


  reply	other threads:[~2025-02-14 14:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-14  8:46 [PATCH] block: fix NULL pointer dereferenced within __blk_rq_map_sg Ming Lei
2025-02-14 14:10 ` Christoph Hellwig [this message]
2025-02-17  3:11   ` Ming Lei

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=20250214141010.GA24011@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=cheyenne.wills@gmail.com \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    /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