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 C19941C03 for ; Mon, 20 Mar 2023 15:04:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42468C433EF; Mon, 20 Mar 2023 15:04:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1679324645; bh=pJHkMxkbcS/EwUEWHq2d0pwxMVfEWBl7/k9vY2s5nKE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Uf0lmqG48D/HJChds2Ln1kdH1XQF+ihDDO0bOxNzO8PJACvPzR7LhcBFfWx3+a1v5 hftUyMzfxCJlOIL/qAN84DQTyWaRdVwYV+O2WNv2C5NxGNao09UDDdli370oTvgt2u 8ozb3bDZ9WLKtcMxSLyAV3gFcMO15rkkYs84nJto= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jeremy Sowden , Florian Westphal , Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 5.15 010/115] netfilter: nft_masq: correct length for loading protocol registers Date: Mon, 20 Mar 2023 15:53:42 +0100 Message-Id: <20230320145449.797244197@linuxfoundation.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230320145449.336983711@linuxfoundation.org> References: <20230320145449.336983711@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Jeremy Sowden [ Upstream commit ec2c5917eb858428b2083d1c74f445aabbe8316b ] The values in the protocol registers are two bytes wide. However, when parsing the register loads, the code currently uses the larger 16-byte size of a `union nf_inet_addr`. Change it to use the (correct) size of a `union nf_conntrack_man_proto` instead. Fixes: 8a6bf5da1aef ("netfilter: nft_masq: support port range") Signed-off-by: Jeremy Sowden Reviewed-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/netfilter/nft_masq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/nft_masq.c b/net/netfilter/nft_masq.c index 9953e80537536..1818dbf089cad 100644 --- a/net/netfilter/nft_masq.c +++ b/net/netfilter/nft_masq.c @@ -43,7 +43,7 @@ static int nft_masq_init(const struct nft_ctx *ctx, const struct nft_expr *expr, const struct nlattr * const tb[]) { - u32 plen = sizeof_field(struct nf_nat_range, min_addr.all); + u32 plen = sizeof_field(struct nf_nat_range, min_proto.all); struct nft_masq *priv = nft_expr_priv(expr); int err; -- 2.39.2