Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1570947

Re: [PATCH] x86/microcode: Do not access the initrd after it has been freed

From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH] x86/microcode: Do not access the initrd after it has been freed
Date 2017-01-31 19:10 +0100
Message-ID <t5L2p-3UK-1@gated-at.bofh.it> (permalink)
References (7 earlier) <t5fYC-1PU-21@gated-at.bofh.it> <t5gL0-2ll-9@gated-at.bofh.it> <t5Bmq-6om-9@gated-at.bofh.it> <t5DxV-7RQ-35@gated-at.bofh.it> <t5EX0-8E-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 31 Jan 2017, Mike Galbraith wrote:

> On Tue, 2017-01-31 at 11:01 +0100, Borislav Petkov wrote:
> > On Tue, Jan 31, 2017 at 08:43:55AM +0100, Ingo Molnar wrote:
> > > (Cc:-ed Mike as this could explain his early boot crash/hang?
> > >         Mike: please try -tip f18a8a0143b1 that I just pushed out. )
> > 
> > One other thing to try, Mike, is boot with "dis_ucode_ldr". See whether
> > that makes it go away.
> 
> (bisect fingered irqdomain: Avoid activating interrupts more than once)

That commit exposed interesting code in x86 land. Can you please try the
patch below?

Thanks,

	tglx
8<--------------

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 1e35dd06b090..52f352b063fd 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -2117,6 +2117,7 @@ static inline void __init check_timer(void)
 			if (idx != -1 && irq_trigger(idx))
 				unmask_ioapic_irq(irq_get_chip_data(0));
 		}
+		irq_domain_deactivate_irq(irq_data);
 		irq_domain_activate_irq(irq_data);
 		if (timer_irq_works()) {
 			if (disable_timer_pin_1 > 0)
@@ -2138,6 +2139,7 @@ static inline void __init check_timer(void)
 		 * legacy devices should be connected to IO APIC #0
 		 */
 		replace_pin_at_irq_node(data, node, apic1, pin1, apic2, pin2);
+		irq_domain_deactivate_irq(irq_data);
 		irq_domain_activate_irq(irq_data);
 		legacy_pic->unmask(0);
 		if (timer_irq_works()) {
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index 85e87b46c318..dc6ba5bda9fc 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -352,6 +352,7 @@ static int hpet_resume(struct clock_event_device *evt, int timer)
 	} else {
 		struct hpet_dev *hdev = EVT_TO_HPET_DEV(evt);
 
+		irq_domain_deactivate_irq(irq_get_irq_data(hdev->irq));
 		irq_domain_activate_irq(irq_get_irq_data(hdev->irq));
 		disable_irq(hdev->irq);
 		irq_set_affinity(hdev->irq, cpumask_of(hdev->cpu));

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] x86/microcode: Do not access the initrd after it has  been freed Ingo Molnar <mingo@kernel.org> - 2017-01-31 08:50 +0100
  Re: [PATCH] x86/microcode: Do not access the initrd after it has  been freed Borislav Petkov <bp@alien8.de> - 2017-01-31 11:10 +0100
    Re: [PATCH] x86/microcode: Do not access the initrd after it has  been freed Mike Galbraith <efault@gmx.de> - 2017-01-31 12:40 +0100
      Re: [PATCH] x86/microcode: Do not access the initrd after it has  been freed Borislav Petkov <bp@alien8.de> - 2017-01-31 13:50 +0100
        Re: [PATCH] x86/microcode: Do not access the initrd after it has  been freed Borislav Petkov <bp@alien8.de> - 2017-01-31 18:50 +0100
          Re: [PATCH] x86/microcode: Do not access the initrd after it has  been freed Mike Galbraith <efault@gmx.de> - 2017-01-31 19:10 +0100
      Re: [PATCH] x86/microcode: Do not access the initrd after it has  been freed Thomas Gleixner <tglx@linutronix.de> - 2017-01-31 19:10 +0100
        [tip:irq/urgent] x86/irq: Make irq activate operations symmetric tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-01-31 20:30 +0100
    Re: [PATCH] x86/microcode: Do not access the initrd after it has  been freed Ingo Molnar <mingo@kernel.org> - 2017-01-31 17:50 +0100

csiph-web