All of lore.kernel.org
 help / color / mirror / Atom feed
* [iproute PATCH] tc: m_xt: Prevent a segfault in libipt
@ 2017-05-23 13:40 Phil Sutter
  2017-05-31  0:38 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Phil Sutter @ 2017-05-23 13:40 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, Phil Sutter

From: Phil Sutter <psutter@redhat.com>

This happens with NAT targets, such as SNAT, DNAT and MASQUERADE. These
are still not usable with this patch, but at least tc doesn't crash
anymore when one tries to use them.

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 tc/m_xt.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tc/m_xt.c b/tc/m_xt.c
index e59df8e10afef..ad52d239caf61 100644
--- a/tc/m_xt.c
+++ b/tc/m_xt.c
@@ -146,6 +146,9 @@ static int parse_ipt(struct action_util *a, int *argc_p,
 		     char ***argv_p, int tca_id, struct nlmsghdr *n)
 {
 	struct xtables_target *m = NULL;
+#if XTABLES_VERSION_CODE >= 6
+	struct ipt_entry fw = {};
+#endif
 	struct rtattr *tail;
 
 	int c;
@@ -206,7 +209,7 @@ static int parse_ipt(struct action_util *a, int *argc_p,
 		default:
 #if XTABLES_VERSION_CODE >= 6
 			if (m != NULL && m->x6_parse != NULL) {
-				xtables_option_tpcall(c, argv, 0, m, NULL);
+				xtables_option_tpcall(c, argv, 0, m, &fw);
 #else
 			if (m != NULL && m->parse != NULL) {
 				m->parse(c - m->option_offset, argv, 0,
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [iproute PATCH] tc: m_xt: Prevent a segfault in libipt
  2017-05-23 13:40 [iproute PATCH] tc: m_xt: Prevent a segfault in libipt Phil Sutter
@ 2017-05-31  0:38 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2017-05-31  0:38 UTC (permalink / raw)
  To: Phil Sutter; +Cc: netdev, Phil Sutter

On Tue, 23 May 2017 15:40:57 +0200
Phil Sutter <phil@nwl.cc> wrote:

> From: Phil Sutter <psutter@redhat.com>
> 
> This happens with NAT targets, such as SNAT, DNAT and MASQUERADE. These
> are still not usable with this patch, but at least tc doesn't crash
> anymore when one tries to use them.
> 
> Signed-off-by: Phil Sutter <phil@nwl.cc>

Applied, thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-31  0:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-23 13:40 [iproute PATCH] tc: m_xt: Prevent a segfault in libipt Phil Sutter
2017-05-31  0:38 ` Stephen Hemminger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.