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=1796366589; b=VhxRrLT85eFyZVWKuXDP08q56dFnJWa9Up1oYke2hWZzyMerMB3TR6MvfJwD4SWQOOd3 1pG+jCaQMbDsxznSdjA+0BZP66fVimvgNtRqviKweO4J76yZyi8bIpi+cM9vh0GC/YtHW KbBln/CQYWPi6XCxl25N7svRpzAqe19aFU7kb4bdm9KgRDUuA2Ww6+jfyHA72Ke/Ney7J 9z6eS4/toVC+6/VOzYNHtDRUH0m418nxp+1bIpaJpBkpafHP6F15PXVD7VSULkteIKcv0 XsAdmIJyev2uRZZtfIohT0QfkPQ4aU3UE4/DJfNGRa+wQPVRmAMpjI0G9ruUVFsIXMw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796366589; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=ZZOMF9n5tS88Jthx8YMMMEbXTFiRSYEBLkA79w4sNUc=; b=fLNZtAd53FGryFNMCc7IB6r0FNTRPpXZ3shyv+RJuaSfaPUBi+jPpXGWFh/N4GgsdGBK M1nL7BvDeFY591RX/jpNLth8ahcwzsmAshk+CGfcEcJ8g6UR1l7irfXCqdlTPErgpRzfn IrxgAqDWZjG8WgusFcx/NYz6T2vKLwIVMBjZ8GfT9h40w4FPvvbhRaX+vcGymmOag6TBL AViYAQY6wW9G26uzKiqv4xdNQJw2EVfVAQw9X4NGAlEsRwdnloKDpw8y7HKvI4Y0Hk+0u sEUHg1VoIIIYclaRMv2gg7dBjmNSyFmI9F6Xf1g2rNiakE8CjBJebSxqTOdZDqWYO3A== 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=PToTHXLu; 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 34349606A322 for ; Fri, 4 Dec 2026 06:43:09 +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=PToTHXLu Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF1891F000C2; Fri, 4 Dec 2026 06:43:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796366589; bh=ZZOMF9n5tS88Jthx8YMMMEbXTFiRSYEBLkA79w4sNUc=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=PToTHXLuG3rV4BaGQWsQDj1MTJxdebjjLQdA/wK4AxK233XX5XUHTgJzyFwN9u7Kk 3EZdUGLQkWSQw/wDMGTD/n48O+L5wqJuScblJ3UUIm2YRnRv/m279YD//ordlHXL8t VhAW9qUfiCa1pXa3HqwFOHJHjS26S9rzSchKNQWtAmhC6lEhaQSr7bHZFBsFOvUqek RilbGMphJcCJ8CVJr6OqrE4avnBJG4rOh3dVa/+Q3dQd/teZ/eYp7GhbtMsIoNQDfU XRKfZ5pFIYvcF/7zN5nErlBBLEo/WmJuvkqkNlRU+vcZ9W9q1GG4oCquYJhVH4UefZ 9Nn/I2swJL32Q== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v5 5/5] arm64: dts: qcom: Add eFuse nvmem cells for Ethernet MAC addresses Reply-To: sashiko-reviews@lists.linux.dev To: "Hongmei Xu" Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261204-nvmem-byte-mask-for-split-macaddr-v5-5-13c12a99383f@oss.qualcomm.com> References: <20261204-nvmem-byte-mask-for-split-macaddr-v5-0-13c12a99383f@oss.qualcomm.com> <20261204-nvmem-byte-mask-for-split-macaddr-v5-5-13c12a99383f@oss.qualcomm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 06:43:08 +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 5 potential issues to consider: - [High] nvmem: layouts: UAF of devm priv in qcom_eth_mac_post_process() - [Medium] arm64: dts: qcom: dtbs_check failure for qcom,efuse-eth-mac layout - [Medium] arm64: dts: qcom: standalone 8-byte QFPROM slice breaks DT modeling - [Medium] nvmem: qcom-eth-mac: premature fw_devlink_purge_absent_suppliers() drops links - [Low] arm64: dts: qcom: duplicate @0 unit-address on eth0-mac and eth1-mac -- commit c44ef6ebd0ca67b47b5b2f8c3e7c8472378a4efd Author: Hongmei Xu arm64: dts: qcom: Add eFuse nvmem cells for Ethernet MAC addresses This commit adds a QFPROM eFuse node in nord.dtsi with an nvmem-layout exposing the EMAC0 and EMAC1 MAC addresses as nvmem cells. > diff --git a/arch/arm64/boot/dts/qcom/nord.dtsi b/arch/arm64/boot/dts/qco= m/nord.dtsi > index fdbe290350ddd..185db2e19c39c 100644 > --- a/arch/arm64/boot/dts/qcom/nord.dtsi > +++ b/arch/arm64/boot/dts/qcom/nord.dtsi > @@ -2116,6 +2116,26 @@ llcc: system-cache-controller@21800000 { > "llcc_broadcast_base", > "llcc_broadcast_and_base"; > }; > + > + efuse: efuse@360d4320 { > + compatible =3D "qcom,nord-qfprom", "qcom,qfprom"; > + reg =3D <0x0 0x360d4320 0x0 0x8>; [Severity: Medium] Should efuse@360d4320 describe the QFPROM corrected region rather than an 8-byte slice dedicated to Ethernet MACs? qfprom_probe() claims reg entry 0 exclusively via devm_platform_get_and_ioremap_resource(), so adding a node for the full QFPROM corrected region later will fail with -EBUSY unless efuse@360d4320 is removed and DT ABI is broken. Attaching qcom,efuse-eth-mac as the device's nvmem-layout also prevents non-MAC fuses from sharing this efuse node because qcom_eth_mac_add_cells() treats every child as a 6-byte MAC address. Describing a standard 0x1000 corrected region at 0x360d4000 (which avoids 0x360d5000) with fixed-layout and per-cell post-processing would let MAC cells and general QFPROM fuses coexist. > + > + nvmem-layout { > + compatible =3D "qcom,efuse-eth-mac"; > + #address-cells =3D <1>; > + #size-cells =3D <1>; [Severity: Medium] Does compatible =3D "qcom,efuse-eth-mac" fail make dtbs_check here? Commit "dt-bindings: nvmem: layouts: add Qualcomm eFuse Ethernet MAC layout" sets select: false in qcom,efuse-eth-mac.yaml without adding a $ref entry to Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml, so the schema is never applied and dt-validate rejects this node in nord-ride.dtb and nord-rrd.dtb. In addition, the example in qcom,efuse-eth-mac.yaml puts a 4-cell reg property at the example root without a 2-cell parent node, failing make dt_binding_check against qcom,qfprom.yaml. [Severity: Medium] Does the qcom,efuse-eth-mac driver drop fw_devlink consumer links for eth0_mac and eth1_mac during probe? In commit "nvmem: layouts: add Qualcomm eFuse Ethernet MAC address layout driver", qcom_eth_mac_add_cells() calls fw_devlink_purge_absent_suppliers() on each child node. That deletes all consumer fwnode links before device_links_driver_bound() runs fw_devlink_pickup_dangling_consumers() to move them onto layout->dev as managed device links, breaking supplier/consumer suspend, shutdown, unbind, and sync_state ordering. It also leaves earlier cells' consumer links permanently purged if a later cell fails validation during probe. Dropping that call lets driver core handle the child fwnodes on bind, as fixed-layout.c does. > + > + eth0_mac: eth0-mac@0 { > + reg =3D <0x0 0x6>; > + }; > + > + eth1_mac: eth1-mac@0 { > + reg =3D <0x0 0x7>; > + byte-mask =3D <0x5f>; > + }; [Severity: Low] Will eth0-mac@0 and eth1-mac@0 trigger a dtc duplicate unit-address warning on W=3D1 and dtbs_check builds? Both enabled sibling nodes share @0, which fails -Wunique_unit_address_if_enabled, and instance-numbered names (eth0-mac, eth1-mac) conflict with generic Devicetree node-naming guidelines. Modeling the shared 7-byte region as one generic cell at @0 with #nvmem-cell-cells =3D <1> would avoid both issues. [Severity: High] Can reading eth1-mac@0 trigger a use-after-free of cell->priv in qcom_eth_mac_post_process()? In commit "nvmem: layouts: add Qualcomm eFuse Ethernet MAC address layout driver", qcom_eth_mac_add_cells() allocates priv with devm_kzalloc(&layout->dev, ...) and attaches it to a cell registered on the parent nvmem->cells list. When the layout driver is unbound or unloaded, nvmem_layout_unregister() is an empty stub that leaves the cell live in sysfs while device_unbind_cleanup() frees priv via devres_release_all(). Reading the cell via sysfs afterward invokes qcom_eth_mac_post_process() on the freed priv (passing p->raw_len to kmemdup() and reading p->byte_mask and p->dev), and jumps into unmapped module text if the module was unloaded. The same dangling priv occurs if qcom_eth_mac_add_cells() fails on a later child after registering an earlier byte-masked cell. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204-nvmem-byte= -mask-for-split-macaddr-v5-0-13c12a99383f@oss.qualcomm.com?part=3D5