πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #18057

Re: [PATCH net v2 07/12] net: au1000: fix buffer descriptor free list insertion

#18057
From: Florian Fainelli
Date: Tue, 17 Nov 2026 19:13
73 lines
14076 bytes
On 11/16/26 05:50, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found more severe
> issue(s) in other patches of this series. This mail is only an FYI, in case
> you want to address the nit picks below when you respin.
> 
> Low priority / nit picks for your consideration:
> 
> - [Low] The commit message for "net: au1000: fix buffer descriptor free
>    list insertion" says the old au1000_ReleaseDB() "loses free…
> 
> --
> 
> net: au1000: fix buffer descriptor free list insertion
> 
> This patch changes au1000_ReleaseDB() so the returned descriptor's pnext
> points to the old free list head before it becomes the new head. Before
> this, the old head's pnext was set to the returned descriptor. The new
> code matches au1000_GetFreeDB() and how the list is set up in probe.
> 
>> ReleaseDB links the old head to the returned descriptor and makes the
>> returned descriptor the new head without updating its stale next
>> pointer. This loses free descriptors and can create cycles. Link the
>> returned descriptor to the old head instead, matching GetFreeDB and the
>> list initialization.
>>
>> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> 
> [Severity: Low]
> The code change looks correct. Should the commit message say that the old
> behaviour had no runtime effect, though?
> 
> au1000_ReleaseDB() is only called on teardown paths: the err_out unwind
> in au1000_probe() and au1000_remove(). In both cases the descriptor
> buffers and aup are freed right afterwards:
> 
> drivers/net/ethernet/amd/au1000_eth.c:au1000_remove() {
>      ...
> 	for (i = 0; i < NUM_RX_DMA; i++)
> 		if (aup->rx_db_inuse[i])
> 			au1000_ReleaseDB(aup, aup->rx_db_inuse[i]);
> 
> 	for (i = 0; i < NUM_TX_DMA; i++)
> 		if (aup->tx_db_inuse[i])
> 			au1000_ReleaseDB(aup, aup->tx_db_inuse[i]);
> 
> 	dma_free_coherent(&pdev->dev, MAX_BUF_SIZE * (NUM_TX_BUFFS + NUM_RX_BUFFS),
> 			  aup->vaddr, aup->dma_addr);
>      ...
> 	free_netdev(dev);
> }
> 
> The err_out path in au1000_probe() also falls through to
> dma_free_coherent() and free_netdev().
> 
> au1000_GetFreeDB() is only called from au1000_probe(), before any
> au1000_ReleaseDB() call, and no RX or TX path walks aup->pDBfree. Also,
> NUM_RX_BUFFS equals NUM_RX_DMA and NUM_TX_BUFFS equals NUM_TX_DMA, so
> the free list is already empty after a successful probe.
> 
> So the lost entries or cycles only ever exist in a list that is about to
> be freed and is never read again. With the Fixes: tag, stable tooling
> could pick this up as a user-visible fix.
> 
> Could the message say the bug is latent with no functional impact, and
> either drop the Fixes: tag or explain why it is needed?
> 

Yes I dropped it from the fixes since it has no functional impact.

pw-bot: not applicable
-- 
Florian
Technical Details
Message-ID: <fe73ee96-3ef2-4ec6-acb0-8e6794615ca1@gmail.com>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365546-linux-kernel-netdev=dewy.ru
References: <20261112045301.3669532-8-f.fainelli@gmail.com> <179483704622.3136.16694282680991633445@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365546-linux-kernel-netdev=dewy.ru
From: f.fainelli@gmail.com (Florian Fainelli)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2 07/12] net: au1000: fix buffer descriptor free list
 insertion
Date: Tue, 17 Nov 2026 11:13:37 -0800
Organization: Usenet Network
Message-ID: <fe73ee96-3ef2-4ec6-acb0-8e6794615ca1@gmail.com>
References: <20261112045301.3669532-8-f.fainelli@gmail.com>
 <179483704622.3136.16694282680991633445@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2407227"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:SLeL01/3aoH3mpF/CsDmorH4vZ0= sha256:UfkxLJuipQmhbD362EApNZqtt1zf6MVLcOcBeOEJjyg=
	sha1:0d9mqXtfZ88GaAVseMUlHxcgRQo= sha256:aq39cqKFmPYrduD8QZMKb+XToUGDP+Ji7eaBeG+5xt0=
Content-Language: en-US, fr-FR
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id E9A7611504D; Tue, 17 Nov 2026 22:14:09 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id QN9RIqyifHFr;
	Tue, 17 Nov 2026 22:14:06 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-365546-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 7AFA011504C; Tue, 17 Nov 2026 22:13:58 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 47D853FC80; Tue, 17 Nov 2026 19:13:51 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794942831;
	b=n6NkW/NezbLlno6h7Kn7QtM+bZO2/Hqn0bdSoNRQwnH96aW1P0nJhwtTluqSPKdPnfWa
	 2dYu1z+Cs+5eUyg9ra/EHLut4G2Li+rPlmMh1ApzUa5dd4pNzwRq87qszSVktqQmJ/T9W
	 ii8DGusSpFCtDOoIRoW8+3z9Mb0FbCzBfKVeLu6cfjOf1uZls5tuZVEYB4i8T7764quPY
	 ZVeR6ttr1OGuv23R/CMJUA+f0JGm8K1lnyxRP5qtQKz6Fu3FQisNiaeCQC5o6xQrZnnwh
	 H5gA9lxbi7cysLcxzlUS+AagQGytkh6FZLDkXyE85+UgSduDh1UvVbQuQ6qgNWT6seA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794942831;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:Message-ID:Date:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 User-Agent:Subject:To:Cc:References:Content-Language:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding;
	bh=hQdMYvTDljPfvw3jmPwCPaTjHRLJ0bm/dZ6FPmytRE4=;
	b=k17Osqx7nzP3znKXkJ3V0oOqqyTzQp4A0owVGPwfZUmzr79GIFMnzYz2lYb6b2C/99zV
	 7caQrt4yMYctiw2f83knyAj/3uaHHjqMmLWFC9UcfFbCD9At2XXv6wDH73susuMi3Vs83
	 b74BZjIGWc068UWJUkvWq19X5ua/3731fd2n5M72O3bk3T7hlM5oLO38OfBAXn/jHGIe+
	 7gaus7C+iCn9uEOZ4mThIYFWPcTQjwjQen3ujD289VVkRgPK8cGSqq6s14cdOH7EWb6Op
	 9ck2fZuzDRj6GPZOwyMD5amR2uzW3wAXXnYZ93eD8lxU0HYi53Scs/AIse0wreBZ8nw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=Vv0qvxXF;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 15084606A333;
	Tue, 17 Nov 2026 19:13:51 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=Vv0qvxXF
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.222.178
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794942830;
	b=mWM8mj9oO20/HEPS0/+7voc79M2NyXbgvl0r36409ArSzdPkHPnsZFE4XPHCn/8cbakt
	 IVP23wL6aKxXjgzETude3FbYXHZb6QMtFkLgWdTtKKxveiB66dflw/W4RhT7am7L7V7wC
	 vQscGrZTk3mwEJ8DyjJyPieRKTsbM9KMOEd4TtJ9o4ahw4VmoUu+PnZDDBTC3VA/IQwDq
	 S3BmgPXbS0pxQlJi9VqNj6w3IOxREShnvm7IgVBLk0gnTFydC8pQmF9njbwAmF2a0DBBU
	 i8WBQQ0UFBNXYLdwGwPdEiSZOpLSyfMua9eJfXbmhcwMMKQ2cXqbss1gDr4B05/BKJA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794942830;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Message-ID:Date:
	 MIME-Version:User-Agent:Subject:To:Cc:References:Content-Language:
	 From:In-Reply-To:Content-Type:Content-Transfer-Encoding;
	bh=hQdMYvTDljPfvw3jmPwCPaTjHRLJ0bm/dZ6FPmytRE4=;
	b=W+ZVzUUb7gOKOl3iBBMBIxLvMHITpbUOhpBTpQMrsPbJE0p1tORpaw2QTabucR9WgdY8
	 sF+3ladUD6dVCwct8QA7m1nvgkw91wI1WMLpcc5aC6dXFsxiOB53k5iBI2ArZmU9K/bsw
	 /mvaExGoOnK2+MMGDlKVt86f8fSQjfdvaRcp4nm/s0WlpJvCcC3YiuTDJzcOMNfbMd3Yy
	 7p3ZspLZC5SAD8oiHNdGg1jsVIzwd4SeF1TW6ewUSzNtHZA+JHHf5AwZkYVTOYVYZ25/x
	 h4DAwPVKzLl9AbKi3HJBK/UzEd5zE4eBfoP5DDzf4q5zHQQg+aBcFYlqMmgnm6g9jgQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=Vv0qvxXF;
	arc=none smtp.remote-ip=209.85.222.178
X-Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF5AA606A32F
	for <netdev@vger.kernel.org>; Tue, 17 Nov 2026 19:13:49 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DF5AA606A32F
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-qk1-f178.google.com with SMTP id af79cd13be357-94960131b30so23082985a.0
        for <netdev@vger.kernel.org>; Tue, 17 Nov 2026 11:13:49 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1794942829; x=1795547629; darn=vger.kernel.org;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=hQdMYvTDljPfvw3jmPwCPaTjHRLJ0bm/dZ6FPmytRE4=;
        b=Vv0qvxXFVK1wzdTn6rn8Bs1smPyud6bl9bBzKLMXW8SUNGSv/cbkMpDwhf2VEuW2XA
         hITWVy5seULuYMNIQ9a5q0K4JzRvM8E8sDDdqMtZodrNJWmGIaBtvGgnjCLkOSm9NHiX
         gfX325gV1lZHcwmw+m1PuSyr7Ksb4LQ783W2dJ2yh2xSIt6uW9rLLkxMorBBcSu0PoCM
         z7JXmR3atBiN+oF5WRkICXSFaJivWMf+bsGXpx6NwZC4WiJ8LN4K5R03/DKbVYmqloM5
         qMPtAxTDu4VP/NdAY/JxR1TXqHxloWgxlNTs7MO9m8mqfn2jANmpKT1ALhnwdir5U+tm
         hhqA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1794942829; x=1795547629;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=hQdMYvTDljPfvw3jmPwCPaTjHRLJ0bm/dZ6FPmytRE4=;
        b=LIotng2WbUBM+eTjvnQ6h+v4kYYftXEwAOZaKY9X827mNYburvFXv4yc51dLm1iZ+G
         k+R6tgUzbRifTIsN8Aa4D15Z4pOgsAq84l7211b1f9mwdyW7CL9u20EJFsYajnQlkrDn
         imRL3zF8PqAl+XYPLUCU123j/BWY9ydsDThq7+saDldvqKXGbPXecf65pRhuCj9xj6ja
         yZWXXlA5mHN8hLNLt7o1f8zlP8IKTPtJNzFG7s06ldw7AG7+mhHfIDRtFnKxfac8ydvb
         JQ5bfq3ZWE9KW8w2rMD9Jq9Vrr3vFV+MwrkHUadlIh1NjK4DIcR8pJAc/Ad4xrLB0riC
         qMmQ==
X-Gm-Message-State: APuU4Z8rgr4EZyDQNmHz+0crZjQj+28TtA8MWucTf8l4sIwPIsA4HRnN
	+IMvJ9DDQmsZ30koQ/qzQtS4qGqF1jWToRM1Mta/dwlmYFkTzO6ecM+8
X-Gm-Gg: AYBFou30yKeFhU88/QuaJa70vRGLd1jbj4EBLqeaXjg2thvIii+eB7i20hNHBUuuxCC
	HpkizKTca0TXrLWU3ETDUmKZewGLHmMhRHZdksP915SQLu1uNYfvnGSxmhGhksXKF4YP8sePii3
	vf9p9Zdw/QdBk4sduvNl8knosk34KO+IgVX7bNaqdbSZuOLnrhOErGqn14n4ngs8XA4JOZhtffW
	bJll60qVFbgXenTSlaRFd/GIiOxwflt3b4IaBTBvLEi+X6lAW8158QA/jcLpKcNcsbbFCDn/9QG
	S25EG4YoVmw5tnNVx0H62ETg3HLjcyjHKI2Kh6ubTk8k+iAJ685d3WQm0i+4UsRnskvIpXBBvUz
	hPj/hdcERnXcn/O0iQeTNFvFwQllQRNuaylm9JMEmZutwgnAMR579riyt1+nS9xvCur7Qgcih+F
	Tp4BelBWghovGnVeEKxkFCUx4YIpcgoS2ECEoQpGyYZsqedWSQA8KnQpTp0BeTDCP4LsxQ54uPc
	yfPwH9fteX9q2+hVUK5dzekwg26v1Q4Mf5kA+2rSTQaJGn07pxc50OL8knWbfrzXEdR9Q33vR1t
	bJPNFANkI5vzaEOkrLPFVkoLB7w4kBFlUuOvgaa+U0oKD3fndSKo6elsCw==
X-Received: by 2002:a05:620a:19a4:b0:949:7656:ca0a with SMTP id af79cd13be357-949995b3446mr121165385a.35.1794942828757;
        Tue, 17 Nov 2026 11:13:48 -0800 (PST)
X-Received: from [10.67.48.245] ([192.19.223.252])
        by smtp.gmail.com with ESMTPSA id af79cd13be357-9494c803af0sm1138774085a.8.2026.11.17.11.13.38
        (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
        Tue, 17 Nov 2026 11:13:42 -0800 (PST)
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-User-Agent: Mozilla Thunderbird
X-Cc: netdev@vger.kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net,
 edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
 hkallweit1@gmail.com, linux@armlinux.org.uk, shaojijie@huawei.com,
 horms@kernel.org, runyu.xiao@seu.edu.cn, mmyangfl@gmail.com, hvr@gnu.org,
 jeff@garzik.org, danny.kukawka@bisect.de, mugunthanvnm@ti.com,
 sebastian.hesselbarth@gmail.com, linux-kernel@vger.kernel.org,
 manuel.lauss@gmail.com
X-In-Reply-To: <179483704622.3136.16694282680991633445@kernel.org>