From: Greg KH <gregkh@linuxfoundation.org>
To: Haotian Zhang <vulab@iscas.ac.cn>
Cc: stable@vger.kernel.org, sashal@kernel.org,
linux-block@vger.kernel.org, axboe@kernel.dk
Subject: Re: [PATCH 6.12 stable] pktcdvd: Handle bio_split() failure
Date: Tue, 30 Sep 2025 09:34:02 +0200 [thread overview]
Message-ID: <2025093056-good-profile-cbde@gregkh> (raw)
In-Reply-To: <20250930064850.1682-1-vulab@iscas.ac.cn>
On Tue, Sep 30, 2025 at 02:48:50PM +0800, Haotian Zhang wrote:
> The error return from bio_split() is not checked before
> being passed to bio_chain(), leading to a kernel panic
> from an invalid pointer dereference.
>
> Add a check with IS_ERR() to handle the allocation failure
> and prevent the crash.
>
> This patch fixes a bug in the pktcdvd driver, which was removed
> from the mainline kernel but still exists in stable branches.
>
> Fixes: 4b83e99ee7092 ("Revert "pktcdvd: remove driver."")
> Cc: stable@vger.kernel.org
> Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
> ---
> drivers/block/pktcdvd.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
> index 65b96c083b3c..c0999c3d167a 100644
> --- a/drivers/block/pktcdvd.c
> +++ b/drivers/block/pktcdvd.c
> @@ -2466,6 +2466,8 @@ static void pkt_submit_bio(struct bio *bio)
> split = bio_split(bio, last_zone -
> bio->bi_iter.bi_sector,
> GFP_NOIO, &pkt_bio_set);
> + if (IS_ERR(split))
> + goto end_io;
> bio_chain(split, bio);
> } else {
> split = bio;
> --
> 2.25.1
>
>
<formletter>
This is not the correct way to submit patches for inclusion in the
stable kernel tree. Please read:
https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.
</formletter>
prev parent reply other threads:[~2025-09-30 7:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-30 6:48 [PATCH 6.12 stable] pktcdvd: Handle bio_split() failure Haotian Zhang
2025-09-30 7:34 ` Greg KH [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=2025093056-good-profile-cbde@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
--cc=vulab@iscas.ac.cn \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.