Blame SOURCES/CVE-2022-34918.patch

7772de
From 4dbabad13fa5c506138d15506f220006cde28d30 Mon Sep 17 00:00:00 2001
7772de
From: Linqing Lu <lilu@redhat.com>
7772de
Date: Thu, 4 Aug 2022 16:36:13 -0400
7772de
Subject: [KPATCH CVE-2022-34918] kpatch fixes for CVE-2022-34918
7772de
7772de
Kernels:
7772de
5.14.0-70.13.1.el9_0
7772de
5.14.0-70.17.1.el9_0
7772de
7772de
7772de
Kpatch-MR: https://gitlab.com/redhat/prdsc/rhel/src/kpatch/rhel-9/-/merge_requests/4
7772de
Approved-by: Joe Lawrence (@joe.lawrence)
7772de
Changes since last build:
7772de
arches: x86_64 ppc64le
7772de
nf_tables_api.o: changed function: nft_add_set_elem
7772de
---------------------------
7772de
7772de
Modifications: none
7772de
7772de
commit 6fd61750c2355e23d4cb1b1d9de297b884076a06
7772de
Author: Florian Westphal <fwestpha@redhat.com>
7772de
Date:   Mon Jul 4 08:12:40 2022 +0200
7772de
7772de
    netfilter: nf_tables: stricter validation of element data
7772de
7772de
    Bugzilla: https://bugzilla.redhat.com/2104591
7772de
    CVE: CVE-2022-34918
7772de
    Y-Commit: 42087f51a09378ae5fa93d3bea82b4883f983e57
7772de
7772de
    O-Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2104592
7772de
    Upstream Status: commit 7e6bc1f6cabc
7772de
    O-CVE: CVE-2022-34918
7772de
7772de
    commit 7e6bc1f6cabcd30aba0b11219d8e01b952eacbb6
7772de
    Author: Pablo Neira Ayuso <pablo@netfilter.org>
7772de
    Date:   Sat Jul 2 04:16:30 2022 +0200
7772de
7772de
        netfilter: nf_tables: stricter validation of element data
7772de
7772de
        Make sure element data type and length do not mismatch the one specified
7772de
        by the set declaration.
7772de
7772de
        Fixes: 7d7402642eaf ("netfilter: nf_tables: variable sized set element keys / data")
7772de
        Reported-by: Hugues ANGUELKOV <hanguelkov@randorisec.fr>
7772de
        Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
7772de
7772de
    Signed-off-by: Florian Westphal <fwestpha@redhat.com>
7772de
    Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
7772de
7772de
Signed-off-by: Linqing Lu <lilu@redhat.com>
7772de
---
7772de
 net/netfilter/nf_tables_api.c | 9 ++++++++-
7772de
 1 file changed, 8 insertions(+), 1 deletion(-)
7772de
7772de
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
7772de
index d495e10044dc..741a4e937e6f 100644
7772de
--- a/net/netfilter/nf_tables_api.c
7772de
+++ b/net/netfilter/nf_tables_api.c
7772de
@@ -5094,13 +5094,20 @@ static int nft_setelem_parse_data(struct nft_ctx *ctx, struct nft_set *set,
7772de
 				  struct nft_data *data,
7772de
 				  struct nlattr *attr)
7772de
 {
7772de
+	u32 dtype;
7772de
 	int err;
7772de
 
7772de
 	err = nft_data_init(ctx, data, NFT_DATA_VALUE_MAXLEN, desc, attr);
7772de
 	if (err < 0)
7772de
 		return err;
7772de
 
7772de
-	if (desc->type != NFT_DATA_VERDICT && desc->len != set->dlen) {
7772de
+	if (set->dtype == NFT_DATA_VERDICT)
7772de
+		dtype = NFT_DATA_VERDICT;
7772de
+	else
7772de
+		dtype = NFT_DATA_VALUE;
7772de
+
7772de
+	if (dtype != desc->type ||
7772de
+	    set->dlen != desc->len) {
7772de
 		nft_data_release(data, desc->type);
7772de
 		return -EINVAL;
7772de
 	}
7772de
-- 
7772de
2.37.2
7772de
7772de