Subject: Re: [PATCH net-next] bnxt_en: fix kernel panic in queue api functions

From: Jakub Kicinski <[email-masked]>
Date: Thu, 4 Jul 2024 06:33:25 -0700

On Thu,  4 Jul 2024 07:41:53 +0000 Taehee Yoo wrote:
> bnxt_queue_{mem_alloc,start,stop} access bp->rx_ring array and this is
> initialized while an interface is being up.
> The rings are initialized as a number of channels.
> 
> The queue API functions access rx_ring without checking both null and
> ring size.
> So, if the queue API functions are called when interface status is down,
> they access an uninitialized rx_ring array.
> Also if the queue index parameter value is larger than a ring, it
> would also access an uninitialized rx_ring.

Shouldn't the core be checking against dev->real_num_rx_queues instead ?