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] [thread-next>] [day] [month] [year] [list]
Message-ID: <4fb8c5a2-cae0-0885-76a9-5b4489291872@intel.com>
Date:   Wed, 28 Jun 2023 11:10:59 -0700
From:   Jacob Keller <jacob.e.keller@...el.com>
To:     Martin Habets <habetsm.xilinx@...il.com>, <davem@...emloft.net>,
        <kuba@...nel.org>, <pabeni@...hat.com>, <edumazet@...gle.com>
CC:     <netdev@...r.kernel.org>, <ecree.xilinx@...il.com>,
        <linux-net-drivers@....com>
Subject: Re: [PATCH net] sfc: support for devlink port requires MAE access



On 6/28/2023 5:32 AM, Martin Habets wrote:
> On systems without MAE permission efx->mae is not initialised,
> and trying to lookup an mport results in a NULL pointer
> dereference.
> 
> Fixes: 25414b2a64ae ("sfc: add devlink port support for ef100")
> Signed-off-by: Martin Habets <habetsm.xilinx@...il.com>
> ---
>  drivers/net/ethernet/sfc/efx_devlink.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/ethernet/sfc/efx_devlink.c b/drivers/net/ethernet/sfc/efx_devlink.c
> index ef9971cbb695..0384b134e124 100644
> --- a/drivers/net/ethernet/sfc/efx_devlink.c
> +++ b/drivers/net/ethernet/sfc/efx_devlink.c
> @@ -622,6 +622,9 @@ static struct devlink_port *ef100_set_devlink_port(struct efx_nic *efx, u32 idx)
>  	u32 id;
>  	int rc;
>  
> +	if (!efx->mae)
> +		return NULL;
> +

And returning NULL here indicates that no devlink port was created, and
matches the rest of the function.

Makes sense.

Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>

>  	if (efx_mae_lookup_mport(efx, idx, &id)) {
>  		/* This should not happen. */
>  		if (idx == MAE_MPORT_DESC_VF_IDX_NULL)
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ