From 5a4f83b98c03b441df3d60583ff135ac69be3878 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 3 Jun 2014 23:03:14 -0700 Subject: [PATCH] 3.14-stable patches added patches: genirq-provide-irq_force_affinity-fallback-for-non-smp.patch pci-shpchp-check-bridge-s-secondary-not-primary-bus-speed.patch sysfs-make-sure-read-buffer-is-zeroed.patch --- ..._force_affinity-fallback-for-non-smp.patch | 48 ++++++++++++++++++ ...ge-s-secondary-not-primary-bus-speed.patch | 45 +++++++++++++++++ queue-3.14/series | 3 ++ ...ysfs-make-sure-read-buffer-is-zeroed.patch | 49 +++++++++++++++++++ 4 files changed, 145 insertions(+) create mode 100644 queue-3.14/genirq-provide-irq_force_affinity-fallback-for-non-smp.patch create mode 100644 queue-3.14/pci-shpchp-check-bridge-s-secondary-not-primary-bus-speed.patch create mode 100644 queue-3.14/sysfs-make-sure-read-buffer-is-zeroed.patch diff --git a/queue-3.14/genirq-provide-irq_force_affinity-fallback-for-non-smp.patch b/queue-3.14/genirq-provide-irq_force_affinity-fallback-for-non-smp.patch new file mode 100644 index 00000000000..7266fed7e7f --- /dev/null +++ b/queue-3.14/genirq-provide-irq_force_affinity-fallback-for-non-smp.patch @@ -0,0 +1,48 @@ +From 4c88d7f9b0d5fb0588c3386be62115cc2eaa8f9f Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Wed, 23 Apr 2014 14:49:17 +0200 +Subject: genirq: Provide irq_force_affinity fallback for non-SMP + +From: Arnd Bergmann + +commit 4c88d7f9b0d5fb0588c3386be62115cc2eaa8f9f upstream. + +Patch 01f8fa4f01d "genirq: Allow forcing cpu affinity of interrupts" added +an irq_force_affinity() function, and 30ccf03b4a6 "clocksource: Exynos_mct: +Use irq_force_affinity() in cpu bringup" subsequently uses it. However, the +driver can be used with CONFIG_SMP disabled, but the function declaration +is only available for CONFIG_SMP, leading to this build error: + +drivers/clocksource/exynos_mct.c:431:3: error: implicit declaration of function 'irq_force_affinity' [-Werror=implicit-function-declaration] + irq_force_affinity(mct_irqs[MCT_L0_IRQ + cpu], cpumask_of(cpu)); + +This patch introduces a dummy helper function for the non-SMP case +that always returns success, to get rid of the build error. +Since the patches causing the problem are marked for stable backports, +this one should be as well. + +Signed-off-by: Arnd Bergmann +Cc: Krzysztof Kozlowski +Acked-by: Kukjin Kim +Link: http://lkml.kernel.org/r/5619084.0zmrrIUZLV@wuerfel +Signed-off-by: Thomas Gleixner +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/interrupt.h | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/include/linux/interrupt.h ++++ b/include/linux/interrupt.h +@@ -271,6 +271,11 @@ static inline int irq_set_affinity(unsig + return -EINVAL; + } + ++static inline int irq_force_affinity(unsigned int irq, const struct cpumask *cpumask) ++{ ++ return 0; ++} ++ + static inline int irq_can_set_affinity(unsigned int irq) + { + return 0; diff --git a/queue-3.14/pci-shpchp-check-bridge-s-secondary-not-primary-bus-speed.patch b/queue-3.14/pci-shpchp-check-bridge-s-secondary-not-primary-bus-speed.patch new file mode 100644 index 00000000000..748663a3282 --- /dev/null +++ b/queue-3.14/pci-shpchp-check-bridge-s-secondary-not-primary-bus-speed.patch @@ -0,0 +1,45 @@ +From 93fa9d32670f5592c8e56abc9928fc194e1e72fc Mon Sep 17 00:00:00 2001 +From: Marcel Apfelbaum +Date: Thu, 15 May 2014 12:42:49 -0600 +Subject: PCI: shpchp: Check bridge's secondary (not primary) bus speed + +From: Marcel Apfelbaum + +commit 93fa9d32670f5592c8e56abc9928fc194e1e72fc upstream. + +When a new device is added below a hotplug bridge, the bridge's secondary +bus speed and the device's bus speed must match. The shpchp driver +previously checked the bridge's *primary* bus speed, not the secondary bus +speed. + +This caused hot-add errors like: + + shpchp 0000:00:03.0: Speed of bus ff and adapter 0 mismatch + +Check the secondary bus speed instead. + +[bhelgaas: changelog] +Link: https://bugzilla.kernel.org/show_bug.cgi?id=75251 +Fixes: 3749c51ac6c1 ("PCI: Make current and maximum bus speeds part of the PCI core") +Signed-off-by: Marcel Apfelbaum +Signed-off-by: Bjorn Helgaas +Acked-by: Michael S. Tsirkin +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pci/hotplug/shpchp_ctrl.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/pci/hotplug/shpchp_ctrl.c ++++ b/drivers/pci/hotplug/shpchp_ctrl.c +@@ -282,8 +282,8 @@ static int board_added(struct slot *p_sl + return WRONG_BUS_FREQUENCY; + } + +- bsp = ctrl->pci_dev->bus->cur_bus_speed; +- msp = ctrl->pci_dev->bus->max_bus_speed; ++ bsp = ctrl->pci_dev->subordinate->cur_bus_speed; ++ msp = ctrl->pci_dev->subordinate->max_bus_speed; + + /* Check if there are other slots or devices on the same bus */ + if (!list_empty(&ctrl->pci_dev->subordinate->devices)) diff --git a/queue-3.14/series b/queue-3.14/series index b9ae9c48139..65747e9a673 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -169,3 +169,6 @@ parisc-improve-lws-cas-performance.patch metag-fix-memory-barriers.patch metag-reduce-maximum-stack-size-to-256mb.patch x86-64-modify_ldt-make-support-for-16-bit-segments-a-runtime-option.patch +genirq-provide-irq_force_affinity-fallback-for-non-smp.patch +sysfs-make-sure-read-buffer-is-zeroed.patch +pci-shpchp-check-bridge-s-secondary-not-primary-bus-speed.patch diff --git a/queue-3.14/sysfs-make-sure-read-buffer-is-zeroed.patch b/queue-3.14/sysfs-make-sure-read-buffer-is-zeroed.patch new file mode 100644 index 00000000000..00580ef6078 --- /dev/null +++ b/queue-3.14/sysfs-make-sure-read-buffer-is-zeroed.patch @@ -0,0 +1,49 @@ +From f5c16f29bf5e57ba4051fc7785ba7f035f798c71 Mon Sep 17 00:00:00 2001 +From: Tejun Heo +Date: Mon, 19 May 2014 15:52:10 -0400 +Subject: sysfs: make sure read buffer is zeroed + +From: Tejun Heo + +commit f5c16f29bf5e57ba4051fc7785ba7f035f798c71 upstream. + +13c589d5b0ac ("sysfs: use seq_file when reading regular files") +switched sysfs from custom read implementation to seq_file to enable +later transition to kernfs. After the change, the buffer passed to +->show() is acquired through seq_get_buf(); unfortunately, this +introduces a subtle behavior change. Before the commit, the buffer +passed to ->show() was always zero as it was allocated using +get_zeroed_page(). Because seq_file doesn't clear buffers on +allocation and neither does seq_get_buf(), after the commit, depending +on the behavior of ->show(), we may end up exposing uninitialized data +to userland thus possibly altering userland visible behavior and +leaking information. + +Fix it by explicitly clearing the buffer. + +Signed-off-by: Tejun Heo +Reported-by: Ron +Fixes: 13c589d5b0ac ("sysfs: use seq_file when reading regular files") +Signed-off-by: Greg Kroah-Hartman + +--- + fs/sysfs/file.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/fs/sysfs/file.c ++++ b/fs/sysfs/file.c +@@ -47,12 +47,13 @@ static int sysfs_kf_seq_show(struct seq_ + ssize_t count; + char *buf; + +- /* acquire buffer and ensure that it's >= PAGE_SIZE */ ++ /* acquire buffer and ensure that it's >= PAGE_SIZE and clear */ + count = seq_get_buf(sf, &buf); + if (count < PAGE_SIZE) { + seq_commit(sf, -1); + return 0; + } ++ memset(buf, 0, PAGE_SIZE); + + /* + * Invoke show(). Control may reach here via seq file lseek even -- 2.47.3