lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3d93455e-cfe5-4f03-0b25-bc1c61fb693d@molgen.mpg.de>
Date:   Fri, 22 Jan 2021 13:36:50 +0100
From:   Paul Menzel <pmenzel@...gen.mpg.de>
To:     Yunjian Wang <wangyunjian@...wei.com>
Cc:     netdev@...r.kernel.org, intel-wired-lan@...ts.osuosl.org,
        jerry.lilijun@...wei.com, xudingke@...wei.com,
        Jakub Kicinski <kuba@...nel.org>,
        "David S. Miller" <davem@...emloft.net>
Subject: Re: [Intel-wired-lan] [PATCH net] ixgbe: add NULL pointer check
 before calling xdp_rxq_info_reg

Dear Yunjian,


Thank you for looking at these issue.

Am 22.01.21 um 12:23 schrieb wangyunjian:
> From: Yunjian Wang <wangyunjian@...wei.com>
> 
> The rx_ring->q_vector could be NULL, so it need to be checked before
> calling xdp_rxq_info_reg.

A small nit: need*s*

> Fixes: b02e5a0ebb172 ("xsk: Propagate napi_id to XDP socket Rx path")
> Addresses-Coverity: ("Dereference after null check")
> Signed-off-by: Yunjian Wang <wangyunjian@...wei.com>
> ---
>   drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> index 6cbbe09ce8a0..7b76b3f448f7 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> @@ -6586,8 +6586,9 @@ int ixgbe_setup_rx_resources(struct ixgbe_adapter *adapter,
>   	rx_ring->next_to_use = 0;
>   
>   	/* XDP RX-queue info */
> -	if (xdp_rxq_info_reg(&rx_ring->xdp_rxq, adapter->netdev,
> -			     rx_ring->queue_index, rx_ring->q_vector->napi.napi_id) < 0)
> +	if (rx_ring->q_vector && xdp_rxq_info_reg(&rx_ring->xdp_rxq, adapter->netdev,
> +						  rx_ring->queue_index,
> +						  rx_ring->q_vector->napi.napi_id) < 0)

Unrelated, but I always wonder, if there shouldn’t be more logging for 
the error cases.

>   		goto err;
>   
>   	rx_ring->xdp_prog = adapter->xdp_prog;

Reviewed-by: Paul Menzel <pmenzel@...gen.mpg.de>


Kind regards,

Paul

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ