]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 2 May 2015 18:42:32 +0000 (20:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 2 May 2015 18:42:32 +0000 (20:42 +0200)
added patches:
netfilter-bridge-really-save-frag_max_size-between-pre-and-post_routing.patch
netfilter-x_tables-fix-cgroup-matching-on-non-full-sks.patch

queue-3.19/netfilter-bridge-really-save-frag_max_size-between-pre-and-post_routing.patch [new file with mode: 0644]
queue-3.19/netfilter-x_tables-fix-cgroup-matching-on-non-full-sks.patch [new file with mode: 0644]
queue-3.19/series

diff --git a/queue-3.19/netfilter-bridge-really-save-frag_max_size-between-pre-and-post_routing.patch b/queue-3.19/netfilter-bridge-really-save-frag_max_size-between-pre-and-post_routing.patch
new file mode 100644 (file)
index 0000000..ebb9258
--- /dev/null
@@ -0,0 +1,54 @@
+From 0b67c43ce36a9964f1d5e3f973ee19eefd3f9f8f Mon Sep 17 00:00:00 2001
+From: Florian Westphal <fw@strlen.de>
+Date: Wed, 1 Apr 2015 22:36:27 +0200
+Subject: netfilter: bridge: really save frag_max_size between PRE and POST_ROUTING
+
+From: Florian Westphal <fw@strlen.de>
+
+commit 0b67c43ce36a9964f1d5e3f973ee19eefd3f9f8f upstream.
+
+We also need to save/store in forward, else br_parse_ip_options call
+will zero frag_max_size as well.
+
+Fixes: 93fdd47e5 ('bridge: Save frag_max_size between PRE_ROUTING and POST_ROUTING')
+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/bridge/br_netfilter.c |   17 +++++++++++++++--
+ 1 file changed, 15 insertions(+), 2 deletions(-)
+
+--- a/net/bridge/br_netfilter.c
++++ b/net/bridge/br_netfilter.c
+@@ -651,6 +651,13 @@ static int br_nf_forward_finish(struct s
+       struct net_device *in;
+       if (!IS_ARP(skb) && !IS_VLAN_ARP(skb)) {
++              int frag_max_size;
++
++              if (skb->protocol == htons(ETH_P_IP)) {
++                      frag_max_size = IPCB(skb)->frag_max_size;
++                      BR_INPUT_SKB_CB(skb)->frag_max_size = frag_max_size;
++              }
++
+               in = nf_bridge->physindev;
+               if (nf_bridge->mask & BRNF_PKT_TYPE) {
+                       skb->pkt_type = PACKET_OTHERHOST;
+@@ -710,8 +717,14 @@ static unsigned int br_nf_forward_ip(con
+               nf_bridge->mask |= BRNF_PKT_TYPE;
+       }
+-      if (pf == NFPROTO_IPV4 && br_parse_ip_options(skb))
+-              return NF_DROP;
++      if (pf == NFPROTO_IPV4) {
++              int frag_max = BR_INPUT_SKB_CB(skb)->frag_max_size;
++
++              if (br_parse_ip_options(skb))
++                      return NF_DROP;
++
++              IPCB(skb)->frag_max_size = frag_max;
++      }
+       /* The physdev module checks on this */
+       nf_bridge->mask |= BRNF_BRIDGED;
diff --git a/queue-3.19/netfilter-x_tables-fix-cgroup-matching-on-non-full-sks.patch b/queue-3.19/netfilter-x_tables-fix-cgroup-matching-on-non-full-sks.patch
new file mode 100644 (file)
index 0000000..f4b22f1
--- /dev/null
@@ -0,0 +1,43 @@
+From afb7718016fcb0370ac29a83b2839c78b76c2960 Mon Sep 17 00:00:00 2001
+From: Daniel Borkmann <daniel@iogearbox.net>
+Date: Fri, 27 Mar 2015 19:37:41 +0100
+Subject: netfilter: x_tables: fix cgroup matching on non-full sks
+
+From: Daniel Borkmann <daniel@iogearbox.net>
+
+commit afb7718016fcb0370ac29a83b2839c78b76c2960 upstream.
+
+While originally only being intended for outgoing traffic, commit
+a00e76349f35 ("netfilter: x_tables: allow to use cgroup match for
+LOCAL_IN nf hooks") enabled xt_cgroups for the NF_INET_LOCAL_IN hook
+as well, in order to allow for nfacct accounting.
+
+Besides being currently limited to early demuxes only, commit
+a00e76349f35 forgot to add a check if we deal with full sockets,
+i.e. in this case not with time wait sockets. TCP time wait sockets
+do not have the same memory layout as full sockets, a lower memory
+footprint and consequently also don't have a sk_classid member;
+probing for sk_classid member there could potentially lead to a
+crash.
+
+Fixes: a00e76349f35 ("netfilter: x_tables: allow to use cgroup match for LOCAL_IN nf hooks")
+Cc: Alexey Perevalov <a.perevalov@samsung.com>
+Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/netfilter/xt_cgroup.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/net/netfilter/xt_cgroup.c
++++ b/net/netfilter/xt_cgroup.c
+@@ -39,7 +39,7 @@ cgroup_mt(const struct sk_buff *skb, str
+ {
+       const struct xt_cgroup_info *info = par->matchinfo;
+-      if (skb->sk == NULL)
++      if (skb->sk == NULL || !sk_fullsock(skb->sk))
+               return false;
+       return (info->id == skb->sk->sk_classid) ^ info->invert;
index 0de49efacb69793a15e2cd4a1246f3286087cf35..80c910da55ce4f60164629cca459c54207ff2267 100644 (file)
@@ -174,3 +174,5 @@ c6x-time-ensure-consistency-in-__init.patch
 memstick-mspro_block-add-missing-curly-braces.patch
 drivers-platform-parse-irq-flags-from-resources.patch
 driver-core-bus-goto-appropriate-labels-on-failure-in-bus_add_device.patch
+netfilter-x_tables-fix-cgroup-matching-on-non-full-sks.patch
+netfilter-bridge-really-save-frag_max_size-between-pre-and-post_routing.patch