From mboxrd@z Thu Jan 1 00:00:00 1970 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) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.13.80.246 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= 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= 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 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tipi-net.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tipi-net.de header.i=@tipi-net.de header.b="mUu1OA0b" 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) 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== From: Nicolai Buchwitz Date: Wed, 07 Oct 2026 20:29:22 +0200 Subject: [PATCH net-next 1/3] net: selftests: use skb_share_check() in the loopback receive hook Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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> In-Reply-To: <20261007-nb-net-selftest-shared-net-v1-0-458369bfa1ba@tipi-net.de> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Oleksij Rempel , Maxime Chevallier , Andrew Lunn , Maxime Coquelin , Alexandre Torgue , Jose Abreu , Saeed Mahameed , Tariq Toukan , Mark Bloch , Leon Romanovsky , Dragos Tatulea , Alexei Lazar 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 X-Mailer: b4 0.16.0 X-Last-TLS-Session-Version: TLSv1.3 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 --- 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