Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4718174pxb; Thu, 14 Oct 2021 10:32:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHDquwJPgz/YVDRCIqs7rK6tDBWGkHoYkqA9UjrZj/cAk7Fwncy753vAXPj8r6BVdDLKO1 X-Received: by 2002:a62:ce07:0:b0:44c:fef2:e410 with SMTP id y7-20020a62ce07000000b0044cfef2e410mr6591405pfg.71.1634232735045; Thu, 14 Oct 2021 10:32:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634232735; cv=none; d=google.com; s=arc-20160816; b=VGcHl63Kksvaiy//cvUkd89pdXd9YpMrFMtsy+A8fhXiPu09cc3Dj3yecXnuRxkozM xkxGUrmDwSfgqSkLr6dY2WWUtsuI4ZUbFmi3YXkD4bODtrx5arWaVUFQrw0iyQ/SvvSY Y4xeBzczHS/KYh7+yHpkPNfN9i9uve+TNrzIn892jxYZ3gyEQjXfhN0Msq4BjYy5rwEK 0gv7KowkrONpZipVOLZZS+puTgWvpYR6OgKYuRAaQwI68MTWFPrZC0A1GvueAQWeT3ZX KpehXN+GKnMDv6t8WP2MiOqBnY6C0l+mYnX995cdrbZa8wRMRqjWNGwBE1Ps96gRmsi+ VKOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gJu9T+2o82b/qgJVRqnmFe653UAQ2dG5PKHGFsdXRnk=; b=phJJJYV+IFobYaqpb0wE2ryUKo+ahhnclITj4VMQILn18RArK+G/vrhtanf0Q8usGB t6hin1ggUvXRiAQZL1zqkyO4pkq0wQvgMJyBWttMhEthLjQaWGeS/UL9e2N8M8/mjP62 f1+U2bBXgAILqSGa8++oX+IhtCWfc1CgaRBuwAy9ubTkiln6zQULU6H94wmG+VxaAvD9 BW2cALDsn/SLzSv+RH11xESebFVM1ot3fqQTZTbXI2Z5VbkfpCx9+GeG6cm0bw+EYVxz 0vWDPY7QRkkId54Z+1p67wU0NdUgZBk24p/YwVgpnfLCy70ie/cOVHjrrHUx6ekjcop/ 0Xkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Kdc5WPQm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d18si4353133plr.345.2021.10.14.10.32.01; Thu, 14 Oct 2021 10:32:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Kdc5WPQm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233022AbhJNPCZ (ORCPT + 99 others); Thu, 14 Oct 2021 11:02:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:44250 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231817AbhJNPAw (ORCPT ); Thu, 14 Oct 2021 11:00:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C8CDB610D1; Thu, 14 Oct 2021 14:58:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634223507; bh=Gx3xEh8JO3e1CawjKkN9jI/dAj0HL0xZ0aKWmSuBrJs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Kdc5WPQmfaaIp0QngHjTktuziMsM/p8TCDk3KNrmE8jijIcKn7/60MlK4E3rgGlRH Z9zv8to3cVmXxm+6dwJkpMVagNE2CW5k3x3nRbyNkmcA16w8UKq8yvpQW1HwyEdA2M YxnWCJ5lZSptRQQ+tstuNBsW8z9Ltu3tN0uT1SfQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jeremy Sowden , Florian Westphal , Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 4.19 03/12] netfilter: ip6_tables: zero-initialize fragment offset Date: Thu, 14 Oct 2021 16:54:03 +0200 Message-Id: <20211014145206.673259193@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211014145206.566123760@linuxfoundation.org> References: <20211014145206.566123760@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jeremy Sowden [ Upstream commit 310e2d43c3ad429c1fba4b175806cf1f55ed73a6 ] ip6tables only sets the `IP6T_F_PROTO` flag on a rule if a protocol is specified (`-p tcp`, for example). However, if the flag is not set, `ip6_packet_match` doesn't call `ipv6_find_hdr` for the skb, in which case the fragment offset is left uninitialized and a garbage value is passed to each matcher. Signed-off-by: Jeremy Sowden Reviewed-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/ipv6/netfilter/ip6_tables.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index dd0c1073dc8e..d93490ac8275 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c @@ -276,6 +276,7 @@ ip6t_do_table(struct sk_buff *skb, * things we don't know, ie. tcp syn flag or ports). If the * rule is also a fragment-specific rule, non-fragments won't * match it. */ + acpar.fragoff = 0; acpar.hotdrop = false; acpar.state = state; -- 2.33.0