From: Greg Kroah-Hartman Date: Tue, 5 Aug 2014 18:05:52 +0000 (-0700) Subject: 3.10-stable patches X-Git-Tag: v3.4.102~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bcb88325c4994a52dd65177eaccd40f657358e20;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches added patches: lib-btree.c-fix-leak-of-whole-btree-nodes.patch net-l2tp-don-t-fall-back-on-udp-sockopt.patch --- 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 index 00000000000..0ed9ffea432 --- /dev/null +++ b/queue-3.10/lib-btree.c-fix-leak-of-whole-btree-nodes.patch @@ -0,0 +1,47 @@ +From c75b53af2f0043aff500af0a6f878497bef41bca Mon Sep 17 00:00:00 2001 +From: Minfei Huang +Date: Wed, 4 Jun 2014 16:11:53 -0700 +Subject: lib/btree.c: fix leak of whole btree nodes + +From: Minfei Huang + +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 +Cc: Joern Engel +Cc: Johannes Berg +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..54aa7f8e2ab --- /dev/null +++ b/queue-3.10/net-l2tp-don-t-fall-back-on-udp-sockopt.patch @@ -0,0 +1,54 @@ +From 3cf521f7dc87c031617fd47e4b7aa2593c2f3daf Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 14 Jul 2014 17:02:31 -0700 +Subject: net/l2tp: don't fall back on UDP [get|set]sockopt + +From: Sasha Levin + +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 +Acked-by: James Chapman +Acked-by: David Miller +Cc: Phil Turnbull +Cc: Vegard Nossum +Cc: Willy Tarreau +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + 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; diff --git a/queue-3.10/series b/queue-3.10/series index c3597d3472c..00acf30355e 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -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