Re: [PATCH net] octeontx2-pf: fix NULL deref of af_xdp_zc_qidx on rep setup

From: Ratheesh Kannoth

Date: Fri Aug 21 2026 - 06:55:31 EST


On 2026-08-20 at 14:35:33, Ratheesh Kannoth (rkannoth@xxxxxxxxxxx) wrote:
> From: Suman Ghosh <sumang@xxxxxxxxxxx>
>
> af_xdp_zc_qidx tracks receive queues using AF_XDP zero-copy and is
> allocated during PF/VF probe. Representors and other non-AF_XDP paths
> leave the pointer NULL, but several call sites used test_bit() on it
> unconditionally.
>
> Switching to devlink eswitch mode creates representors and runs
> otx2_init_hw_resources(), which reaches otx2_pool_aq_init() and oopses
> when dereferencing the NULL bitmap. Add NULL checks before every
> af_xdp_zc_qidx test_bit() use in the RSS, ethtool, XSK, and pool init
> paths.
>
> Fixes: efabce290151 ("octeontx2-pf: AF_XDP zero copy receive support")
> Signed-off-by: Suman Ghosh <sumang@xxxxxxxxxxx>
> Signed-off-by: Geetha sowjanya <gakula@xxxxxxxxxxx>
> Signed-off-by: Ratheesh Kannoth <rkannoth@xxxxxxxxxxx>

Will address sashiko comments in v2

pw-bot: changes-requested