From: Andrew Morton <akpm@osdl.org>
To: Jason Baron <jbaron@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fix altsysrq deadlock
Date: Tue, 26 Oct 2004 19:40:43 -0700 [thread overview]
Message-ID: <20041026194043.5f39e140.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0410261311590.12088-100000@dhcp83-105.boston.redhat.com>
Jason Baron <jbaron@redhat.com> wrote:
>
>
> This patch fixes a deadlock in the handle_sysrq function.
> ...
>> - __sysrq_lock_table();
> + if(!__sysrq_trylock_table()) {
> + if(in_interrupt())
> + return;
> + else
> + __sysrq_lock_table();
> + }
> +
This is only a partial solution - __sysrq_trylock_table() is exported to
modules which do who know what with it and they don't know how to handle
locking failures - they'll just go ahead and do a spin_unlock() of an
unlocked lock and mayhem will ensue.
What we need to do is to move all those inlined functions out of sysrq.h,
into sysrq.c then withdraw all those exported-to-modules helper functions
then remove __sysrq_trylock_table() altogether and then use
spin_lock_irqsave() in the appropriate places.
next parent reply other threads:[~2004-10-27 2:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.44.0410261311590.12088-100000@dhcp83-105.boston.redhat.com>
2004-10-27 2:40 ` Andrew Morton [this message]
2004-10-27 19:05 ` Jason Baron
2004-10-26 17:27 Jason Baron
2004-10-26 17:43 ` John Richard Moser
2004-10-26 18:22 ` Jason Baron
2004-10-26 18:33 ` John Richard Moser
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=20041026194043.5f39e140.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=jbaron@redhat.com \
--cc=linux-kernel@vger.kernel.org \
/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
Powered by JetHome