From: Greg Kroah-Hartman Date: Tue, 5 Aug 2014 18:06:05 +0000 (-0700) Subject: 3.4-stable patches X-Git-Tag: v3.4.102~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1acebbb7c7045bd85265842a82f6241b7dce4f83;p=thirdparty%2Fkernel%2Fstable-queue.git 3.4-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.4/lib-btree.c-fix-leak-of-whole-btree-nodes.patch b/queue-3.4/lib-btree.c-fix-leak-of-whole-btree-nodes.patch new file mode 100644 index 00000000000..0ed9ffea432 --- /dev/null +++ b/queue-3.4/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.4/net-l2tp-don-t-fall-back-on-udp-sockopt.patch b/queue-3.4/net-l2tp-don-t-fall-back-on-udp-sockopt.patch new file mode 100644 index 00000000000..6c0905d1d7f --- /dev/null +++ b/queue-3.4/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 +@@ -1351,7 +1351,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; +@@ -1477,7 +1477,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, (int __user *) optlen)) + return -EFAULT; diff --git a/queue-3.4/series b/queue-3.4/series index 2a3035c4c8b..861398939ce 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -12,3 +12,5 @@ x86-espfix-make-espfix64-a-kconfig-option-fix-uml.patch x86-espfix-make-it-possible-to-disable-16-bit-support.patch x86_64-entry-xen-do-not-invoke-espfix64-on-xen.patch revert-net-ip-ipv6-handle-gso-skbs-in-forwarding-path.patch +net-l2tp-don-t-fall-back-on-udp-sockopt.patch +lib-btree.c-fix-leak-of-whole-btree-nodes.patch