lkml.org 
[lkml]   [2004]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] fix altsysrq deadlock
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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.031 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site