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: <20250917160924.6c2a5f47@kernel.org>
Date: Wed, 17 Sep 2025 16:09:24 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Yeounsu Moon <yyyynoom@...il.com>
Cc: Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
 <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo Abeni
 <pabeni@...hat.com>, netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net v3 2/2] net: dlink: handle copy_thresh allocation
 failure

On Wed, 17 Sep 2025 03:33:05 +0900 Yeounsu Moon wrote:
> @@ -965,14 +965,11 @@ receive_packet (struct net_device *dev)
>  			struct sk_buff *skb;
>  
>  			/* Small skbuffs for short packets */
> -			if (pkt_len > copy_thresh) {
> -				dma_unmap_single(&np->pdev->dev,
> -						 desc_to_dma(desc),
> -						 np->rx_buf_sz,
> -						 DMA_FROM_DEVICE);
> -				skb_put(skb = np->rx_skbuff[entry], pkt_len);
> -				np->rx_skbuff[entry] = NULL;
> -			} else if ((skb = netdev_alloc_skb_ip_align(dev, pkt_len))) {
> +			if (pkt_len <= copy_thresh) {
> +				skb = netdev_alloc_skb_ip_align(dev, pkt_len);
> +				if (!skb)
> +					goto fallback_to_normal_path;

The goto looks pretty awkward.

	skb = NULL;
	if (pkt_len <= copy_thresh)
		skb = netdev_alloc_skb_ip_align(dev, pkt_len);
	if (!skb) {
		// existing non-copy path
	} else {
		// existing copybreak path
	}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ