octeontx2-af: fix NULL deref in NIX TM tree debugfs read path
Ratheesh Kannoth
maintainerPATCH 1/1 octeontx2-af: fix NULL deref in NIX TM tree debugfs read path
From: Anshumali Gaur <[email protected]>
rvu_dbg_nix_tm_tree_display() dereferences pfvf->sq_ctx without checking whether the SQ context has been allocated. Reading /sys/kernel/debug/octeontx2/nix/tm_tree for a NIX LF whose transmit queues are not set up triggers a kernel oops.
Guard the read path the same way rvu_dbg_nix_tm_tree_write() already does and return -EINVAL with a seq_file message when sq_ctx is NULL.
--- drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c +6 -0
@@ -1697,6 +1697,12 @@ static int rvu_dbg_nix_tm_tree_display(struct seq_file *m, void *unused)return -EINVAL ; pfvf =rvu_get_pfvf (rvu, pcifunc); + +if (!pfvf->sq_ctx) { +seq_printf (m,"SQ context is not initialized for pcifunc 0x%x\n" , pcifunc); +return -EINVAL ; + } + max_id = pfvf->sq_ctx->qsize;memset (&aq_req,0 ,sizeof (struct nix_aq_enq_req ));
Signature · 1 line
2.43.0
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Thu, 20 Aug 2026 10:33:33 +0530 you wrote:
From: Anshumali Gaur <[email protected]>
rvu_dbg_nix_tm_tree_display()dereferencespfvf->sq_ctxwithout checking whether the SQ context has been allocated. Reading/sys/kernel/debug/octeontx2/nix/tm_treefor a NIX LF whose transmit queues are not set up triggers a kernel oops.[...]
Here is the summary with links:
- [net] octeontx2-af: fix NULL deref in NIX TM tree debugfs read path
https://git.kernel.org/netdev/net/c/ec65631bd5ec
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html