[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BUG in x86 do_page_fault? [was Re: in_atomic doesn't countlocal_irq_disable?]




On Wed, 31 Dec 2003, Srivatsa Vaddagiri wrote:
>
> 	in_atomic() doesn't seem to return true
> in code sections where IRQ's have been disabled (using 
> local_irq_disable).
> 
> As a result, I think do_page_fault() on x86 needs to 
> be updated to note this fact:

NO. 

Please don't do this, it will result in some _really_ nasty problems with 
X and other programs that potentially disable interrupts in user space.

Also, there are broken old drivers that potentially have interrupts 
disabled, and we shouldn't just oops them. We should have a warning, but 
we already do have that: that's what "might_sleep()" does.

So something like this may be appropriate at some point, but not in this 
format. At the very least you absolutely _have_ to check for user mode 
(possibly in the same place where we now have that

	/* It's safe to allow irq's after cr2 has been saved */

comment).

		Lnus

> --- fault.c.org Wed Dec 31 18:34:18 2003
> +++ fault.c     Wed Dec 31 18:35:02 2003
> @@ -259,7 +259,7 @@
>          * If we're in an interrupt, have no user context or are running in an
>          * atomic region then we must not take the fault..
>          */
> -       if (in_atomic() || !mm)
> +       if (in_atomic() || irqs_disabled() || !mm)
>                 goto bad_area_nosemaphore;
> 
>         down_read(&mm->mmap_sem);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo _at_ vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


この情報があなたの探していたものかどうか選択してください。
yes/まさにこれだ!   no/違うなぁ   part/一部見つかった   try/これで試してみる

あなたが探していた情報はどのようなことか、ご自由に記入下さい。特に「まさにこれだ!」と言う場合は記入をお願いします。
例:「複数のマシンからCATV経由でipmasqueradeを利用してWebを参照したい場合の設定について」
Follow-Ups: