Skip to contentSkip to conversation

net: eth: fbnic: Fix addr validation in pcs write

PATCH Applied [email protected] 3 participants 3 messages May 7 – May 12

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 net: eth: fbnic: Fix addr validation in pcs write

From: "Mike Marciniszyn (Meta)" <[email protected]>

The DW IP has two distinct PCS address ranges cooresponding to the C45 PCS registers.

The shim translates the PCS addr/regno into specific CSR writes into one of those two zero-relative ranges.

This patch fixes a one off in the test that could allow an invalid CSR write if an addr == 2 was called.

There are is of yet, no real impact for the bug as no PCS writes are present.

---
v3:
- put back into the series based on https://lore.kernel.org/all/[email protected]/
- revised commit message will additional details
v2:
- omitted from patch series
v1: https://lore.kernel.org/all/[email protected]/

 drivers/net/ethernet/meta/fbnic/fbnic_mdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/meta/fbnic/fbnic_mdio.c +1 -1
index 709041f7fc43..d6a124889f52 100644
@@ -125,7 +125,7 @@ fbnic_mdio_write_pcs(struct fbnic_dev *fbd, int addr, int regnum, u16 val)
 		addr, regnum, val);
 
 	/* Allow access to both halves of PCS for 50R2 config */
-	if (addr > 2)
+	if (addr >= 2)
 		return;
 
 	/* Skip write for reserved registers */

--
2.43.0

reviewer Reviewed-by on v3 1/1
#1 lore raw
Quoted 14 lines · On Thu, May 07, 2026 at 11:42:03AM -0400, [email protected] wrote:

From: "Mike Marciniszyn (Meta)" <[email protected]>

The DW IP has two distinct PCS address ranges cooresponding to the C45 PCS registers.

The shim translates the PCS addr/regno into specific CSR writes into one of those two zero-relative ranges.

This patch fixes a one off in the test that could allow an invalid CSR write if an addr == 2 was called.

There are is of yet, no real impact for the bug as no PCS writes are present.

Quoted 8 lines

---
v3:
- put back into the series based on https://lore.kernel.org/all/[email protected]/
- revised commit message will additional details
v2:
- omitted from patch series
v1: https://lore.kernel.org/all/[email protected]/

maintainer Applied
#2 lore raw
In reply to [email protected]
Quoted 11 lines · On Thu, 7 May 2026 11:42:03 -0400 [email protected] wrote:

The DW IP has two distinct PCS address ranges cooresponding to the C45 PCS registers.

The shim translates the PCS addr/regno into specific CSR writes into one of those two zero-relative ranges.

This patch fixes a one off in the test that could allow an invalid CSR write if an addr == 2 was called.

There are is of yet, no real impact for the bug as no PCS writes are present.

Applied, thanks! (bot is not replying for some reason)