Article View: linux.kernel.netdev
Article #17175Re: [PATCH nf] netfilter: nf_dup: unset mac_header on the duplicated packet
From: Florian Westphal
Date: Mon, 16 Nov 2026 13:39
Date: Mon, 16 Nov 2026 13:39
18 lines
7759 bytes
7759 bytes
Theodor Arsenij Larionov Trichkine <theodorlarionov@gmail.com> wrote: > nf_dup_ipv4() and nf_dup_ipv6() duplicate the packet with pskb_copy(), > which leaves the headroom uninitialised but keeps the mac_header offset. > On LOCAL_OUT and POST_ROUTING, an nft payload read of the link-layer > header of the copy loads those bytes, and a set element can return them > to userspace: > > BUG: KMSAN: kernel-infoleak in _copy_to_iter > > Unset the mac header of the copy, as for a locally generated packet. Why force users to work around this? I think it would make more sense to __pskb_copy_fclone() to check if the copied mac_header offset is now in uninitialised headroom and then resets it. Otherwise we might have more places that need fixing, resp. will re-introduce this issue in the future.
Technical Details
Message-ID:
<avsHhMbvwwfcI6_b@strlen.de>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364345-linux-kernel-netdev=dewy.ruReferences:
<20261116105113.128791-1-theodorlarionov@gmail.com>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!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364345-linux-kernel-netdev=dewy.ru From: fw@strlen.de (Florian Westphal) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH nf] netfilter: nf_dup: unset mac_header on the duplicated packet Date: Mon, 16 Nov 2026 14:39:16 +0100 Organization: Usenet Network Message-ID: <avsHhMbvwwfcI6_b@strlen.de> References: <20261116105113.128791-1-theodorlarionov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="2073643"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:gXRH5Km4sMeP3TlHAPW2PKqrzQc= sha256:eL1OZ1soOzJm+TlesJOTbYM0EOoPBYAnd5X2X9cO7Ow= sha1:7CmKIyS1jCUXxgnRVP9tNG7vb2M= sha256:wE40YQowc9qnicBfB1Vh8YRpaGezPmXNbNdevtq1Bf8= 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 4FBBF114C27; Mon, 16 Nov 2026 16:39:42 +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 fnlujGpj1cef; Mon, 16 Nov 2026 16:39:36 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-364345-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id EFFF0114BD4; Mon, 16 Nov 2026 16:39:32 +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 A33D829F9B; Mon, 16 Nov 2026 13:39:26 +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=1794836362; b=cW+UQ2XucxdEM/EyCvrUWeulsVjtp1e4XP9wGiArFD5pXMJmSlYsXU2SfxQpV/tVSi61 Q0p6rfF4vnlvTyhEgZI+ph4oaTDrcstKH9+OiUDa3E4COICNM7bfiL45uLntG5MjxarhR EZ514sA1/Sd2WpiMFdu9gItgBJi0FFp+RXC6tT8h1GABRsuirQvDkrTSVllUdBwLxOiMa OatkJcnZCt+Ifw5Lz2LDVA2Lv8WpzMUsFHtFjGofVk5SAUEbnt176KG9hMvj7cmCKfdxi KHxBGnUHB1wPzipoSUVx4JItN8H58nhPw6XVbTPn03XELzlAn+sXKcAS+NwDudgkDpw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794836362; 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=n59qOTV8SxlKRlydmx7eBhuK9SYOiSwbIO+6MI483OY=; b=nuAmmwF2C6XMuLkyIq7N8Pg+eitCPKgMNrMb6P7ccy7ZoLdhoWFq03VOGXD0x6PgpY0J HcAIbfGSDRagi0pKm0ZEK2RZkdvz8u+aqfuUI1W9Z3nC9itfWpwnjuXc3oD48YAzkknrD +W8FiZN4qBl08URr9eG6ysSNic01YYef2LXn7i8tMJWR2tpOj1q1l/MStWp9TfCj4+qtO DbpOrQnNm/fIrzWuMxHNAHynxiVEVJRS8J1OOJ3dp1THm3PEnJtaZTX1Y8yacACQboZRj W0hhA1OmuGWzytdYdg76MZL2HiF03mdgBp4l6Ft+7nZX2WHb1hP3zXFMD0jG8WjX6rQ== 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 35AA7606A33A; Mon, 16 Nov 2026 13:39:22 +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=1794836361; b=xPELSRzWmaaleShNLK/qvnxvbrpq8gQoFtu+OddfenabKpWfNQaOT7lJL66CuewhScCF VDw/yGJmZvQPZ3HYoW+PW+69Cfk2N9KeklUys1eQEx7g00lfsEJeKTDxh2cUq2T9U6eIw YRpfi5TKnl7JXOwNPdSY4AelknTw6I2C09y/1apHQt/TjVWxTdTZTrwrAOyf70k6VwLQa VON1In7z6+xHr3ArTO+NWjJoDtbv04jic9eHHx8nfxzuiDeWXKZF0zOt1MT2Yv/K2yO43 OzcVsANC18fGBOx0IR4L0dme3V2OuN3v90Z2xs2gwFrpTXlv+mDwZB040mC9acg9umw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794836361; h=DMARC-Filter:Received:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=n59qOTV8SxlKRlydmx7eBhuK9SYOiSwbIO+6MI483OY=; b=APO5OSd52XvY/Ke4frDDMc73mZc/W+sKYU0VkTuggaZCZW1ugO9M1xibaz+eZ5ztmBcs pt+vQb7lXV8FyRrVHkmd6zHHQqm9hO9L2rL+m9XL+nCGjtxnosNxEbtYeosvDnnF8S4VS Euiqt/diI+1UhGk2QnF95MjsdbTeDlyWQt/L4G+dFhxgLxlfb4xr09HYig5a7n6eIUyXj 1PWItRZzQzFPEuktgP3Bx68S6nE1NLAFAUN7nkC5Civdec/NjmjFKK8IYzK8vuLXNCxA8 FtDdp3OVfYhl95A2a67hB+v/bKFIxg1pmEWBGQClcmQBOxj/eaOB5GJdAXpSCtB1jYA== 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 E1FBA606A323; Mon, 16 Nov 2026 13:39:20 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E1FBA606A323 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 98E0460342; Mon, 16 Nov 2026 14:39:18 +0100 (CET) X-Cc: Pablo Neira Ayuso <pablo@netfilter.org>, Phil Sutter <phil@nwl.cc>, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.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 X-In-Reply-To: <20261116105113.128791-1-theodorlarionov@gmail.com> X-Received-Bytes: 7474