Linux USB
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH 1/7] usb: storage: ene_ub6250: fail MS init on card errors
Date: Tue, 27 Oct 2026 14:53:01 +0000	[thread overview]
Message-ID: <sashiko-outbox-186771@kernel.org> (raw)
In-Reply-To: <20261027-llm-usb-storage-v1-1-d1655e94ed10@linuxfoundation.org>

> From: Josef Bacik <josef@toxicpanda.com>
> 
> Inserting a Memory Stick that has no usable boot block, for example a
> blank or damaged card, into an ENE UB6250 reader oopses the kernel with
> a divide error on the first READ(10).
> 
> ene_ms_init() ignores the return value of ms_card_init().  When
> ms_card_init() finds no boot block it returns MS_STATUS_ERROR after
> ms_lib_free_allocatedarea() has cleared the card geometry and freed the
> logical maps, but MS_Status keeps the MS_Ready bit the reader reported,
> so ene_transport() goes on to dispatch commands to ms_scsi_irp().  The
> first READ(10) from the partition scan then reaches ms_scsi_read():
> 
>     logblk  = (u16)(bn / info->MS_Lib.PagesPerBlock);
> 
> with PagesPerBlock == 0.  With a non-zero PagesPerBlock the same path
> would dereference the freed (NULL) Log2PhyMap instead.
> 
> The bug was found by code inspection and has not been reproduced.
> 
> Fix by clearing MS_Ready and returning USB_STOR_TRANSPORT_ERROR from
> ene_ms_init() when ms_card_init() fails, as is already done when the
> reader reports that the card is not ready.
> 
> Fixes: 33842cedfc33 ("Staging: Merge ENE UB6250 MS card codes from keucr to drivers/usb/storage/ene_ub6250.c")
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261027-llm-usb-storage-v1-0-d1655e94ed10@linuxfoundation.org?part=1


  reply	other threads:[~2026-10-27 14:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27 14:40 [PATCH 0/7] usb: storage: some llm-found patches Greg Kroah-Hartman
2026-10-27 14:40 ` [PATCH 1/7] usb: storage: ene_ub6250: fail MS init on card errors Greg Kroah-Hartman
2026-10-27 14:53   ` sashiko-bot [this message]
2026-10-27 14:40 ` [PATCH 2/7] usb: storage: ene_ub6250: report boot block errors Greg Kroah-Hartman
2026-10-27 14:53   ` sashiko-bot
2026-10-27 14:40 ` [PATCH 3/7] usb: storage: ene_ub6250: fix write to unmapped MS block Greg Kroah-Hartman
2026-10-27 14:51   ` sashiko-bot
2026-10-27 14:40 ` [PATCH 4/7] usb: storage: ene_ub6250: bound the disabled block walk Greg Kroah-Hartman
2026-10-27 14:52   ` sashiko-bot
2026-10-27 14:40 ` [PATCH 5/7] usb: storage: sddr09: bound the unused PBA search Greg Kroah-Hartman
2026-10-27 14:50   ` sashiko-bot
2026-10-27 14:40 ` [PATCH 6/7] usb: storage: shuttle_usbat: fix READ CD divide by zero Greg Kroah-Hartman
2026-10-27 14:51   ` sashiko-bot
2026-10-27 14:40 ` [PATCH 7/7] usb: storage: shuttle_usbat: bound the READ chunk size Greg Kroah-Hartman
2026-10-27 14:48   ` sashiko-bot

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=sashiko-outbox-186771@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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