Blame SOURCES/0015-xtables-monitor-Fix-segfault-when-tracing.patch

621646
From 6857a112296dee96966212a88bf671bd76467d95 Mon Sep 17 00:00:00 2001
621646
From: Phil Sutter <psutter@redhat.com>
621646
Date: Mon, 24 Feb 2020 16:14:16 +0100
621646
Subject: [PATCH] xtables-monitor: Fix segfault when tracing
621646
621646
This is a minimal fix extracted from upstream commit d0446ab11182f
621646
("xtables: Review nft_init()") which was deemed too untrusive for late
621646
inclusion into RHEL8.2.
621646
621646
(cherry picked from commit e6445667fd0f141ca301aeabeee312545dbf014a)
621646
Signed-off-by: Phil Sutter <psutter@redhat.com>
621646
---
621646
 iptables/xtables-monitor.c | 7 ++++++-
621646
 1 file changed, 6 insertions(+), 1 deletion(-)
621646
621646
diff --git a/iptables/xtables-monitor.c b/iptables/xtables-monitor.c
621646
index a5245d1422af9..737c35f2ac60c 100644
621646
--- a/iptables/xtables-monitor.c
621646
+++ b/iptables/xtables-monitor.c
621646
@@ -595,7 +595,9 @@ int xtables_monitor_main(int argc, char *argv[])
621646
 	struct mnl_socket *nl;
621646
 	char buf[MNL_SOCKET_BUFFER_SIZE];
621646
 	uint32_t nfgroup = 0;
621646
-	struct nft_handle h = {};
621646
+	struct nft_handle h = {
621646
+		.family = AF_INET,
621646
+	};
621646
 	struct cb_arg cb_arg = {
621646
 		.h = &h,
621646
 	};
621646
@@ -622,6 +624,9 @@ int xtables_monitor_main(int argc, char *argv[])
621646
 			strerror(errno));
621646
 		exit(EXIT_FAILURE);
621646
 	}
621646
+	h.ops = nft_family_ops_lookup(h.family);
621646
+	if (!h.ops)
621646
+		xtables_error(PARAMETER_PROBLEM, "Unknown family");
621646
 
621646
 	opterr = 0;
621646
 	while ((c = getopt_long(argc, argv, "ceht46V", options, NULL)) != -1) {
621646
-- 
621646
2.25.1
621646