From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D433224B28; Wed, 8 Apr 2026 18:32:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775673121; cv=none; b=mlZcolev4fNh+Tr8wsRWyaRi7PaqjeuZu+g20adbTRs53yM43hCSPFve9+FqJa9Rzdab/6gxe5mfd+E/exOgZBCUxfuEX+ghyOv6+pFt5D0lAxli138hlmHqXnh2s68hTN4dFtcBDfNIDw4cDVH5mrF0n4WXmUPBQoh7YFAgMMg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775673121; c=relaxed/simple; bh=72S+h/l5nr2pw7pHyKzhY9JgNw9CmHkC6s1+b/vosYw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IPuZ9uywiNK3iZoxIAUI+lwPF1uUkYmr5sOMviIuwIbfstEx3oieLY5QVu7+KsxqImmnWy8RR55RP5hg3Ezg14XR96FY+xuadQW/Ql9YXGeiFTpjQ3SDtJYNxWleewbz6Opv06jkJIR/K2qXYwNQaWzuQhzpL/jJRMwSIKRVttE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=pgDVd1mV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="pgDVd1mV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B65DC19421; Wed, 8 Apr 2026 18:32:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1775673121; bh=72S+h/l5nr2pw7pHyKzhY9JgNw9CmHkC6s1+b/vosYw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pgDVd1mVBzOpLOq1lPUAiDzW1pnFavde1jQrsbev1HmOmzY64gzC8zJZtdKWlTjbL JHVIbCwH9gnezR9tJlw+fDctHtBzp/Jha8n5GpzD3r2mHUHWuID4nyVMNVbEg7koJD FgZrtXat6KaREhmlRDknjvhdyf6hNA+sfBttQWGg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 6.18 077/277] netfilter: nf_tables: reject immediate NF_QUEUE verdict Date: Wed, 8 Apr 2026 20:01:02 +0200 Message-ID: <20260408175936.740713722@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260408175933.836769063@linuxfoundation.org> References: <20260408175933.836769063@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Pablo Neira Ayuso [ Upstream commit da107398cbd4bbdb6bffecb2ce86d5c9384f4cec ] nft_queue is always used from userspace nftables to deliver the NF_QUEUE verdict. Immediately emitting an NF_QUEUE verdict is never used by the userspace nft tools, so reject immediate NF_QUEUE verdicts. The arp family does not provide queue support, but such an immediate verdict is still reachable. Globally reject NF_QUEUE immediate verdicts to address this issue. Fixes: f342de4e2f33 ("netfilter: nf_tables: reject QUEUE/DROP verdict parameters") Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/netfilter/nf_tables_api.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index a6a7fe216396d..5b25b032e285d 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -11833,8 +11833,6 @@ static int nft_verdict_init(const struct nft_ctx *ctx, struct nft_data *data, switch (data->verdict.code) { case NF_ACCEPT: case NF_DROP: - case NF_QUEUE: - break; case NFT_CONTINUE: case NFT_BREAK: case NFT_RETURN: @@ -11869,6 +11867,11 @@ static int nft_verdict_init(const struct nft_ctx *ctx, struct nft_data *data, data->verdict.chain = chain; break; + case NF_QUEUE: + /* The nft_queue expression is used for this purpose, an + * immediate NF_QUEUE verdict should not ever be seen here. + */ + fallthrough; default: return -EINVAL; } -- 2.53.0