Article View: linux.kernel.netdev
Article #8023Re: [PATCH net 0/5] net: fix eth_type_trans() crashes on skbs coming from the stack
From: Jakub Kicinski
Date: Tue, 27 Oct 2026 21:25
Date: Tue, 27 Oct 2026 21:25
43 lines
9979 bytes
9979 bytes
On Tue, 27 Oct 2026 09:25:59 +0100 Eric Dumazet wrote: > eth_type_trans() assumes ETH_HLEN bytes are present in skb->head. > NIC drivers always provide this, and they should keep using the fast > version, without an extra pskb_may_pull(). > > Devices looping skbs from their transmit path back to their receive > path get skbs built by the stack instead. tc actions (act_vlan pop_eth, > act_ife decode), BPF helpers (bpf_skb_change_head() before a redirect) > or OVS actions (pop_eth followed by pop_mpls/pop_nsh) can leave fewer > than ETH_HLEN bytes in the linear part, and eth_type_trans() then hits > the BUG() in __skb_pull(). > > Instead of fixing every producer, or adding a check to all > eth_type_trans() users, fix the few consumers exposed to this: Bot says: BPF CI (bpf-ci) is reporting a consistent regression with this patch applied: every single job variant (x86-64/aarch64/s390x, gcc/llvm, no-alu32/cpuv4/ASAN) fails the exact same selftest subtest: #135 empty_skb Specifically, the "veth ETH_HLEN+1 packet ingress [redirect_ingress]" case in tools/testing/selftests/bpf/prog_tests/empty_skb.c now fails: test_empty_skb:FAIL:ret: veth ETH_HLEN+1 packet ingress [redirect_ingress] unexpected ret: actual 1 != expected 0 That test redirects a minimal (ETH_HLEN+1-byte) skb to a veth's RX path via bpf_clone_redirect(..., BPF_F_INGRESS), which goes through dev_forward_skb() -> __dev_forward_skb2(). Before this change the skb was forwarded successfully (ret == 0); after switching to eth_type_trans_careful() it is now dropped (actual == 1, i.e. NET_RX_DROP). Could you take a look at whether the new drop-on-failure behavior in __dev_forward_skb2() is intentional for this previously-accepted ETH_HLEN+1 packet, and if so, update the empty_skb selftest's expected return value alongside this change? Right now the selftest and the new kernel behavior disagree, and it's failing 100% of the time in CI on every arch/toolchain/config combination we run.
Technical Details
Message-ID:
<20261027142511.5b00207b@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352618-linux-kernel-netdev=dewy.ruReferences:
<20261027082604.1485903-1-edumazet@kernel.org>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-352618-linux-kernel-netdev=dewy.ru From: kuba@kernel.org (Jakub Kicinski) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net 0/5] net: fix eth_type_trans() crashes on skbs coming from the stack Date: Tue, 27 Oct 2026 14:25:11 -0700 Organization: Usenet Network Message-ID: <20261027142511.5b00207b@kernel.org> References: <20261027082604.1485903-1-edumazet@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="1637187"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:o50VDsyfM3pKMiNNGvZdJTsDq1w= sha256:5C/YueMSX4EX4YBAdGpb1xTMXyJxmpYxD1qrEKmGywE= sha1:XSx/SKWyFok0bw/osREbDk5898w= sha256:tPt3fNAPnL1zJn5OeRmWFHamxXHFvUiurTJluILCQEY= 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 18D46125C1D; Wed, 28 Oct 2026 00:25:32 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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=kernel.org 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 KtnY8xxwtc-D; Wed, 28 Oct 2026 00:25:27 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-352618-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id C8C9C125C23; Wed, 28 Oct 2026 00:25:17 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 2F9E22CEF6; Tue, 27 Oct 2026 21:25:14 +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=1793136313; b=lfvP63Y0woSGcIHliOPQH3pY1VHWA43zSyXz9hrgcKEENFOKCcuIYPSkO/KJFrllcT26 /IlEqJndjehHmfX9LM2XVRepU6trTmQHmsgssnuZMBbBQMZk4ElTf1hlY5dZK4GjWq+B+ RilRYB2UO7T/lj8bun7KMKw114UN+NB3RksI6ZFvybxW0Xk6bplklE07ehd3AnFrO4K1Z 8w5YFKxS6hw10jGsnE/iNNNWAsEzQu9TFtjR7Eb0Z0XGZvdozEJ3CHGZXeL0d+h1wgsTb L5Giv86DuuOL5s/thD0VEnDWfEuPW3Oy9fPu0+YLIPAg2ZQAq/2QDN4kAoWHaQI5sZg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793136313; h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc: Subject:Message-ID:In-Reply-To:References:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=3vFEN7PFwFFQ6/hRJhhbKH2RiV/zoV2ai61tKhc4PRc=; b=W9FXY3O0m0Wsit1v/6l38sEtOz3i0rGYbDLYLtFsBGobgkwmnLg6oX5kCEzZvHEeU1BL 80aLXA38S9Mb1kI9II9UU0LFjv5m/hkr2ENTOq2GXbh4zjrErpKDcJm6VC7CeJKeKFqAp nA5FWAdsDuAIwfGeoGY91LW3eHp0jSL3tX0cBHlPMj6YtiDxNVKtzLyCvcbAHF+XNJqT2 gXTtusAFgTc8Emoo7GTRNM3+jyBJeUXankSgPUwgjOEcFjP0PMAU2oTI5LXFGhycNb5Gb aVGJCRYX+18LVSgzDGR+Jh1qqgEm81yQoJjqmhayQ6HCzYg0yJQ7pktcFoP3kq8R98Q== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Nerv6PK2; 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 67F96606A335; Tue, 27 Oct 2026 21:25:13 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Nerv6PK2 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793136312; b=xU9cGF/LkFN5SHZQGLjI592QgB/kMSBqS4LD9fBaOurPqFWdSBiaI06UmdK6dLp1klHY sTNyyfXJ+Q5THSPDNu9Z1eusDn8o/keN2WPHbqU24BpnWeKdnV8p8evKBAiUhVF/Hk6RK uyJ9jxBc65YZmIbBA5ZjBPdaMk2mgsXBdv6DEI+eZY+QVbeK3maoPSwsocgeRcdM0oeFB vKmD8Ucf8iYpYBtFRt0x0UYx92IiGCw6bnCxnAM0YY6esQRjhUn/VzTHOz7aG2rXVb3GD sjvplxI4/GNz4JX/M6QgDwpfSu1nP97LzxbTbPNStuw1UrauLhEW9WXjYR5YePq+6NQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793136312; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=3vFEN7PFwFFQ6/hRJhhbKH2RiV/zoV2ai61tKhc4PRc=; b=eI0g2gTUCPoFJmi/ForL3liCagzNvoLt7wl24H+93Na2L4Z6jaG7VvOTu1HuUTJnstfL KLgG+KPDKgLko0SHmNPb5bmennPsbzYOo0TmM2xt2xXzyKvDfIkaMf2Xz7poCrcF3C9jP SOMT5B3PIXKP41zdn8WHZ2DsUIGpMj0zFSyN/U6yUQ7dQvlhlgZ+pvGTSyFeZq0aauftI p5zlQw66p59x87viko4j0g2x20xornZVZPQVRBKT1NhR8sEv598uq5pr3Jws/2piun0Lx 6FNDGEOD5ziRIMWANrRnTerQB61bOK7XU7OHu6QaeoxW9KYobFJvjVOpfaKyGS+gIqg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Nerv6PK2; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5188D606A320 for <netdev@vger.kernel.org>; Tue, 27 Oct 2026 21:25:12 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7C8F1F01825; Tue, 27 Oct 2026 21:25:11 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793136312; bh=3vFEN7PFwFFQ6/hRJhhbKH2RiV/zoV2ai61tKhc4PRc=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=Nerv6PK2dzlkxdF7onOndkaTWQEaIxqFXN8XZ0z72Cg95/nlfgJtA8/QV30zPSFup r06PBT05gv0Ji5bdxaYOoXBxtTUQwJzgPehQO6gbmolqX4MO7rDQ12Noo6+ngcLSj1 WvAe6IkEHj+z+Cis/8WTqW0YP4ObxJmL9jOpPmiFsosRWQrK6CjLER9Lc+ONErcIJ5 9rHd21FTZBunfU8Epk4t1V64cleh9Q6cD1iRHO3RjShAP9fPeAsUqftY2c5T5Nu9L6 +Alkgzn7XHdJAInB1FKIQRS06Uj2RTdi/a+VXXrj8D/M1fX8DMREXPjZF9MrQ9yZFp KeVqV+j9EFXCA== X-Cc: "David S . Miller" <davem@davemloft.net>, Paolo Abeni <pabeni@redhat.com>, Willem de Bruijn <willemb@google.com>, Simon Horman <horms@kernel.org>, netdev@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>, Aaron Conole <aconole@redhat.com>, Eelco Chaudron <echaudro@redhat.com>, Ilya Maximets <i.maximets@ovn.org>, Jamal Hadi Salim <jhs@mojatatu.com>, Jiri Pirko <jiri@resnulli.us>, dev@openvswitch.org, Willem de Bruijn <willemdebruijn.kernel@gmail.com>, Ren Wei <weir@nebusec.ai> X-In-Reply-To: <20261027082604.1485903-1-edumazet@kernel.org> 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