Article View: linux.kernel.netdev
Article #19050Re: [PATCH net v2 2/2] net: unset the mac header of a pskb copy that points into headroom
From: Florian Westphal
Date: Thu, 19 Nov 2026 08:48
Date: Thu, 19 Nov 2026 08:48
33 lines
8847 bytes
8847 bytes
netdev-bot+sashiko@kernel.org <netdev-bot+sashiko@kernel.org> wrote: > [Severity: High] > Does this turn the uninitialised read into an out-of-bounds read for > bridged packets? The copy still carries SKB_EXT_BRIDGE_NF, because > skb_copy_header() -> __copy_skb_header() -> __skb_ext_copy() duplicates > the extensions. After this change, though, n->mac_header is ~0U. > nf_dup_ipv4() and nf_dup_ipv6() hand that copy to ip_local_out() and > ip6_local_out(), so it goes through NF_INET_LOCAL_OUT before any > link-layer header is pushed. Suppose a reject with tcp reset rule > matches there. nf_send_reset() and nf_send_reset6() only test > nf_bridge_info_exists(oldskb) before calling eth_hdr(oldskb). They then > pass oeth->h_source and oeth->h_dest to dev_hard_header(). > > With the mac header unset, that trips the DEBUG_NET_WARN_ON_ONCE() in > skb_mac_header(). It then reads 12 bytes at oldskb->head + 0xffff, > well past the end of the head buffer. Those bytes end up in the > Ethernet header of the RST sent out the bridge port, or the access > faults if the address is unmapped. > > Before this patch the same path read uninitialised headroom inside the > buffer, which is the leak being fixed here. So the reject helpers > probably need a skb_mac_header_was_set() check, the same way > nf_bridge_adjust_skb_data() in nfnetlink_queue.c has one. Or would you > rather drop the bridge extension on the dup path? Either way, it looks > like that has to go in together with this change, especially with the > stable tag. I think we should disable dup or fwd of skbs coming from br_netfilter (i.e. with SKB_EXT_BRIDGE_NF extension set). It would also make sense to disable/remove nf_queue support for br_netfilter in nf-next (this is independent of this work).
Technical Details
Message-ID:
<av63w6kQryQqWP_y@strlen.de>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366864-linux-kernel-netdev=dewy.ruReferences:
<20261117175835.745796-3-theodorlarionov@gmail.com> <179506802393.3136.3490105838474942994@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366864-linux-kernel-netdev=dewy.ru From: fw@strlen.de (Florian Westphal) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v2 2/2] net: unset the mac header of a pskb copy that points into headroom Date: Thu, 19 Nov 2026 09:48:26 +0100 Organization: Usenet Network Message-ID: <av63w6kQryQqWP_y@strlen.de> References: <20261117175835.745796-3-theodorlarionov@gmail.com> <179506802393.3136.3490105838474942994@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="2831775"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:JIuqu/HoeNEuT88iczOlfIPPxBo= sha256:zYs3jP00K2kxmFQhi4tLy6W54pgkYgUA+O+qAcKN6t4= sha1:Kr7bdIuIjnKWgzyGhfx0Vl+SlNw= sha256:qFOVvDoyB+GOWUOFENYpqNPX0+5dhe5MyAMPU+qXM/4= Content-Disposition: inline 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 C539D115570; Thu, 19 Nov 2026 11:48:46 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -2.951 X-Spam-Status: No, score=-2.951 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=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-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 5ju7AgvdB9bT; Thu, 19 Nov 2026 11:48:43 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-366864-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=strlen.de X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id EB669115525; Thu, 19 Nov 2026 11:48:39 +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 E01C22E56D6; Thu, 19 Nov 2026 08:48:35 +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=1795078115; b=uo56FTItnmSTSAB3xuUh2T1+MmK9OaIMI//SalisCohVPz8ckPxdPA1mYuvg+iJW4nMZ 4L0WEQZOsz/Uh5b70wLvSXI9ba+rnPFZkY9PpqNcdOj2gKne1JAQzREyaEoDWcLkMsQst JreNFZU7Ad3NbRNAqeO5jLOwbAIYdrrliNtTV7ubvfD+t0/a0o7WujW6HZjtOfDrZnOgd YvliTvKksVidgCB3c97hhH1M3pDUPjzqDyhXLMXOy1nzCPXyLVU0+4hxM+k6xE9l51QRm PM86UF4JzUDr08Uq2Fi5pVPJ73QrkiWaR6cE+tE/W6cjBZeZ8Lvs7LW9u7S9c7Oqf0g== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795078115; h=X-Original-To:Received:DMARC-Filter:Received:Date:From:To:Cc:Subject: Message-ID:References:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=33GYwwHy5bFpbYEe8FzT+nFzFJKkroS1MSXjsWGMd9c=; b=MCxqc5g9tAExkbqXRFA9MTcK4xydZa2Vdb9u9yHUwDaBgFYwYBSAObdOTZCP+zVWMGRC rLrB7Lt7eTSGKK1Gvm5ZeHZBJ/Wooi58E0rWFGFYLhnxmfCKo/hj4ZDf5ppMdpxymPnz0 TscCzGDBHjBB1akSdVfAJVh5JUUqtMDgXEqwA6XyLhkpQ4P1fwyXUCcdKVh69SYVHxR7o pZQ/Ds/vZdP3OQoZFo/SLfHdMnWWD34BP8JMwMmq9XM03M9U4t9yX7hDK2vslM7xh8yj9 zMOet/qrd7+HSPAaESO2Rp/0V8jI+Eu0yd3qwLtiR6jO1OyPadpjwHl8x9je4AoMLJQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none header.from=strlen.de; spf=pass smtp.mailfrom=strlen.de; 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 AE75A606A32C; Thu, 19 Nov 2026 08:48:35 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.216.245.30 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795078110; b=SeVCOELBrGnXlZYnWXjBKOT3mZUrYfKzoU7YX9G/MmleaLzHPhOLZdbYrAgPv1wpa3nW aVS9yKuDhY+elgujS/6mSgRM3d2Pt40OfjXdc5iI19yDekNlzH8WMXurzx+Y8dLFLMUyM tcCROmhjeL41iwJs6GaAXWVChNw1CEp1togKC1H0M5fS9ChWh2XRqDWn2oCk0p65CM9h/ fUS3OfYxMiIkT2wreZpdNmWg8msFzxgHqVtpEPLUbjIYAoVTHkaQzc8FE+yDOGs0vgho2 PMgbNhQ3+kogqBHQ4+8XB+KulPqC+YdhQ73EyqEDQ7cmQfOQjh/EnS5BAh63k2NtpCA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795078110; h=DMARC-Filter:Received:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=33GYwwHy5bFpbYEe8FzT+nFzFJKkroS1MSXjsWGMd9c=; b=lev3i4NUBWJEqcRCp25nRyM+7jzBjAfoH8Z6ag2vQmlneY9Hlp2wVbwufaMDDqF22Iup IGDtPvA4o8D3gjCYONVlFfq/xtr64cT5SevKC6a21ppcXpaQktp9lXtqHRXZmGb2oiLEd ET8RQHJVLmKX2kxwFVS9c2wifq0+G7tk9eCC7kbcJ2as6n9x9IPjprz0u1MlRs2AsVW9O gWCyMseeQkoKbMBFLDjChMZLJsRK/pm1vrZgTHCNsoUSeA5/SIiKwg3hcdMmimORg6Sqr 1FfJc2Tjxukz9F3Ytl/3YmGPhfcKjbXJHEvHA7Td1YgxEGKMkrjYxqeSkarpaVWUebg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=strlen.de; spf=pass smtp.mailfrom=strlen.de; arc=none smtp.remote-ip=91.216.245.30 X-Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [91.216.245.30]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A102606A338; Thu, 19 Nov 2026 08:48:28 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4A102606A338 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strlen.de X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=strlen.de X-Received: by Chamillionaire.breakpoint.cc (Postfix, from userid 1003) id 6A49560341; Thu, 19 Nov 2026 09:48:26 +0100 (CET) X-Cc: theodorlarionov@gmail.com, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, pablo@netfilter.org, phil@nwl.cc, netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.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 X-In-Reply-To: <179506802393.3136.3490105838474942994@kernel.org>