From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796453220; b=K+OuPZGIxd1d6RzaJIiHnu8NUJ43p0i4ctOqCKe1BZAQnZzCIfKrtzBRlW/QeD1MzGrF Alc7hX0NQ4IOw2t1amO1kdXWXnOE/hEKuWd+s/oc7Mlyreg3dIjJGM1xzjFidY5svxxDr EyDyv++j8gijaSvGG10x0v2R8kIgKilHHEGWVvjT/8mOxdfSO5QrErRGn1/N3L5M8Ha8b Ky9C4MMdsBfAxl4uArI/SIDAU2Z5K1+9LhTd85RVJ0r/u0mANRDI+WVjRh7AxwjTWld6j aexjjAlKwMzBREwAbaF0/iPsKgbqK6kmqIOPq/OhbBIa35rs/mZyywNNwfSQ/lQHv8A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796453220; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=nNoQ/tqGVY37SrBrXr6NkpE5zIlVGZxV2wkOAxZl6C0=; b=4CtDxHQSSKBz9Dfld0BYGUcunhpPj381491fyopNC+mswNvI6Av8UXU1L/qKkQv3Cxit 7CvFOGVnUmvSOfUSTD2a6LH1/R1MJlGYHxjrko0eBFsNTwgR/9zNbq37rth/tTAy5woie qiGTpJg1VP2L/4i063JNUPLg6X52SARngk1zjp9QQs0T/boKbXhRXLdgLaWpcAT5QD5nD 8c+MfQamUWhbib7mOsNkKVwkN+3Y8Nxc4v4havy6DmoW1xyM+6xoMVuG5PbVsj0utd9qD lGcRSnL1abVfDBoeKzOV7BaKqqMUK2AAKpCht5oucljDLxT+TPN4m30lnkrxbhZ/Oyw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lNxcGjvI; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 157B0606A322 for ; Sat, 5 Dec 2026 06:46:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lNxcGjvI Received: by smtp.kernel.org (Postfix) with ESMTPSA id 967871F00936; Sat, 5 Dec 2026 06:46:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796453219; bh=nNoQ/tqGVY37SrBrXr6NkpE5zIlVGZxV2wkOAxZl6C0=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=lNxcGjvIy/E5X0sZTTITQekpUsdpPDamzjJWsCZDXJ5OT0zDe1j2otdAPZep5RxxE QOIPahaGW4KFTktGUlv7tFlvQgf52WN+SCfH7UjtL7mxBdIbAwJ86G6bw9Vs2XaMZa XeTLS+W1LwYYeZMxmRbJ+6VvQ/vhAajQQactFx0eXBesq93u3/dy8Hu+9o5xsDc1qE GzoM7S1Rb4fZSiqh1ewwqsNCAcx8WJeXV7Offqn+mKKQlK82mAPrytvSMA9jFNA4PQ sAH1Jfvfm0QkTBSXdhK40I1bmA6XFa8792Zl591SfZpx8gQSOBptFdZEv+/4P2y8W6 fnTplakeUahfA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 2/9] scsi: mpt3sas: do not keep an enclosure pointer across a host reset Reply-To: sashiko-reviews@lists.linux.dev To: "Praneeth Balasubramanian" Cc: linux-scsi@vger.kernel.org In-Reply-To: <20261205063229.2518424-3-praneethb2002@gmail.com> References: <20261205063229.2518424-1-praneethb2002@gmail.com> <20261205063229.2518424-3-praneethb2002@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 05 Dec 2026 06:46:59 +0000 X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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 > 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 readine= ss handling for slow devices") > Cc: stable@vger.kernel.org > Signed-off-by: Praneeth Balasubramanian [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. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261205063229.2518= 424-1-praneethb2002@gmail.com?part=3D2