naccyde / rpms / iproute

Forked from rpms/iproute 9 months ago
Clone

Blame SOURCES/0010-tc-m_xt-Prevent-a-segfault-in-libipt.patch

36cfb7
From 074062808c630f2efb55c7093d510b44a38e74e5 Mon Sep 17 00:00:00 2001
36cfb7
From: Phil Sutter <psutter@redhat.com>
36cfb7
Date: Thu, 14 Sep 2017 15:27:47 +0200
36cfb7
Subject: [PATCH] tc: m_xt: Prevent a segfault in libipt
36cfb7
36cfb7
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1465599
36cfb7
Upstream Status: iproute2.git commit f6fc1055e41a8
36cfb7
36cfb7
commit f6fc1055e41a8a924313c336b39b9ffe0c86938b
36cfb7
Author: Phil Sutter <psutter@redhat.com>
36cfb7
Date:   Tue May 23 15:40:57 2017 +0200
36cfb7
36cfb7
    tc: m_xt: Prevent a segfault in libipt
36cfb7
36cfb7
    This happens with NAT targets, such as SNAT, DNAT and MASQUERADE. These
36cfb7
    are still not usable with this patch, but at least tc doesn't crash
36cfb7
    anymore when one tries to use them.
36cfb7
36cfb7
    Signed-off-by: Phil Sutter <phil@nwl.cc>
36cfb7
---
36cfb7
 tc/m_xt.c | 5 ++++-
36cfb7
 1 file changed, 4 insertions(+), 1 deletion(-)
36cfb7
36cfb7
diff --git a/tc/m_xt.c b/tc/m_xt.c
e138d9
index e59df8e10afef..ad52d239caf61 100644
36cfb7
--- a/tc/m_xt.c
36cfb7
+++ b/tc/m_xt.c
36cfb7
@@ -146,6 +146,9 @@ static int parse_ipt(struct action_util *a, int *argc_p,
36cfb7
 		     char ***argv_p, int tca_id, struct nlmsghdr *n)
36cfb7
 {
36cfb7
 	struct xtables_target *m = NULL;
36cfb7
+#if XTABLES_VERSION_CODE >= 6
36cfb7
+	struct ipt_entry fw = {};
36cfb7
+#endif
36cfb7
 	struct rtattr *tail;
36cfb7
 
36cfb7
 	int c;
36cfb7
@@ -206,7 +209,7 @@ static int parse_ipt(struct action_util *a, int *argc_p,
36cfb7
 		default:
36cfb7
 #if XTABLES_VERSION_CODE >= 6
36cfb7
 			if (m != NULL && m->x6_parse != NULL) {
36cfb7
-				xtables_option_tpcall(c, argv, 0, m, NULL);
36cfb7
+				xtables_option_tpcall(c, argv, 0, m, &fw;;
36cfb7
 #else
36cfb7
 			if (m != NULL && m->parse != NULL) {
36cfb7
 				m->parse(c - m->option_offset, argv, 0,
36cfb7
-- 
e138d9
2.21.0
36cfb7