🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
2 messages
2 total messages Started by Yicheng Zhong Wed, 11 Nov 2026 09:34
[RFC net-next 0/2] octeontx2-af: fix CN20K counter bounds and mailbox base
#14465
Author: Yicheng Zhong
Date: Wed, 11 Nov 2026 09:34
28 lines
9181 bytes
Two fixes in the CN20K paths of octeontx2-af.

The first bounds the counter argument of the MCAM counter handler before it
is turned into a bank and a register offset.  With a counter past the table
the bank selects a bank that does not exist and the offset leaves the NPC
block.

The second removes a phys_to_virt() from a pointer that is already a kernel
virtual address, which otherwise takes probe out of the linear map on arm64.

Both were found by reading the driver and were exercised in a QEMU model of
CN20K silicon, not on hardware, which is why they are RFC.  A longer report
covering other findings in the same handlers went to the maintainers and the
security team separately and is not part of this series.

Yicheng Zhong (2):
  octeontx2-af: reject an out of range MCAM counter on CN20K
  octeontx2-af: cn20k: do not phys_to_virt() the mailbox base

 .../net/ethernet/marvell/octeontx2/af/cn20k/mbox_init.c    | 4 ++--
 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c        | 7 +++++++
 2 files changed, 9 insertions(+), 2 deletions(-)


base-commit: 7b6ab4dbc156e2f96419715130b3d5738a306c93
-- 
2.43.0
Re: [RFC net-next 1/2] octeontx2-af: reject an out of range MCAM counter on CN20K
#14867
Author: Yicheng Zhong
Date: Thu, 12 Nov 2026 03:25
17 lines
9246 bytes
Thanks.  We looked at npc_mcam_verify_counter() and it cannot simply move
up.  On CN20K the ownership is recorded against the entry, in
entry2pfvf_map (rvu_npc.c:3190), not against the counter, and that helper
consults the counter view.

First, its ownership check reads cntr2pfvf_map.  That array is never filled
on this silicon, because the counter mailbox that would fill it returns
NPC_MCAM_INVALID_REQ (rvu_npc.c:3817), so the check would reject every
legitimate request.

Second, its bound uses counters.max (rvu_npc.c:2583), a counter count,
where cntr names an entry and should be bounded by the size of the entry
table.

We plan to correct the patch so the CN20K branch compares the caller
against entry2pfvf_map and bounds cntr by the entry table.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads