From: Greg Kroah-Hartman Date: Mon, 14 Mar 2016 17:24:45 +0000 (-0700) Subject: 4.4-stable patches X-Git-Tag: v4.4.6~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=650cc06484af3701355d1d9e0267de00d91e4fc6;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: block-don-t-optimize-for-non-cloned-bio-in-bio_get_last_bvec.patch ld-version-fix-awk-regex-compile-failure.patch mips-fix-build-error-when-smp-is-used-without-gic.patch mips-smp.c-fix-uninitialised-temp_foreign_map.patch target-drop-incorrect-abort_task-put-for-completed-commands.patch --- diff --git a/queue-4.4/block-don-t-optimize-for-non-cloned-bio-in-bio_get_last_bvec.patch b/queue-4.4/block-don-t-optimize-for-non-cloned-bio-in-bio_get_last_bvec.patch new file mode 100644 index 00000000000..45e8fac79ab --- /dev/null +++ b/queue-4.4/block-don-t-optimize-for-non-cloned-bio-in-bio_get_last_bvec.patch @@ -0,0 +1,38 @@ +From 90d0f0f11588ec692c12f9009089b398be395184 Mon Sep 17 00:00:00 2001 +From: Ming Lei +Date: Sat, 12 Mar 2016 22:56:19 +0800 +Subject: block: don't optimize for non-cloned bio in bio_get_last_bvec() + +From: Ming Lei + +commit 90d0f0f11588ec692c12f9009089b398be395184 upstream. + +For !BIO_CLONED bio, we can use .bi_vcnt safely, but it +doesn't mean we can just simply return .bi_io_vec[.bi_vcnt - 1] +because the start postion may have been moved in the middle of +the bvec, such as splitting in the middle of bvec. + +Fixes: 7bcd79ac50d9(block: bio: introduce helpers to get the 1st and last bvec) +Reported-by: Kent Overstreet +Signed-off-by: Ming Lei +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/bio.h | 5 ----- + 1 file changed, 5 deletions(-) + +--- a/include/linux/bio.h ++++ b/include/linux/bio.h +@@ -320,11 +320,6 @@ static inline void bio_get_last_bvec(str + struct bvec_iter iter = bio->bi_iter; + int idx; + +- if (!bio_flagged(bio, BIO_CLONED)) { +- *bv = bio->bi_io_vec[bio->bi_vcnt - 1]; +- return; +- } +- + if (unlikely(!bio_multiple_segments(bio))) { + *bv = bio_iovec(bio); + return; diff --git a/queue-4.4/ld-version-fix-awk-regex-compile-failure.patch b/queue-4.4/ld-version-fix-awk-regex-compile-failure.patch new file mode 100644 index 00000000000..1689b6d53e0 --- /dev/null +++ b/queue-4.4/ld-version-fix-awk-regex-compile-failure.patch @@ -0,0 +1,50 @@ +From 4b7b1ef2c2f83d702272555e8adb839a50ba0f8e Mon Sep 17 00:00:00 2001 +From: James Hogan +Date: Tue, 8 Mar 2016 16:47:53 +0000 +Subject: ld-version: Fix awk regex compile failure + +From: James Hogan + +commit 4b7b1ef2c2f83d702272555e8adb839a50ba0f8e upstream. + +The ld-version.sh script fails on some versions of awk with the +following error, resulting in build failures for MIPS: + +awk: scripts/ld-version.sh: line 4: regular expression compile failed (missing '(') + +This is due to the regular expression ".*)", meant to strip off the +beginning of the ld version string up to the close bracket, however +brackets have a meaning in regular expressions, so lets escape it so +that awk doesn't expect a corresponding open bracket. + +Fixes: ccbef1674a15 ("Kbuild, lto: add ld-version and ld-ifversion ...") +Reported-by: Geert Uytterhoeven +Signed-off-by: James Hogan +Tested-by: Michael S. Tsirkin +Acked-by: Michael S. Tsirkin +Tested-by: Sudip Mukherjee +Cc: Michal Marek +Cc: Andi Kleen +Cc: Geert Uytterhoeven +Cc: linux-mips@linux-mips.org +Cc: linux-kbuild@vger.kernel.org +Cc: linux-kernel@vger.kernel.org +Patchwork: https://patchwork.linux-mips.org/patch/12838/ +Signed-off-by: Ralf Baechle +Signed-off-by: Greg Kroah-Hartman + +--- + scripts/ld-version.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/scripts/ld-version.sh ++++ b/scripts/ld-version.sh +@@ -1,7 +1,7 @@ + #!/usr/bin/awk -f + # extract linker version number from stdin and turn into single number + { +- gsub(".*)", ""); ++ gsub(".*\\)", ""); + split($1,a, "."); + print a[1]*10000000 + a[2]*100000 + a[3]*10000 + a[4]*100 + a[5]; + exit diff --git a/queue-4.4/mips-fix-build-error-when-smp-is-used-without-gic.patch b/queue-4.4/mips-fix-build-error-when-smp-is-used-without-gic.patch new file mode 100644 index 00000000000..37aa78e0e81 --- /dev/null +++ b/queue-4.4/mips-fix-build-error-when-smp-is-used-without-gic.patch @@ -0,0 +1,68 @@ +From 7a50e4688dabb8005df39b2b992d76629b8af8aa Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Sun, 6 Mar 2016 22:28:56 +0100 +Subject: MIPS: Fix build error when SMP is used without GIC + +From: Hauke Mehrtens + +commit 7a50e4688dabb8005df39b2b992d76629b8af8aa upstream. + +The MIPS_GIC_IPI should only be selected when MIPS_GIC is also +selected, otherwise it results in a compile error. smp-gic.c uses some +functions from include/linux/irqchip/mips-gic.h like +plat_ipi_call_int_xlate() which are only added to the header file when +MIPS_GIC is set. The Lantiq SoC does not use the GIC, but supports SMP. +The calls top the functions from smp-gic.c are already protected by +some #ifdefs + +The first part of this was introduced in commit 72e20142b2bf ("MIPS: +Move GIC IPI functions out of smp-cmp.c") + +Signed-off-by: Hauke Mehrtens +Cc: Paul Burton +Cc: linux-mips@linux-mips.org +Patchwork: https://patchwork.linux-mips.org/patch/12774/ +Signed-off-by: Ralf Baechle +Signed-off-by: Greg Kroah-Hartman + +--- + arch/mips/Kconfig | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -2155,7 +2155,7 @@ config MIPS_MT_SMP + select CPU_MIPSR2_IRQ_VI + select CPU_MIPSR2_IRQ_EI + select SYNC_R4K +- select MIPS_GIC_IPI ++ select MIPS_GIC_IPI if MIPS_GIC + select MIPS_MT + select SMP + select SMP_UP +@@ -2253,7 +2253,7 @@ config MIPS_VPE_APSP_API_MT + config MIPS_CMP + bool "MIPS CMP framework support (DEPRECATED)" + depends on SYS_SUPPORTS_MIPS_CMP && !CPU_MIPSR6 +- select MIPS_GIC_IPI ++ select MIPS_GIC_IPI if MIPS_GIC + select SMP + select SYNC_R4K + select SYS_SUPPORTS_SMP +@@ -2273,7 +2273,7 @@ config MIPS_CPS + select MIPS_CM + select MIPS_CPC + select MIPS_CPS_PM if HOTPLUG_CPU +- select MIPS_GIC_IPI ++ select MIPS_GIC_IPI if MIPS_GIC + select SMP + select SYNC_R4K if (CEVT_R4K || CSRC_R4K) + select SYS_SUPPORTS_HOTPLUG_CPU +@@ -2292,6 +2292,7 @@ config MIPS_CPS_PM + bool + + config MIPS_GIC_IPI ++ depends on MIPS_GIC + bool + + config MIPS_CM diff --git a/queue-4.4/mips-smp.c-fix-uninitialised-temp_foreign_map.patch b/queue-4.4/mips-smp.c-fix-uninitialised-temp_foreign_map.patch new file mode 100644 index 00000000000..a3bde941ba4 --- /dev/null +++ b/queue-4.4/mips-smp.c-fix-uninitialised-temp_foreign_map.patch @@ -0,0 +1,41 @@ +From d825c06bfe8b885b797f917ad47365d0e9c21fbb Mon Sep 17 00:00:00 2001 +From: James Hogan +Date: Fri, 4 Mar 2016 10:10:51 +0000 +Subject: MIPS: smp.c: Fix uninitialised temp_foreign_map + +From: James Hogan + +commit d825c06bfe8b885b797f917ad47365d0e9c21fbb upstream. + +When calculate_cpu_foreign_map() recalculates the cpu_foreign_map +cpumask it uses the local variable temp_foreign_map without initialising +it to zero. Since the calculation only ever sets bits in this cpumask +any existing bits at that memory location will remain set and find their +way into cpu_foreign_map too. This could potentially lead to cache +operations suboptimally doing smp calls to multiple VPEs in the same +core, even though the VPEs share primary caches. + +Therefore initialise temp_foreign_map using cpumask_clear() before use. + +Fixes: cccf34e9411c ("MIPS: c-r4k: Fix cache flushing for MT cores") +Signed-off-by: James Hogan +Cc: Paul Burton +Cc: linux-mips@linux-mips.org +Patchwork: https://patchwork.linux-mips.org/patch/12759/ +Signed-off-by: Ralf Baechle +Signed-off-by: Greg Kroah-Hartman + +--- + arch/mips/kernel/smp.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/mips/kernel/smp.c ++++ b/arch/mips/kernel/smp.c +@@ -121,6 +121,7 @@ static inline void calculate_cpu_foreign + cpumask_t temp_foreign_map; + + /* Re-calculate the mask */ ++ cpumask_clear(&temp_foreign_map); + for_each_online_cpu(i) { + core_present = 0; + for_each_cpu(k, &temp_foreign_map) diff --git a/queue-4.4/series b/queue-4.4/series index db18604146c..7b657880636 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -43,3 +43,8 @@ powerpc-powernv-fix-opal_console_flush-prototype-and-usages.patch userfaultfd-don-t-block-on-the-last-vm-updates-at-exit-time.patch ovl-copy-new-uid-gid-into-overlayfs-runtime-inode.patch ovl-fix-getcwd-failure-after-unsuccessful-rmdir.patch +mips-fix-build-error-when-smp-is-used-without-gic.patch +mips-smp.c-fix-uninitialised-temp_foreign_map.patch +block-don-t-optimize-for-non-cloned-bio-in-bio_get_last_bvec.patch +target-drop-incorrect-abort_task-put-for-completed-commands.patch +ld-version-fix-awk-regex-compile-failure.patch diff --git a/queue-4.4/target-drop-incorrect-abort_task-put-for-completed-commands.patch b/queue-4.4/target-drop-incorrect-abort_task-put-for-completed-commands.patch new file mode 100644 index 00000000000..abd982bb910 --- /dev/null +++ b/queue-4.4/target-drop-incorrect-abort_task-put-for-completed-commands.patch @@ -0,0 +1,47 @@ +From 7f54ab5ff52fb0b91569bc69c4a6bc5cac1b768d Mon Sep 17 00:00:00 2001 +From: Nicholas Bellinger +Date: Sat, 5 Mar 2016 20:00:12 -0800 +Subject: target: Drop incorrect ABORT_TASK put for completed commands + +From: Nicholas Bellinger + +commit 7f54ab5ff52fb0b91569bc69c4a6bc5cac1b768d upstream. + +This patch fixes a recent ABORT_TASK regression associated +with commit febe562c, where a left-over target_put_sess_cmd() +would still be called when __target_check_io_state() detected +a command has already been completed, and explicit ABORT must +be avoided. + +Note commit febe562c dropped the local kref_get_unless_zero() +check in core_tmr_abort_task(), but did not drop this extra +corresponding target_put_sess_cmd() in the failure path. + +So go ahead and drop this now bogus target_put_sess_cmd(), +and avoid this potential use-after-free. + +Reported-by: Dan Lane +Cc: Quinn Tran +Cc: Himanshu Madhani +Cc: Sagi Grimberg +Cc: Christoph Hellwig +Cc: Hannes Reinecke +Cc: Andy Grover +Cc: Mike Christie +Signed-off-by: Nicholas Bellinger +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/target/target_core_tmr.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/target/target_core_tmr.c ++++ b/drivers/target/target_core_tmr.c +@@ -177,7 +177,6 @@ void core_tmr_abort_task( + + if (!__target_check_io_state(se_cmd, se_sess, 0)) { + spin_unlock_irqrestore(&se_sess->sess_cmd_lock, flags); +- target_put_sess_cmd(se_cmd); + goto out; + } + list_del_init(&se_cmd->se_cmd_list);