Blame SOURCES/0043-monitor-Fix-for-use-after-free-when-printing-map-ele.patch

cf8614
From 1490609a3d82e494168a390b34094bacc5e83c02 Mon Sep 17 00:00:00 2001
cf8614
From: Phil Sutter <psutter@redhat.com>
cf8614
Date: Tue, 18 May 2021 18:06:50 +0200
cf8614
Subject: [PATCH] monitor: Fix for use after free when printing map elements
cf8614
cf8614
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1919203
cf8614
Upstream Status: nftables commit 02174ffad484d
cf8614
cf8614
commit 02174ffad484d9711678e5d415c32307efc39857
cf8614
Author: Phil Sutter <phil@nwl.cc>
cf8614
Date:   Thu Jan 9 17:43:11 2020 +0100
cf8614
cf8614
    monitor: Fix for use after free when printing map elements
cf8614
cf8614
    When populating the dummy set, 'data' field must be cloned just like
cf8614
    'key' field.
cf8614
cf8614
    Fixes: 343a51702656a ("src: store expr, not dtype to track data in sets")
cf8614
    Signed-off-by: Phil Sutter <phil@nwl.cc>
cf8614
    Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
cf8614
---
cf8614
 src/monitor.c | 3 ++-
cf8614
 1 file changed, 2 insertions(+), 1 deletion(-)
cf8614
cf8614
diff --git a/src/monitor.c b/src/monitor.c
cf8614
index 7927b6f..142cc92 100644
cf8614
--- a/src/monitor.c
cf8614
+++ b/src/monitor.c
cf8614
@@ -401,7 +401,8 @@ static int netlink_events_setelem_cb(const struct nlmsghdr *nlh, int type,
cf8614
 	 */
cf8614
 	dummyset = set_alloc(monh->loc);
cf8614
 	dummyset->key = expr_clone(set->key);
cf8614
-	dummyset->data = set->data;
cf8614
+	if (set->data)
cf8614
+		dummyset->data = expr_clone(set->data);
cf8614
 	dummyset->flags = set->flags;
cf8614
 	dummyset->init = set_expr_alloc(monh->loc, set);
cf8614
 
cf8614
-- 
252916
2.31.1
cf8614