lkml.org 
[lkml]   [2015]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] genirq: check irq_ack callback in handle_edge_irq() before calling
On Tue, 21 Apr 2015, Semen Protsenko wrote:
> Direct calling of .irq_ack callback (from struct irq_chip) leads to NULL
> pointer dereference in some cases. E.g. this was observed for MAX732X
> driver on hibernation:
>
> Unable to handle kernel NULL pointer dereference at virtual address 0
> Backtrace:
> (handle_edge_irq) from (resend_irqs)
> (resend_irqs) from (tasklet_action)
> (tasklet_action) from (__do_softirq)
> (__do_softirq) from (run_ksoftirqd)
> (run_ksoftirqd) from (smpboot_thread_fn)
> (smpboot_thread_fn) from (kthread)
> (kthread) from (ret_from_fork)
>
> This patch checks if .irq_ack was set, so in case it wasn't (i.e. it's
> NULL) we wouldn't have NULL pointer dereference. This check seems to
> be pretty common in kernel/irq/chip.c, but it was missed for
> handle_edge_irq() function.

No, it's not missing by chance. It's missing on purpose. The edge
handler is designed to deal with edge type interrupt chips and those
have an ACK by definition.

You are fixing the wrong place. That GPIO expander is using the wrong
flow handler. It should not use the edge handler at all.

Thanks,

tglx


\
 
 \ /
  Last update: 2015-04-21 17:01    [W:0.046 / U:0.840 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site