Skip to content
Snippets Groups Projects
  • Thomas Gleixner's avatar
    x86/apic/vector: Force interupt handler invocation to irq context · 3e134563
    Thomas Gleixner authored
    mainline inclusion
    from mainline-5.7
    commit 008f1d60
    category: bugfix
    bugzilla: NA
    CVE: NA
    
    -------------------------------------------------
    
    Sathyanarayanan reported that the PCI-E AER error injection mechanism
    can result in a NULL pointer dereference in apic_ack_edge():
    
     BUG: unable to handle kernel NULL pointer dereference at 0000000000000078
     RIP: 0010:apic_ack_edge+0x1e/0x40
     Call Trace:
       handle_edge_irq+0x7d/0x1e0
       generic_handle_irq+0x27/0x30
       aer_inject_write+0x53a/0x720
    
    It crashes in irq_complete_move() which dereferences get_irq_regs() which
    is obviously NULL when this is called from non interrupt context.
    
    Of course the pointer could be checked, but that just papers over the real
    issue. Invoking the low level interrupt handling mechanism from random code
    can wreckage the fragile interrupt affinity mechanism of x86 as interrupts
    can only be moved in interrupt context or with special care wh...
    3e134563