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]
Date:   Thu, 20 Oct 2022 14:38:17 -0700
From:   Jacob Keller <jacob.e.keller@...el.com>
To:     xiaolinkui <xiaolinkui@....com>, <jesse.brandeburg@...el.com>,
        <anthony.l.nguyen@...el.com>, <davem@...emloft.net>,
        <edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>
CC:     <intel-wired-lan@...ts.osuosl.org>, <netdev@...r.kernel.org>,
        Linkui Xiao <xiaolinkui@...inos.cn>
Subject: Re: [PATCH] i40e: add a fault tolerance judgment



On 10/19/2022 8:34 PM, xiaolinkui wrote:
> From: Linkui Xiao <xiaolinkui@...inos.cn>
> 
> Avoid requesting memory when system memory resources are insufficient.
> Reference function i40e_setup_tx_descriptors, adding fault tolerance
> handling.
> 
> Signed-off-by: Linkui Xiao <xiaolinkui@...inos.cn>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_txrx.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
> index d4226161a3ef..673f2f0d078f 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
> @@ -1565,6 +1565,9 @@ int i40e_setup_rx_descriptors(struct i40e_ring *rx_ring)
>  	struct device *dev = rx_ring->dev;
>  	int err;
>  
> +	if (!dev)
> +		return -ENOMEM;
> +

What is this trying to protect against? When does a ring not have a dev
pointer? This seems more like patching over a buggy setup where we
failed to assign a device pointer.

How does this protect against use of system memory resources? It also
doesn't seem like it would significantly improve fault tolerance since
its possible to have a non-NULL but invalid dev pointer...

Thanks,
Jake

>  	u64_stats_init(&rx_ring->syncp);
>  
>  	/* Round up to nearest 4K */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ