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=1796110811; b=BNCPJPvKj7HRvBXs8P+I0VeQzk5spFbDcqwrDxG2X9U02sEw/Jotj8vGulxV5SKvMDZo OqPxu0hH8+WsCJnGyNlgKBCHBTWzt6slV0griN170NoD4I7/niVbCiG0cnlQvhPfEaL6r /vYgFPadGIZBk1OQs4yfqf4SMRBitTPMy2Ybo6llGEEXELRmC0NHdUuI0gyC/uMgSIuiH P1QnVkvMb5IqOkn3AxvL4jRKe5O4dg+Lp/L6T72VrE5pVNOU89axJkp5/TBCWWF/xyH+2 nHX1Vr46azNUReFugVGs6zoGQrooFWQtyT3ZY5YM9TdCQ8wnQIUpDZuz9YYC6phywBg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796110811; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=BmTn1llSVUndYeCguZNsvV4F/HtIPfb7Hpp5PMAb1Ec=; b=HBYiee4c1jYuGFuHo9LLKCnvKkZqMEc5dpMfdR0Q7n7vzWDjFEMxffKeSP8i4+J+AG3u /AndgCYFBTbRghhfmAOY9f2Td9h9BwIXMxyp/L6P4P+v87uitun/7Dhd1IAM2NvLqJsQd 0nhbgqxjLRBVpDlb+Mt4mnmur9z758g76Ct3Pxy/JpliZGpNFNNAJ9hoCnIfNsH3UgBkZ K6ik4UGJrWDGQrpK7GKKcK1PF2v9J90Mlk9tL+SrbgeS7Dw61Hlu3eFMGeD1HWJ+fC639 IuERqQIDtc9GoSAWWo0PpoIxNdHU2gDZDE9s2Mi0QAl61v0a9RTy6N5ugmJ+QZ5bkfA== 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=DpkGETgU; 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 2693D606A330 for ; Tue, 1 Dec 2026 07:40:10 +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=DpkGETgU Received: by smtp.kernel.org (Postfix) with ESMTPSA id A58431F00899; Tue, 1 Dec 2026 07:40:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796110810; bh=BmTn1llSVUndYeCguZNsvV4F/HtIPfb7Hpp5PMAb1Ec=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=DpkGETgUtoRL0dMZRyv8/98Q40ulm5Ewgyn8UVJx5W6ShCYQoVBeG31n4NKRhjf/c 4ieL3ih28QJr8fvyZJzJOBl0eKLRsOdYLaSMMJGNqFUtfGfI90a38DjIIh//v60Gqs GNbaHB+7eHYvxLFFViKfW1sexmF2ZURKY2euzSXuL3jkTroxsB+ucDQOwkUT+fiavl IjSGXKZcppoMYa2HhTXd3dAbDr63VipmJz0sLqYe7S8WYdf41z9imuaeAlbJwKRxuz waH0nMQuUJT90eMHAIrttsvstogIqzZM17XuRPkIpaIjQyFs/s12wgtbUQ/j3nPi68 pdFzwzDU82PRQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v11 5/8] nvmem: layouts: add Microchip/SST SFDP EUI layout driver Reply-To: sashiko-reviews@lists.linux.dev To: "Manikandan Muralidharan" , pratyush@kernel.org, mwalle@kernel.org, takahiro.kuwano@infineon.com, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, srini@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, claudiu.beznea@tuxon.dev, linux@armlinux.org.uk, richardcochran@gmail.com, arnd@arndb.de, linusw@kernel.org, aaro.koskinen@iki.fi, enelsonmoore@gmail.com, pengpeng@iscas.ac.cn, mathieu.dubois-briand@bootlin.com, gregkh@linuxfoundation.org, michael@walle.cc, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org In-Reply-To: <784cd836a85d777f6e43653cda6524411cf78963.1796023049.git.manikandan.m@microchip.com> References: <784cd836a85d777f6e43653cda6524411cf78963.1796023049.git.manikandan.m@microchip.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 07:40:09 +0000 X-Mailing-List: devicetree@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: - [Medium] nvmem: layouts: missing table length check in sfdp_eui_find_vendor_table() -- commit 7782104c607bf7262ccb9481e36c42721570ab22 Author: Manikandan Muralidharan nvmem: layouts: add Microchip/SST SFDP EUI layout driver This commit adds an NVMEM layout driver that locates the Microchip/SST vendor SFDP parameter table at runtime and exposes its factory-programmed EUI-48 identifier as a "mac-address" NVMEM cell. > diff --git a/drivers/nvmem/layouts/sst26vf-sfdp-eui.c b/drivers/nvmem/lay= outs/sst26vf-sfdp-eui.c > new file mode 100644 > index 0000000000000..c4fdda35b64c1 > --- /dev/null > +++ b/drivers/nvmem/layouts/sst26vf-sfdp-eui.c > @@ -0,0 +1,158 @@ [ ... ] > +static int sfdp_eui_find_vendor_table(struct nvmem_device *nvmem, u32 *p= tp) > +{ > + struct sfdp_parameter_header ph; > + struct sfdp_header hdr; > + int nph, i, ret; > + > + ret =3D nvmem_device_read(nvmem, 0, sizeof(hdr), &hdr); > + if (ret < 0) > + return ret; > + > + if (get_unaligned_le32(hdr.signature) !=3D SFDP_SIGNATURE) > + return -EINVAL; > + > + nph =3D hdr.nph + 1; > + > + for (i =3D 0; i < nph; i++) { > + ret =3D nvmem_device_read(nvmem, sizeof(hdr) + i * sizeof(ph), > + sizeof(ph), &ph); > + if (ret < 0) > + return ret; > + > + if (SFDP_PARAM_HEADER_ID(&ph) !=3D SFDP_MCHP_VENDOR_ID) > + continue; > + > + *ptp =3D SFDP_PARAM_HEADER_PTP(&ph); > + return 0; > + } > + > + return -ENOENT; > +} [Severity: Medium] Should sfdp_eui_find_vendor_table() check that the vendor table length (ph.length * 4) is at least SFDP_MCHP_EUI48_OFFSET + ETH_ALEN? Standard non-EUI SST26VF064B flashes have a 0x01bf vendor parameter table with ph.length =3D 0x18 DWORDs (0x60 bytes), as seen in the sst26vf064b SFDP dump in Documentation/driver-api/mtd/spi-nor.rst. Without a length check, sfdp_eui_add_cells() reads base + SFDP_MCHP_EUI48_MARKER_OFFSET (0x60) past the end of the table, causing nvmem_device_read() to fail with -EINVAL (or read unrelated trailing SFDP data if another table follows) instead of returning 0 when no EUI-48 is present. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/cover.1796023049.gi= t.manikandan.m@microchip.com?part=3D5