]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Aug 2014 18:05:52 +0000 (11:05 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Aug 2014 18:05:52 +0000 (11:05 -0700)
added patches:
lib-btree.c-fix-leak-of-whole-btree-nodes.patch
net-l2tp-don-t-fall-back-on-udp-sockopt.patch

queue-3.10/lib-btree.c-fix-leak-of-whole-btree-nodes.patch [new file with mode: 0644]
queue-3.10/net-l2tp-don-t-fall-back-on-udp-sockopt.patch [new file with mode: 0644]
queue-3.10/series

diff --git a/queue-3.10/lib-btree.c-fix-leak-of-whole-btree-nodes.patch b/queue-3.10/lib-btree.c-fix-leak-of-whole-btree-nodes.patch
new file mode 100644 (file)
index 0000000..0ed9ffe
--- /dev/null
@@ -0,0 +1,47 @@
+From c75b53af2f0043aff500af0a6f878497bef41bca Mon Sep 17 00:00:00 2001
+From: Minfei Huang <huangminfei@ucloud.cn>
+Date: Wed, 4 Jun 2014 16:11:53 -0700
+Subject: lib/btree.c: fix leak of whole btree nodes
+
+From: Minfei Huang <huangminfei@ucloud.cn>
+
+commit c75b53af2f0043aff500af0a6f878497bef41bca upstream.
+
+I use btree from 3.14-rc2 in my own module.  When the btree module is
+removed, a warning arises:
+
+ kmem_cache_destroy btree_node: Slab cache still has objects
+ CPU: 13 PID: 9150 Comm: rmmod Tainted: GF          O 3.14.0-rc2 #1
+ Hardware name: Inspur NF5270M3/NF5270M3, BIOS CHEETAH_2.1.3 09/10/2013
+ Call Trace:
+   dump_stack+0x49/0x5d
+   kmem_cache_destroy+0xcf/0xe0
+   btree_module_exit+0x10/0x12 [btree]
+   SyS_delete_module+0x198/0x1f0
+   system_call_fastpath+0x16/0x1b
+
+The cause is that it doesn't release the last btree node, when height = 1
+and fill = 1.
+
+[akpm@linux-foundation.org: remove unneeded test of NULL]
+Signed-off-by: Minfei Huang <huangminfei@ucloud.cn>
+Cc: Joern Engel <joern@logfs.org>
+Cc: Johannes Berg <johannes@sipsolutions.net>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ lib/btree.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/lib/btree.c
++++ b/lib/btree.c
+@@ -198,6 +198,7 @@ EXPORT_SYMBOL_GPL(btree_init);
+ void btree_destroy(struct btree_head *head)
+ {
++      mempool_free(head->node, head->mempool);
+       mempool_destroy(head->mempool);
+       head->mempool = NULL;
+ }
diff --git a/queue-3.10/net-l2tp-don-t-fall-back-on-udp-sockopt.patch b/queue-3.10/net-l2tp-don-t-fall-back-on-udp-sockopt.patch
new file mode 100644 (file)
index 0000000..54aa7f8
--- /dev/null
@@ -0,0 +1,54 @@
+From 3cf521f7dc87c031617fd47e4b7aa2593c2f3daf Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sasha.levin@oracle.com>
+Date: Mon, 14 Jul 2014 17:02:31 -0700
+Subject: net/l2tp: don't fall back on UDP [get|set]sockopt
+
+From: Sasha Levin <sasha.levin@oracle.com>
+
+commit 3cf521f7dc87c031617fd47e4b7aa2593c2f3daf upstream.
+
+The l2tp [get|set]sockopt() code has fallen back to the UDP functions
+for socket option levels != SOL_PPPOL2TP since day one, but that has
+never actually worked, since the l2tp socket isn't an inet socket.
+
+As David Miller points out:
+
+  "If we wanted this to work, it'd have to look up the tunnel and then
+   use tunnel->sk, but I wonder how useful that would be"
+
+Since this can never have worked so nobody could possibly have depended
+on that functionality, just remove the broken code and return -EINVAL.
+
+Reported-by: Sasha Levin <sasha.levin@oracle.com>
+Acked-by: James Chapman <jchapman@katalix.com>
+Acked-by: David Miller <davem@davemloft.net>
+Cc: Phil Turnbull <phil.turnbull@oracle.com>
+Cc: Vegard Nossum <vegard.nossum@oracle.com>
+Cc: Willy Tarreau <w@1wt.eu>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/l2tp/l2tp_ppp.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/net/l2tp/l2tp_ppp.c
++++ b/net/l2tp/l2tp_ppp.c
+@@ -1365,7 +1365,7 @@ static int pppol2tp_setsockopt(struct so
+       int err;
+       if (level != SOL_PPPOL2TP)
+-              return udp_prot.setsockopt(sk, level, optname, optval, optlen);
++              return -EINVAL;
+       if (optlen < sizeof(int))
+               return -EINVAL;
+@@ -1491,7 +1491,7 @@ static int pppol2tp_getsockopt(struct so
+       struct pppol2tp_session *ps;
+       if (level != SOL_PPPOL2TP)
+-              return udp_prot.getsockopt(sk, level, optname, optval, optlen);
++              return -EINVAL;
+       if (get_user(len, optlen))
+               return -EFAULT;
index c3597d3472c65f587e3e39419ed8ce09f78229cf..00acf30355ef3255e49b9a6a439d2bef23662f07 100644 (file)
@@ -22,3 +22,5 @@ net-mvneta-use-per_cpu-stats-to-fix-an-smp-lock-up.patch
 net-mvneta-do-not-schedule-in-mvneta_tx_timeout.patch
 net-mvneta-add-missing-bit-descriptions-for-interrupt-masks-and-causes.patch
 net-mvneta-replace-tx-timer-with-a-real-interrupt.patch
+net-l2tp-don-t-fall-back-on-udp-sockopt.patch
+lib-btree.c-fix-leak-of-whole-btree-nodes.patch