]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.6-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Jun 2016 21:47:51 +0000 (14:47 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Jun 2016 21:47:51 +0000 (14:47 -0700)
added patches:
netfilter-x_tables-don-t-reject-valid-target-size-on-some-architectures.patch

queue-4.6/netfilter-x_tables-don-t-reject-valid-target-size-on-some-architectures.patch [new file with mode: 0644]
queue-4.6/series

diff --git a/queue-4.6/netfilter-x_tables-don-t-reject-valid-target-size-on-some-architectures.patch b/queue-4.6/netfilter-x_tables-don-t-reject-valid-target-size-on-some-architectures.patch
new file mode 100644 (file)
index 0000000..5bc3b40
--- /dev/null
@@ -0,0 +1,59 @@
+From 7b7eba0f3515fca3296b8881d583f7c1042f5226 Mon Sep 17 00:00:00 2001
+From: Florian Westphal <fw@strlen.de>
+Date: Wed, 1 Jun 2016 02:04:44 +0200
+Subject: netfilter: x_tables: don't reject valid target size on some architectures
+
+From: Florian Westphal <fw@strlen.de>
+
+commit 7b7eba0f3515fca3296b8881d583f7c1042f5226 upstream.
+
+Quoting John Stultz:
+  In updating a 32bit arm device from 4.6 to Linus' current HEAD, I
+  noticed I was having some trouble with networking, and realized that
+  /proc/net/ip_tables_names was suddenly empty.
+  Digging through the registration process, it seems we're catching on the:
+
+   if (strcmp(t->u.user.name, XT_STANDARD_TARGET) == 0 &&
+       target_offset + sizeof(struct xt_standard_target) != next_offset)
+         return -EINVAL;
+
+  Where next_offset seems to be 4 bytes larger then the
+  offset + standard_target struct size.
+
+next_offset needs to be aligned via XT_ALIGN (so we can access all members
+of ip(6)t_entry struct).
+
+This problem didn't show up on i686 as it only needs 4-byte alignment for
+u64, but iptables userspace on other 32bit arches does insert extra padding.
+
+Reported-by: John Stultz <john.stultz@linaro.org>
+Tested-by: John Stultz <john.stultz@linaro.org>
+Fixes: 7ed2abddd20cf ("netfilter: x_tables: check standard target size too")
+Signed-off-by: Florian Westphal <fw@strlen.de>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/netfilter/x_tables.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/net/netfilter/x_tables.c
++++ b/net/netfilter/x_tables.c
+@@ -609,7 +609,7 @@ int xt_compat_check_entry_offsets(const
+               return -EINVAL;
+       if (strcmp(t->u.user.name, XT_STANDARD_TARGET) == 0 &&
+-          target_offset + sizeof(struct compat_xt_standard_target) != next_offset)
++          COMPAT_XT_ALIGN(target_offset + sizeof(struct compat_xt_standard_target)) != next_offset)
+               return -EINVAL;
+       /* compat_xt_entry match has less strict aligment requirements,
+@@ -691,7 +691,7 @@ int xt_check_entry_offsets(const void *b
+               return -EINVAL;
+       if (strcmp(t->u.user.name, XT_STANDARD_TARGET) == 0 &&
+-          target_offset + sizeof(struct xt_standard_target) != next_offset)
++          XT_ALIGN(target_offset + sizeof(struct xt_standard_target)) != next_offset)
+               return -EINVAL;
+       return xt_check_entry_match(elems, base + target_offset,
index 337b7842fe292857c848145b34c21a73d3af3318..050bff07f0c2b6b7127865c384ae687ecd11fc87 100644 (file)
@@ -77,3 +77,4 @@ netfilter-x_tables-add-compat-version-of-xt_check_entry_offsets.patch
 netfilter-x_tables-check-standard-target-size-too.patch
 netfilter-x_tables-check-for-bogus-target-offset.patch
 netfilter-x_tables-validate-all-offsets-and-sizes-in-a-rule.patch
+netfilter-x_tables-don-t-reject-valid-target-size-on-some-architectures.patch