mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Semen Protsenko <semen.protsenko@globallogic.com>
Cc: linux-kernel@vger.kernel.org,
	Grygorii Strashko <grygorii.strashko@globallogic.com>,
	Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH] genirq: check irq_ack callback in handle_edge_irq() before calling
Date: Tue, 21 Apr 2015 16:40:16 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.11.1504211631130.13914@nanos> (raw)
In-Reply-To: <1429621752-19082-1-git-send-email-semen.protsenko@globallogic.com>

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

  reply	other threads:[~2015-04-21 14:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-21 13:09 Semen Protsenko
2015-04-21 14:40 ` Thomas Gleixner [this message]
2015-04-21 15:28   ` Sam Protsenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.11.1504211631130.13914@nanos \
    --to=tglx@linutronix.de \
    --cc=grygorii.strashko@globallogic.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=semen.protsenko@globallogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®