From: Jens Axboe <axboe@kernel.dk>
To: ming.lei@redhat.com, Mehul Rao <mehulrao@gmail.com>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] ublk: fix NULL pointer dereference in ublk_ctrl_set_size()
Date: Fri, 06 Mar 2026 04:26:01 -0700 [thread overview]
Message-ID: <177279636192.680057.1248751372115881016.b4-ty@kernel.dk> (raw)
In-Reply-To: <20260305193146.304526-1-mehulrao@gmail.com>
On Thu, 05 Mar 2026 14:31:46 -0500, Mehul Rao wrote:
> ublk_ctrl_set_size() unconditionally dereferences ub->ub_disk via
> set_capacity_and_notify() without checking if it is NULL.
>
> ub->ub_disk is NULL before UBLK_CMD_START_DEV completes (it is only
> assigned in ublk_ctrl_start_dev()) and after UBLK_CMD_STOP_DEV runs
> (ublk_detach_disk() sets it to NULL). Since the UBLK_CMD_UPDATE_SIZE
> handler performs no state validation, a user can trigger a NULL pointer
> dereference by sending UPDATE_SIZE to a device that has been added but
> not yet started, or one that has been stopped.
>
> [...]
Applied, thanks!
[1/1] ublk: fix NULL pointer dereference in ublk_ctrl_set_size()
commit: 25966fc097691e5c925ad080f64a2f19c5fd940a
Best regards,
--
Jens Axboe
prev parent reply other threads:[~2026-03-06 11:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-05 19:31 Mehul Rao
2026-03-06 3:17 ` Ming Lei
2026-03-06 11:26 ` Jens Axboe [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=177279636192.680057.1248751372115881016.b4-ty@kernel.dk \
--to=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mehulrao@gmail.com \
--cc=ming.lei@redhat.com \
--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
all inboxes | Powered by JetHome®