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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cb9e64fa-f47e-4e6b-9f98-8832e5acbf73@intel.com>
Date: Wed, 11 Dec 2024 10:28:13 +0100
From: Przemek Kitszel <przemyslaw.kitszel@...el.com>
To: Ma Ke <make_ruc2021@....com>
CC: <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<stable@...r.kernel.org>, <andrew+netdev@...n.ch>, <davem@...emloft.net>,
	<edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>,
	<shannon.nelson@....com>, <sd@...asysnail.net>,
	<u.kleine-koenig@...libre.com>, <mdf@...nel.org>
Subject: Re: [PATCH] net: ethernet: fix NULL dereference in nixge_recv()

On 12/11/24 09:34, Ma Ke wrote:
> In function nixge_recv() dereference of NULL pointer priv->rx_bd_v is
> possible for the case of its allocation failure in netdev_priv(ndev).

please be more precise about the case, rx_bd_v is not set during
netdev(w/priv) allocation

the embedded priv part is allocated together with the netdev, in the
.probe()

> 
> Move while() loop with priv->rx_bd_v dereference under the check for
> its validity.

this style has some benefits, but in the kernel we prefer the early
return:
	if (!priv->rx_bd_v)
		return 0;

instead of touching a whole function

> 
> Cc: stable@...r.kernel.org
> Fixes: 492caffa8a1a ("net: ethernet: nixge: Add support for National Instruments XGE netdev")
> Signed-off-by: Ma Ke <make_ruc2021@....com>
> ---
>   drivers/net/ethernet/ni/nixge.c | 86 ++++++++++++++++-----------------
>   1 file changed, 43 insertions(+), 43 deletions(-)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ