From: Greg Kroah-Hartman Date: Sat, 2 May 2015 18:25:20 +0000 (+0200) Subject: 4.0-stable patches X-Git-Tag: v3.10.77~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1207de3f7f03559c75c13361953aae1da2c4d0f5;p=thirdparty%2Fkernel%2Fstable-queue.git 4.0-stable patches added patches: driver-core-bus-goto-appropriate-labels-on-failure-in-bus_add_device.patch netfilter-x_tables-fix-cgroup-matching-on-non-full-sks.patch --- diff --git a/queue-4.0/driver-core-bus-goto-appropriate-labels-on-failure-in-bus_add_device.patch b/queue-4.0/driver-core-bus-goto-appropriate-labels-on-failure-in-bus_add_device.patch new file mode 100644 index 00000000000..3d330c03684 --- /dev/null +++ b/queue-4.0/driver-core-bus-goto-appropriate-labels-on-failure-in-bus_add_device.patch @@ -0,0 +1,39 @@ +From 1c34203a1496d1849ba978021b878b3447d433c8 Mon Sep 17 00:00:00 2001 +From: Junjie Mao +Date: Wed, 28 Jan 2015 10:02:44 +0800 +Subject: driver core: bus: Goto appropriate labels on failure in bus_add_device + +From: Junjie Mao + +commit 1c34203a1496d1849ba978021b878b3447d433c8 upstream. + +It is not necessary to call device_remove_groups() when device_add_groups() +fails. + +The group added by device_add_groups() should be removed if sysfs_create_link() +fails. + +Fixes: fa6fdb33b486 ("driver core: bus_type: add dev_groups") +Signed-off-by: Junjie Mao +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/base/bus.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/base/bus.c ++++ b/drivers/base/bus.c +@@ -515,11 +515,11 @@ int bus_add_device(struct device *dev) + goto out_put; + error = device_add_groups(dev, bus->dev_groups); + if (error) +- goto out_groups; ++ goto out_id; + error = sysfs_create_link(&bus->p->devices_kset->kobj, + &dev->kobj, dev_name(dev)); + if (error) +- goto out_id; ++ goto out_groups; + error = sysfs_create_link(&dev->kobj, + &dev->bus->p->subsys.kobj, "subsystem"); + if (error) diff --git a/queue-4.0/netfilter-x_tables-fix-cgroup-matching-on-non-full-sks.patch b/queue-4.0/netfilter-x_tables-fix-cgroup-matching-on-non-full-sks.patch new file mode 100644 index 00000000000..f4b22f14d48 --- /dev/null +++ b/queue-4.0/netfilter-x_tables-fix-cgroup-matching-on-non-full-sks.patch @@ -0,0 +1,43 @@ +From afb7718016fcb0370ac29a83b2839c78b76c2960 Mon Sep 17 00:00:00 2001 +From: Daniel Borkmann +Date: Fri, 27 Mar 2015 19:37:41 +0100 +Subject: netfilter: x_tables: fix cgroup matching on non-full sks + +From: Daniel Borkmann + +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 +Signed-off-by: Daniel Borkmann +Signed-off-by: Pablo Neira Ayuso +Signed-off-by: Greg Kroah-Hartman + +--- + 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; diff --git a/queue-4.0/series b/queue-4.0/series index ba87618185e..48d408930c3 100644 --- a/queue-4.0/series +++ b/queue-4.0/series @@ -216,3 +216,5 @@ crypto-omap-aes-fix-support-for-unequal-lengths.patch 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