🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #272

[PATCH net-next 2/3] net: stmmac: selftests: use skb_share_check() in the loopback receive hook

#272
From: Nicolai Buchwitz
Date: Wed, 07 Oct 2026 18:29
29 lines
6836 bytes
The loopback hook gets a shared skb when another ETH_P_IP handler is
bound to the device. skb_unshare() does not unshare it, so
skb_linearize() on a non-linear frame hits BUG_ON(skb_shared()).

Use skb_share_check() instead.

Fixes: 091810dbded9 ("net: stmmac: Introduce selftests support")
Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
index 6097f312fce4..c910675a9d9b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
@@ -244,7 +244,7 @@ static int stmmac_test_loopback_validate(struct sk_buff *skb,
 	struct tcphdr *thdr;
 	struct iphdr *ihdr;
 
-	skb = skb_unshare(skb, GFP_ATOMIC);
+	skb = skb_share_check(skb, GFP_ATOMIC);
 	if (!skb)
 		goto out;
 

-- 
2.53.0
Technical Details
Message-ID: <20261007-nb-net-selftest-shared-net-v1-2-458369bfa1ba@tipi-net.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342459-linux-kernel-netdev=dewy.ru
References: <20261007-nb-net-selftest-shared-net-v1-0-458369bfa1ba@tipi-net.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342459-linux-kernel-netdev=dewy.ru
From: nb@tipi-net.de (Nicolai Buchwitz)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next 2/3] net: stmmac: selftests: use skb_share_check()
 in the loopback receive hook
Date: Wed, 07 Oct 2026 20:29:23 +0200
Organization: Usenet Network
Message-ID: <20261007-nb-net-selftest-shared-net-v1-2-458369bfa1ba@tipi-net.de>
References: <20261007-nb-net-selftest-shared-net-v1-0-458369bfa1ba@tipi-net.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="710237"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Jd5COxjyZONe8OBztL+gyKZlIto= sha256:SSe1Uj9EE1015sitowPD48fFjpPnmVSDvBQO9AIUI8s=
	sha1:q5dfDvgruszn8c4EylKX7K4dK2c= sha256:FEaYK9WLmMe6m6iMrwdN8zbQdePLnOFDB9hT4pHWy/g=
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 8A35210F1F2; Wed,  7 Oct 2026 21:30:25 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -0.75
X-Spam-Status: No, score=-0.75 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, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
	URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=tipi-net.de
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 QZFTuRUiuhYV;
	Wed,  7 Oct 2026 21:30:23 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-342459-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=tipi-net.de
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id D067410F161; Wed,  7 Oct 2026 21:30:18 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sin.lore.kernel.org (Postfix) with ESMTP id 352ED26C20; Wed,  7 Oct 2026 18:29:51 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id C1C4D4E1413;
	Wed,  7 Oct 2026 18:29:45 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=tipi-net.de header.i=@tipi-net.de header.b="doV851Cb"
X-Received: from mail.tipi-net.de (mail.tipi-net.de [194.13.80.246])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id E77BA372B5A;
	Wed,  7 Oct 2026 18:29:42 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.13.80.246
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791397785; cv=none; b=mW0vZkl6xwu8ua7OEPBQUmGURM9wKrknsKMvuHflB7nFh2T58u1UgHsOKkZa3AZK3xXCx17fg/9NNofFo4XWuR5HOSIjmLKZEiOMo7dInpg9AKVpbvPeoRyf5PM0LBDJFwQWYCyv06Ud6PKvEnxaVKjdeO+6Gy1uwN31+sAj+1A=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791397785; c=relaxed/simple;
	bh=nh5laS0QoZtRzH96terkjgV4w1ijpibG98NPpiYebxg=;
	h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:
	 In-Reply-To:To:Cc; b=qaANHE4Hb+/OPaZGkKe2n3KMg6tRb213RKYcQi8ptqOGf+DErl56L9PEDJTDVOgLueva1rNJhVYg7w03T6cVmpwsC0BO3nw5xc8sOpErrfbeO6g54/2/706xj36obbR5FdNY63Fc4/YikpvKEYa8rYsEY0ztVAZFOciksPz59nQ=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de; spf=pass smtp.mailfrom=tipi-net.de; dkim=pass (2048-bit key) header.d=tipi-net.de header.i=@tipi-net.de header.b=doV851Cb; arc=none smtp.client-ip=194.13.80.246
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tipi-net.de
X-Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id E4EC5A154D;
	Wed,  7 Oct 2026 20:29:38 +0200 (CEST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim;
	t=1791397780; h=from:subject:date:message-id:to:cc:mime-version:content-type:
	 content-transfer-encoding:in-reply-to:references;
	bh=Mpp+rwnsNyKfxHdHUlAB8nvSuXAVIMHmY8/y4443xPI=;
	b=doV851CbkIgU/9FY1AehSM+L+Mv7bINiYDMomw8Ltq8sN+80RWajOMQTojDScGN6Ny+Qmf
	AXcMJyoO6dHh6hvsN5IjvVZ/SnXrC2K73CfwigpQhfK4UE2GZXhv9nQplOogwP5b4aAofz
	Iun6OocKTMBuQQUfYlFVrqYyZg8Jzw6QnRxvZ5VWWRXdOs8jqr7YS3t84ICnNffECh6pEz
	T0qPZNy7nMlB8aU8KbFOZ878kIitGZQ1zutkiqG9mB+MJ551XnkGQcyZYnbscVYgXGIDnQ
	0iLhyPJtEBBhmuGr9pdsaoMmkG7k+d930mP2N2IheFIydxjJfQtKuw5exh11dw==
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-In-Reply-To: <20261007-nb-net-selftest-shared-net-v1-0-458369bfa1ba@tipi-net.de>
X-Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, 
 linux-stm32@st-md-mailman.stormreply.com, 
 linux-arm-kernel@lists.infradead.org, linux-rdma@vger.kernel.org, 
 Nicolai Buchwitz <nb@tipi-net.de>
X-Mailer: b4 0.16.0
X-Last-TLS-Session-Version: TLSv1.3