Article View: linux.kernel.netdev
Article #276[PATCH net-next 1/3] net: selftests: use skb_share_check() in the loopback receive hook
From: Nicolai Buchwitz
Date: Wed, 07 Oct 2026 18:29
Date: Wed, 07 Oct 2026 18:29
29 lines
6657 bytes
6657 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: 3e1e58d64c3d ("net: add generic selftest support")
Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
---
net/core/selftests.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/selftests.c b/net/core/selftests.c
index 36b949ae520b..80029a67b2d2 100644
--- a/net/core/selftests.c
+++ b/net/core/selftests.c
@@ -170,7 +170,7 @@ static int net_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-1-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-342458-linux-kernel-netdev=dewy.ruReferences:
<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-342458-linux-kernel-netdev=dewy.ru From: nb@tipi-net.de (Nicolai Buchwitz) Newsgroups: linux.kernel.netdev Subject: [PATCH net-next 1/3] net: selftests: use skb_share_check() in the loopback receive hook Date: Wed, 07 Oct 2026 20:29:22 +0200 Organization: Usenet Network Message-ID: <20261007-nb-net-selftest-shared-net-v1-1-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="711019"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:UHsFg4kGDNyrMiqvp8aopCA23Pg= sha256:sYMa/CaDT2DnNTroKuOuPcIt3rpQLw9izcU5fS6Zc/I= sha1:ANiqg4YsxXwWTzgbzgp5DgkodUE= sha256:Zc0b2zF1yfJiLM+SQi3ThlFCWNJGckis7H1n2dszXdc= 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 12AE510F1F6; Wed, 7 Oct 2026 21:34:54 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.051 X-Spam-Status: No, score=-3.051 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, 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=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 zilnucF7RU01; Wed, 7 Oct 2026 21:34:51 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-342458-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 753FC10F1B9; Wed, 7 Oct 2026 21:34:48 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id 7EBC83BEA4; Wed, 7 Oct 2026 18:29:47 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 52C9B4E0B7F; 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="mUu1OA0b" 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 5B3E04DEC30; Wed, 7 Oct 2026 18:29:40 +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=PcLqUiisHgt/dKSFpGnX0qOba7HAm07475osD71rgQL+cvkJIDfBL0b1iFgUR7egoOtckKjMs1j9xIobyDBnorWmxg+C+qRlT1paJSFgvJ9XNVMxF3Vz7frOlzl1X1jFrxU0skn8xTHWoVJv/DC2/yw+NeN9mCd+WNEh7dkP0bU= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791397785; c=relaxed/simple; bh=VI3emZpj0lP09vycxgFte1cTwbK9Xr3ISoDzTiaE4T0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=V7DjS2c6E6488dd8zVaHdohfW4254N+GTGuN83wRwz4jjRWgFzGD26gFfeVSz5AjsBBFDPBZmlJhKVOS+8/KLu0Ty2K3PGmVFdckUph0rpcafWIt4kZ3b+ELycZCvRHjWMQ8p+R53bxdp1iQYhfg60SBXyTouFh/PE9amH3dd9U= 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=mUu1OA0b; 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 7A38BA0EC1; Wed, 7 Oct 2026 20:29:36 +0200 (CEST) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim; t=1791397778; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=6xdjR4cIqCHUalaWjA8soq/724MM3zNfgUxqkTZB9L0=; b=mUu1OA0bVsQB0Nr20IUq4JJQ/eDF6KI5F+miE8dM3w1NlglPiK4PGIfwiNdNbhttbJwjag eRfz3sUgD5PQfyCeLqHcZY3RUBCuA9kVNlAH91sxfbNNPCAXB+rKM/wl/RIh43mARbziJ1 udke/3gOtdFk3+LyfKtRRW+bu7nVz0QfF92OCYuk9+IKKwh+G6pqy2weX/UN7DFg3ceirE q8drULbl/kFwDvMwSIEAMywAA3wNqnV1eRok9zEUQAexqiaJNqYOdo2CZpE7sygN1F25tP h53hokc0S0Z0CeRR8UgadSxa2AJz9Bf0FlOAM1tUQEbadBAVf3GfJB2LWFFUbA== 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