🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #12953

Re: [PATCH] netfilter: ip_tables: propagate compat_table_info() error

#12953
From: Florian Westphal
Date: Mon, 09 Nov 2026 02:43
29 lines
8641 bytes
Noah Weinberger <NoahWeinberger2003@proton.me> wrote:
> In the IPT_SO_GET_INFO compat path, the return value of
> compat_table_info() is ignored: on failure (vmalloc ENOMEM in
> xt_compat_init_offsets()), private = &tmp is used anyway, and ret is
> overwritten with 0 after a successful copy_to_user - so a 32-bit caller
> gets stale or partially adjusted 64-bit-layout size/hook_entry/underflow
> values instead of an error. The follow-up GET_ENTRIES then fails with
> -EAGAIN. tmp is fully initialized, so there is no disclosure; this is a
> robustness fix. The same pattern exists in ip6_tables.c; both are
> patched.
> 
> Affected version/commit: mainline fa4ad798f6f681031775266044ba1b0cf3c670bd (v7.4-rc1, 2026-11-07), net/ipv4/netfilter/ip_tables.c:968-987, net/ipv6/netfilter/ip6_tables.c:989-1008.
> Longstanding code.
> 
> This was found during an assisted (AI-supported) static source review of
> mainline fa4ad798f6f681031775266044ba1b0cf3c670bd (v7.4-rc1, 2026-11-07); every code path cited below was re-verified by the
> reporter against that tree. The patch below has NOT been compiled and has
> NOT been runtime tested, and no reproducer was produced - the triggering
> conditions are described above instead. Please treat this as a report for
> verification rather than a battle-tested fix.

8-(

net/ipv4/netfilter/ip_tables.c: In function 'get_info':
net/ipv4/netfilter/ip_tables.c:992:1: error: label 'unlock' defined but not used [-Werror=unused-label]
  992 | unlock:

8-(
Technical Details
Message-ID: <avEzPLSvi6meDDXv@strlen.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-358985-linux-kernel-netdev=dewy.ru
References: <YEo_4lnonRc0-_Jotuzk7hOaWl3QockF3xDwJ4cE5v8uBvy1KW27Eku0fWDJycuoZ9AgGFxsxgtSWI6SE2kNJ38eVnLx-HtApOhBw0wxXGg=@proton.me>

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-358985-linux-kernel-netdev=dewy.ru
From: fw@strlen.de (Florian Westphal)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH] netfilter: ip_tables: propagate compat_table_info() error
Date: Mon, 9 Nov 2026 03:43:08 +0100
Organization: Usenet Network
Message-ID: <avEzPLSvi6meDDXv@strlen.de>
References: <YEo_4lnonRc0-_Jotuzk7hOaWl3QockF3xDwJ4cE5v8uBvy1KW27Eku0fWDJycuoZ9AgGFxsxgtSWI6SE2kNJ38eVnLx-HtApOhBw0wxXGg=@proton.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="255603"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:tvdKonqJzmsKdbThHF5gkgSneYg= sha256:joD6Xqud7um8uWeyukZcOhK24oBkcvO6n3JfQfkouKA=
	sha1:7iwkjI/b8PGMK07WYe+tv/hqEVg= sha256:SIpvAQqH/g6ZHhKdW1v5X3f/Ibob0upZIYXvPBib+DE=
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 27E021136AC; Mon,  9 Nov 2026 05:45:01 +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 QkGaf7kDfDHz;
	Mon,  9 Nov 2026 05:44:57 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-358985-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 44585113647; Mon,  9 Nov 2026 05:44:54 +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 6BFD58769E; Mon,  9 Nov 2026 02:43:29 +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=1794192208;
	b=aXn3OuZlgb+1AblJk2tLEDkDba6Us2NcaYSye1R8en0RZiGyRgK2obcOuLTcEkAYD9lO
	 D2uwileeT2ajcCixQxn1xsqY1v76yTTI5Y1u/Z5u0mp4rhRV28m5Oi5YzTb/A0V5m3jpc
	 dGP+CclYpDdG3IwWyiGTV65LtU76LL4twO7Id9RmcXt8Pm1+ey3vR80ExeuZxGWqtUFoP
	 Z4tPVSxS2YQkudLgGwYkTjh4csWU/ZNfD4DNcBwyJLuxpaRNneh9AENjjR7vU2tBOsPIB
	 MScjlwyPXmYr+QkD9k2LywKeGhZfBgKHcg+MMuuTlSiN0BCn3N0qFPovFSiDVcqi5mw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794192208;
	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=NiHIrQhN1EZBJeOzVcCEIjXlI/nm5F+3CXiAQu+5P7k=;
	b=f2gpuY4w35QARdbSkQnLs4dv3kLwV4FqItwdUavRs8VTeZ1xCf1wsUx/5KQ8aq+EYk9k
	 j22/FldFB6O9O0GHltEIttlbdQWJZqipA0tGBfGXNAn8IcW2ZWuMk0I75REDc5aB5HtKU
	 GymczkTzICazVki6YEQBDZGO7S0j73EuH+8UYT6KMEB2RdMiH6Y63aRgadkKY9jHcZg16
	 Ov/UuY7arQkkvW503MjAN4vzXo8XG+Rikp0Opg/hDAWIOHWVB0/F2c6zgZNsN0vHrw41p
	 68KJ05nihPi55BWdWu947V/hRXdFpw2zvWrfr4EgDQYNOmd8h8HcR1RwtqDrwFueVhA==
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 76EBF606A322;
	Mon,  9 Nov 2026 02:43:28 +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=1794192192;
	b=X7di1LzQwjx/r4zw1XltUaPPy5NBPeI4HJwvkZg4TLrghHMBnlqt+Dye8CpddkPY+XzD
	 N7jt9hFJ2MRUV1NTvfAZU7hRRp++ugifgszlmrvtUGa1dIlHBeejQNJ3PoSDFWTUofQCM
	 89DycRE8ShvZfkC28uxg/PwejW+6bLFkvk9QCfhk8XeBjoBr2cXbnWXSPKyKy9y13Fugw
	 +8EbbshcTUfLEGZ9q5lO9djS3/zGmQ/H2trqQ2PKpcpXsshjmmnxiUor56lvT06dj+ocx
	 TDSfydL5pAYc92XK3ibI6lQw2rdW4fmNDvm+YVlWhZSTF9GCDngh2xnIcKrMbXQx4dQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794192192;
	h=DMARC-Filter:Received:Date:From:To:Cc:Subject:Message-ID:References:
	 MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=NiHIrQhN1EZBJeOzVcCEIjXlI/nm5F+3CXiAQu+5P7k=;
	b=OPd0Hvt/66blieMZ6kUzgSn+obd8kJzZl88Wam4lkUxVUL9UWelqSDT79XtiNED8I20n
	 Rhv5web8tBKG/3dy0cuqf3lPXWApKhIp8XlzKWMda8FipxExQ2/FTGctgWb6NNcY9rjff
	 YbkzeBZLMbHywkA8sLHuIqKOBugz3gOy9Hyx44twTa9fDW42uq/55M/KV1q5cdC8Ll6LX
	 jdQ66LxC04z+YGwPOOzBueIyP/EejibrPo+KM2Gyoz/DXU6oDMp9jhETFbnbZxEu86kGp
	 whHyb3FUmFJ0C8rmEZt20OibhDK2ZTvke1Cz9PPTkxoyS2IqDrBpD059Fb3xNeTG2aQ==
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 AF369606A334;
	Mon,  9 Nov 2026 02:43:11 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AF369606A334
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 3D46A60490; Mon, 09 Nov 2026 03:43:09 +0100 (CET)
X-Cc: "pablo@netfilter.org" <pablo@netfilter.org>,
	"kadlec@netfilter.org" <kadlec@netfilter.org>,
	"netfilter-devel@vger.kernel.org" <netfilter-devel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@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: <YEo_4lnonRc0-_Jotuzk7hOaWl3QockF3xDwJ4cE5v8uBvy1KW27Eku0fWDJycuoZ9AgGFxsxgtSWI6SE2kNJ38eVnLx-HtApOhBw0wxXGg=@proton.me>