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] [day] [month] [year] [list]
Message-ID: <9bd2332c-72fc-4d75-b498-87f4662824d4@intel.com>
Date: Wed, 30 Apr 2025 13:46:54 -0700
From: Jacob Keller <jacob.e.keller@...el.com>
To: "Alexey V. Vissarionov" <gremlin@...linux.org>, Andrew Lunn
	<andrew+netdev@...n.ch>
CC: "David S. Miller" <davem@...emloft.net>, Derek Chickles
	<derek.chickles@...ium.com>, "Dr. David Alan Gilbert" <linux@...blig.org>,
	Eric Dumazet <edumazet@...gle.com>, Felix Manlunas
	<felix.manlunas@...ium.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
	<pabeni@...hat.com>, <netdev@...r.kernel.org>, <lvc-project@...uxtesting.org>
Subject: Re: [PATCH net] liquidio: check other_oct before dereferencing



On 4/29/2025 2:00 PM, Alexey V. Vissarionov wrote:
> get_other_octeon_device() may return NULL; avoid dereferencing the
> other_oct pointer in that case.
> 
> Found by ALT Linux Team (altlinux.org) and Linux Verification Center
> (linuxtesting.org).
> 
> Fixes: bb54be589c7a ("liquidio: fix Octeon core watchdog timeout false alarm")
> Signed-off-by: Alexey V. Vissarionov <gremlin@...linux.org>
> ---
>  drivers/net/ethernet/cavium/liquidio/lio_main.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c b/drivers/net/ethernet/cavium/liquidio/lio_main.c
> index 1d79f6eaa41f6cbf..7b255126289b9fcd 100644
> --- a/drivers/net/ethernet/cavium/liquidio/lio_main.c
> +++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c
> @@ -796,10 +796,11 @@ static int liquidio_watchdog(void *param)
>  
>  #ifdef CONFIG_MODULE_UNLOAD
>  		vfs_mask1 = READ_ONCE(oct->sriov_info.vf_drv_loaded_mask);
> -		vfs_mask2 = READ_ONCE(other_oct->sriov_info.vf_drv_loaded_mask);
> -
> -		vfs_referencing_pf  = hweight64(vfs_mask1);
> -		vfs_referencing_pf += hweight64(vfs_mask2);
> +		vfs_referencing_pf = hweight64(vfs_mask1);
> +		if (other_oct) {
> +			vfs_mask2 = READ_ONCE(other_oct->sriov_info.vf_drv_loaded_mask);
> +			vfs_referencing_pf += hweight64(vfs_mask2);
> +		}

Obviously crashing when other_oct is NULL is bad..

But is it ok to proceed when it is NULL? Is leaving out the counts ok? I
guess I don't really understand what other_oct actually represents here.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ