mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Riyan Dhiman <riyandhiman14@gmail.com>, axboe@kernel.dk
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] block: fix potential invalid pointer dereference in blk_add_partition
Date: Mon, 9 Sep 2024 09:56:06 -0700	[thread overview]
Message-ID: <2f13ac77-55e0-408d-96fe-b91d3c860106@acm.org> (raw)
In-Reply-To: <20240908171036.71874-1-riyandhiman14@gmail.com>

On 9/8/24 10:10 AM, Riyan Dhiman wrote:
> The blk_add_partition() function initially used a single if-condition
> (IS_ERR(part)) to check for errors when adding a partition. This was
> modified to handle the specific case of -ENXIO separately, allowing the
> function to proceed without logging the error in this case. However,
> this change unintentionally left a path where md_autodetect_dev()
> could be called without confirming that part is a valid pointer.
> 
> This commit separates the error handling logic by splitting the
> initial if-condition, improving code readability and handling specific
> error scenarios explicitly. The function now distinguishes the general
> error case from -ENXIO without altering the existing behavior of
> md_autodetect_dev() calls.
> 
> Fixes: b72053072c0b (block: allow partitions on host aware zone devices)
> 
> Signed-off-by: Riyan Dhiman <riyandhiman14@gmail.com>

No blank line between the Fixes: and Signed-off-by: tags please.
Additionally, please Cc the author of a patch when posting a fix for a
patch.

Thanks,

Bart.


      reply	other threads:[~2024-09-09 16:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-08 17:10 Riyan Dhiman
2024-09-09 16:56 ` Bart Van Assche [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=2f13ac77-55e0-408d-96fe-b91d3c860106@acm.org \
    --to=bvanassche@acm.org \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riyandhiman14@gmail.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

all inboxes | Powered by JetHome®