|
|
9a3fa7 |
From e4dd398938aed75397463aed36fc03f9d754bf29 Mon Sep 17 00:00:00 2001
|
|
|
9a3fa7 |
From: Phil Sutter <psutter@redhat.com>
|
|
|
9a3fa7 |
Date: Fri, 15 Mar 2019 17:51:28 +0100
|
|
|
9a3fa7 |
Subject: [PATCH] libxtables: Check extension real_name length
|
|
|
9a3fa7 |
|
|
|
9a3fa7 |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1525980
|
|
|
9a3fa7 |
Upstream Status: iptables commit a3716cc1a501e
|
|
|
9a3fa7 |
|
|
|
9a3fa7 |
commit a3716cc1a501e40e26a96d78b2e1285bb081f366
|
|
|
9a3fa7 |
Author: Phil Sutter <phil@nwl.cc>
|
|
|
9a3fa7 |
Date: Mon Sep 24 19:25:21 2018 +0200
|
|
|
9a3fa7 |
|
|
|
9a3fa7 |
libxtables: Check extension real_name length
|
|
|
9a3fa7 |
|
|
|
9a3fa7 |
Just like with 'name', if given check 'real_name' to not exceed max length.
|
|
|
9a3fa7 |
|
|
|
9a3fa7 |
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
|
9a3fa7 |
Signed-off-by: Florian Westphal <fw@strlen.de>
|
|
|
9a3fa7 |
|
|
|
9a3fa7 |
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
|
|
9a3fa7 |
---
|
|
|
9a3fa7 |
libxtables/xtables.c | 12 ++++++++++++
|
|
|
9a3fa7 |
1 file changed, 12 insertions(+)
|
|
|
9a3fa7 |
|
|
|
9a3fa7 |
diff --git a/libxtables/xtables.c b/libxtables/xtables.c
|
|
|
9a3fa7 |
index 575f7ee0a0d78..4a014e48a9f45 100644
|
|
|
9a3fa7 |
--- a/libxtables/xtables.c
|
|
|
9a3fa7 |
+++ b/libxtables/xtables.c
|
|
|
9a3fa7 |
@@ -839,6 +839,12 @@ void xtables_register_match(struct xtables_match *me)
|
|
|
9a3fa7 |
exit(1);
|
|
|
9a3fa7 |
}
|
|
|
9a3fa7 |
|
|
|
9a3fa7 |
+ if (me->real_name && strlen(me->real_name) >= XT_EXTENSION_MAXNAMELEN) {
|
|
|
9a3fa7 |
+ fprintf(stderr, "%s: match `%s' has invalid real name\n",
|
|
|
9a3fa7 |
+ xt_params->program_name, me->real_name);
|
|
|
9a3fa7 |
+ exit(1);
|
|
|
9a3fa7 |
+ }
|
|
|
9a3fa7 |
+
|
|
|
9a3fa7 |
if (me->family >= NPROTO) {
|
|
|
9a3fa7 |
fprintf(stderr,
|
|
|
9a3fa7 |
"%s: BUG: match %s has invalid protocol family\n",
|
|
|
9a3fa7 |
@@ -997,6 +1003,12 @@ void xtables_register_target(struct xtables_target *me)
|
|
|
9a3fa7 |
exit(1);
|
|
|
9a3fa7 |
}
|
|
|
9a3fa7 |
|
|
|
9a3fa7 |
+ if (me->real_name && strlen(me->real_name) >= XT_EXTENSION_MAXNAMELEN) {
|
|
|
9a3fa7 |
+ fprintf(stderr, "%s: target `%s' has invalid real name\n",
|
|
|
9a3fa7 |
+ xt_params->program_name, me->real_name);
|
|
|
9a3fa7 |
+ exit(1);
|
|
|
9a3fa7 |
+ }
|
|
|
9a3fa7 |
+
|
|
|
9a3fa7 |
if (me->family >= NPROTO) {
|
|
|
9a3fa7 |
fprintf(stderr,
|
|
|
9a3fa7 |
"%s: BUG: target %s has invalid protocol family\n",
|
|
|
9a3fa7 |
--
|
|
|
9a3fa7 |
2.21.0
|
|
|
9a3fa7 |
|