From: Greg Kroah-Hartman Date: Wed, 10 Apr 2013 20:31:35 +0000 (-0700) Subject: 3.4-stable patches X-Git-Tag: v3.0.73~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=026c6cb24e7a2b3742332de0c0605299884ec0cd;p=thirdparty%2Fkernel%2Fstable-queue.git 3.4-stable patches added patches: panic-fix-a-possible-deadlock-in-panic.patch thermal-return-an-error-on-failure-to-register-thermal-class.patch x86-fix-rebuild-with-efi_stub-enabled.patch --- diff --git a/queue-3.4/panic-fix-a-possible-deadlock-in-panic.patch b/queue-3.4/panic-fix-a-possible-deadlock-in-panic.patch new file mode 100644 index 00000000000..4ed8e83b8a7 --- /dev/null +++ b/queue-3.4/panic-fix-a-possible-deadlock-in-panic.patch @@ -0,0 +1,59 @@ +From 190320c3b6640d4104650f55ff69611e050ea06b Mon Sep 17 00:00:00 2001 +From: Vikram Mulukutla +Date: Mon, 30 Jul 2012 14:39:58 -0700 +Subject: panic: fix a possible deadlock in panic() + +From: Vikram Mulukutla + +commit 190320c3b6640d4104650f55ff69611e050ea06b upstream. + +panic_lock is meant to ensure that panic processing takes place only on +one cpu; if any of the other cpus encounter a panic, they will spin +waiting to be shut down. + +However, this causes a regression in this scenario: + +1. Cpu 0 encounters a panic and acquires the panic_lock + and proceeds with the panic processing. +2. There is an interrupt on cpu 0 that also encounters + an error condition and invokes panic. +3. This second invocation fails to acquire the panic_lock + and enters the infinite while loop in panic_smp_self_stop. + +Thus all panic processing is stopped, and the cpu is stuck for eternity +in the while(1) inside panic_smp_self_stop. + +To address this, disable local interrupts with local_irq_disable before +acquiring the panic_lock. This will prevent interrupt handlers from +executing during the panic processing, thus avoiding this particular +problem. + +Signed-off-by: Vikram Mulukutla +Reviewed-by: Stephen Boyd +Cc: Michael Holzheu +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Cc: Paul Gortmaker +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/panic.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/kernel/panic.c ++++ b/kernel/panic.c +@@ -75,6 +75,14 @@ void panic(const char *fmt, ...) + int state = 0; + + /* ++ * Disable local interrupts. This will prevent panic_smp_self_stop ++ * from deadlocking the first cpu that invokes the panic, since ++ * there is nothing to prevent an interrupt handler (that runs ++ * after the panic_lock is acquired) from invoking panic again. ++ */ ++ local_irq_disable(); ++ ++ /* + * It's possible to come here directly from a panic-assertion and + * not have preempt disabled. Some functions called from here want + * preempt to be disabled. No point enabling it later though... diff --git a/queue-3.4/series b/queue-3.4/series index 3ef1ab801a6..e63ab9d4ee7 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -20,3 +20,6 @@ hwspinlock-fix-__hwspin_lock_request-error-path.patch spinlocks-and-preemption-points-need-to-be-at-least-compiler-barriers.patch crypto-gcm-fix-assumption-that-assoc-has-one-segment.patch block-avoid-using-uninitialized-value-in-from-queue_var_store.patch +x86-fix-rebuild-with-efi_stub-enabled.patch +thermal-return-an-error-on-failure-to-register-thermal-class.patch +panic-fix-a-possible-deadlock-in-panic.patch diff --git a/queue-3.4/thermal-return-an-error-on-failure-to-register-thermal-class.patch b/queue-3.4/thermal-return-an-error-on-failure-to-register-thermal-class.patch new file mode 100644 index 00000000000..d988dffabe3 --- /dev/null +++ b/queue-3.4/thermal-return-an-error-on-failure-to-register-thermal-class.patch @@ -0,0 +1,36 @@ +From da28d966f6aa942ae836d09729f76a1647932309 Mon Sep 17 00:00:00 2001 +From: Richard Guy Briggs +Date: Tue, 12 Feb 2013 19:39:44 +0000 +Subject: thermal: return an error on failure to register thermal class + +From: Richard Guy Briggs + +commit da28d966f6aa942ae836d09729f76a1647932309 upstream. + +The return code from the registration of the thermal class is used to +unallocate resources, but this failure isn't passed back to the caller of +thermal_init. Return this failure back to the caller. + +This bug was introduced in changeset 4cb18728 which overwrote the return code +when the variable was re-used to catch the return code of the registration of +the genetlink thermal socket family. + +Signed-off-by: Richard Guy Briggs +Signed-off-by: Zhang Rui +Cc: Jonghwan Choi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/thermal/thermal_sys.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/thermal/thermal_sys.c ++++ b/drivers/thermal/thermal_sys.c +@@ -1383,6 +1383,7 @@ static int __init thermal_init(void) + idr_destroy(&thermal_cdev_idr); + mutex_destroy(&thermal_idr_lock); + mutex_destroy(&thermal_list_lock); ++ return result; + } + result = genetlink_init(); + return result; diff --git a/queue-3.4/x86-fix-rebuild-with-efi_stub-enabled.patch b/queue-3.4/x86-fix-rebuild-with-efi_stub-enabled.patch new file mode 100644 index 00000000000..eecd6734d3d --- /dev/null +++ b/queue-3.4/x86-fix-rebuild-with-efi_stub-enabled.patch @@ -0,0 +1,63 @@ +From 918708245e92941df16a634dc201b407d12bcd91 Mon Sep 17 00:00:00 2001 +From: Jan Beulich +Date: Wed, 3 Apr 2013 15:47:33 +0100 +Subject: x86: Fix rebuild with EFI_STUB enabled + +From: Jan Beulich + +commit 918708245e92941df16a634dc201b407d12bcd91 upstream. + +eboot.o and efi_stub_$(BITS).o didn't get added to "targets", and hence +their .cmd files don't get included by the build machinery, leading to +the files always getting rebuilt. + +Rather than adding the two files individually, take the opportunity and +add $(VMLINUX_OBJS) to "targets" instead, thus allowing the assignment +at the top of the file to be shrunk quite a bit. + +At the same time, remove a pointless flags override line - the variable +assigned to was misspelled anyway, and the options added are +meaningless for assembly sources. + +[ hpa: the patch is not minimal, but I am taking it for -urgent anyway + since the excess impact of the patch seems to be small enough. ] + +Signed-off-by: Jan Beulich +Link: http://lkml.kernel.org/r/515C5D2502000078000CA6AD@nat28.tlf.novell.com +Cc: Matthew Garrett +Cc: Matt Fleming +Signed-off-by: H. Peter Anvin +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/boot/compressed/Makefile | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +--- a/arch/x86/boot/compressed/Makefile ++++ b/arch/x86/boot/compressed/Makefile +@@ -4,7 +4,7 @@ + # create a compressed vmlinux image from the original vmlinux + # + +-targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo head_$(BITS).o misc.o string.o cmdline.o early_serial_console.o piggy.o ++targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo + + KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2 + KBUILD_CFLAGS += -fno-strict-aliasing -fPIC +@@ -29,7 +29,6 @@ VMLINUX_OBJS = $(obj)/vmlinux.lds $(obj) + $(obj)/piggy.o + + $(obj)/eboot.o: KBUILD_CFLAGS += -fshort-wchar -mno-red-zone +-$(obj)/efi_stub_$(BITS).o: KBUILD_CLFAGS += -fshort-wchar -mno-red-zone + + ifeq ($(CONFIG_EFI_STUB), y) + VMLINUX_OBJS += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o +@@ -43,7 +42,7 @@ OBJCOPYFLAGS_vmlinux.bin := -R .comment + $(obj)/vmlinux.bin: vmlinux FORCE + $(call if_changed,objcopy) + +-targets += vmlinux.bin.all vmlinux.relocs ++targets += $(patsubst $(obj)/%,%,$(VMLINUX_OBJS)) vmlinux.bin.all vmlinux.relocs + + CMD_RELOCS = arch/x86/tools/relocs + quiet_cmd_relocs = RELOCS $@