linux-mips
[Top] [All Lists]

Re: [PATCH] fix possible sleeping in atomic on setup/restore sigcontext

To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Subject: Re: [PATCH] fix possible sleeping in atomic on setup/restore sigcontext
From: Ralf Baechle <ralf@linux-mips.org>
Date: Thu, 13 Oct 2005 15:04:15 +0100
Cc: linux-mips@linux-mips.org
In-reply-to: <20051007.235152.75184664.anemo@mba.ocn.ne.jp>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20051007.235152.75184664.anemo@mba.ocn.ne.jp>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.4.2.1i
On Fri, Oct 07, 2005 at 11:51:52PM +0900, Atsushi Nemoto wrote:

> The setup_sigcontect/restore_sigcontext might sleep on
> put_user/get_user with preemption disabled (i.e. atomic context).
> Sleeping in atomic context is not allowed.  This patch fixes this
> problem using temporary variable (struct sigcontext tmpsc).
> 
> Another possible fix might be rewriting
> restore_fp_context/save_fp_context to copy to/from current
> thread_struct and use them with restore_fp/save_fp.

I think much of the 87d54649f67d8ffe0a8d8176de8c210a6c4bb4a7 preemption
patch is flawed and the problem you were trying to fix are in part just
caused by it.

Rule of thumb - if there's a preempt_disable anywhere, it's probably
wrong ...

   Ralf

<Prev in Thread] Current Thread [Next in Thread>