Re: [PATCH net] octeontx2-af: Fix uninitialized variables and bounds in MCS alloc handlers
From: Ian Rogers
Date: Tue Nov 24 2026 - 19:40:38 EST
On Mon, Nov 23, 2026 at 9:38 AM <netdev-bot+sashiko@xxxxxxxxxx> wrote:
>
> [Severity: Low]
> Can the response array overflow described here actually happen today?
[...]
> [Severity: Medium]
> Does the requester actually see these rejections as errors?
>
> This default case and the new rsrc_cnt > ARRAY_SIZE() checks both jump to
> the exit label, which always returns 0:
Good catch on both counts - 'exit:' in rvu_mbox_handler_mcs_alloc_resources()
returns 0 (leaving hdr.rc == 0), and rvu_alloc_rsrc() already bounds
allocated IDs to rsrc->max <= 128 before writing into rsp->*_ids[].
I'll send a v2 that unlocks rvu->rsrc_lock and returns -EINVAL directly
for unrecognized rsrc_type (and rule_type) and drops the unnecessary
ARRAY_SIZE() checks so partial allocations are unchanged.
Thanks,
Ian
pw-bot: cr