All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Praneeth Balasubramanian" <praneethb2002@gmail.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH 2/9] scsi: mpt3sas: do not keep an enclosure pointer across a host reset
Date: Sat, 05 Dec 2026 06:46:59 +0000	[thread overview]
Message-ID: <sashiko-outbox-251142@kernel.org> (raw)
In-Reply-To: <20261205063229.2518424-3-praneethb2002@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] scsi: mpt3sas: Fixes trailer cites aee682fad6cd instead of
  22a923c315ba
--

commit 4b0033d89be99f03cc72d6f76160b70f295c2761
Author: Praneeth Balasubramanian <praneethb2002@gmail.com>

> scsi: mpt3sas: do not keep an enclosure pointer across a host reset
>
> _scsih_add_device() looks up the enclosure node of the new device and
> keeps the pointer. Later it reads the node again: in the "device not
> ready" message after _scsih_wait_for_target_to_become_ready(), and when
> it fills in the enclosure logical ID and chassis slot of the new
> sas_device. In between, it sleeps in the readiness wait, in kzalloc()
> and in the config page request of _scsih_get_sas_address().
>
> A host reset frees every enclosure node and builds the list again in
> _scsih_create_enclosure_list_after_reset(). The reset can be issued by
> the readiness wait itself, when a SCSI command and then the target
> reset for it time out. It can also come from another context, such as
> the fault watchdog. _scsih_fw_event_cleanup_queue() does not wait for
> the running firmware event, so _scsih_add_device() keeps running and
> then reads freed memory.
>
> Copy the enclosure logical ID and chassis slot right after the lookup
> and use the copies later, as _scsih_pcie_add_device() does by reading
> them at lookup time.
>
> This was found by an LLM-based audit that checks code against the rules
> stated in kernel comments.
>
> Fixes: aee682fad6cd ("scsi: mpt3sas: Improve device discovery and readiness handling for slow devices")
> Cc: stable@vger.kernel.org
> Signed-off-by: Praneeth Balasubramanian <praneethb2002@gmail.com>

[Severity: Low]
Should the Fixes tag cite 22a923c315ba ("scsi: mpt3sas: Cache enclosure
pages during enclosure add.") instead of, or in addition to, aee682fad6cd
("scsi: mpt3sas: Improve device discovery and readiness handling for slow
devices")?

That earlier commit kept enclosure_dev across _scsih_get_sas_address(),
where mpt3sas_config_get_sas_device_pg0() -> _config_request() can call
mpt3sas_base_hard_reset_handler() and free ioc->enclosure_list while
_scsih_add_device() logs the error and still dereferences enclosure_dev.

Citing only the later commit causes stable backport tracking to miss older
stable kernels.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261205063229.2518424-1-praneethb2002@gmail.com?part=2

  reply	other threads:[~2026-12-05  6:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-05  6:32 [PATCH 0/9] scsi: fix missing locking and dump length checks in several drivers Praneeth Balasubramanian
2026-12-05  6:32 ` [PATCH 1/9] scsi: bnx2i: Hold the session back_lock around iscsi_itt_to_task() Praneeth Balasubramanian
2026-12-05  6:32 ` [PATCH 2/9] scsi: mpt3sas: do not keep an enclosure pointer across a host reset Praneeth Balasubramanian
2026-12-05  6:46   ` sashiko-bot [this message]
2026-12-05  6:32 ` [PATCH 3/9] scsi: pmcraid: Take host_lock around scsi_report_bus_reset() Praneeth Balasubramanian
2026-12-05  6:43   ` sashiko-bot
2026-12-05  8:20     ` Praneeth Balasubramanian
2026-12-05  6:32 ` [PATCH 4/9] scsi: ipr: Skip dump entries whose length is not a 4 byte multiple Praneeth Balasubramanian
2026-12-05  6:32 ` [PATCH 5/9] scsi: arm: Fix eh_abort race against the interrupt handler Praneeth Balasubramanian
2026-12-05  6:50   ` sashiko-bot
2026-12-05  8:20     ` Praneeth Balasubramanian
2026-12-05  6:32 ` [PATCH 6/9] scsi: csiostor: hold hw lock when issuing port stats mailbox command Praneeth Balasubramanian
2026-12-05  6:47   ` sashiko-bot
2026-12-05  8:20     ` Praneeth Balasubramanian
2026-12-05  6:32 ` [PATCH 7/9] scsi: fnic: Hold fnic_lock for the oxid calls in the FIP timer work Praneeth Balasubramanian
2026-12-05  6:32 ` [PATCH 8/9] scsi: qla2xxx: Hold qp_lock when completing command in abort timeout Praneeth Balasubramanian
2026-12-05  6:58   ` sashiko-bot
2026-12-05  6:32 ` [PATCH 9/9] scsi: target: core: Fix PRgeneration race in REGISTER AND MOVE Praneeth Balasubramanian
2026-12-05  6:56   ` 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-251142@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=praneethb2002@gmail.com \
    --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 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.