Re: [PATCH] i386: clean up user_mode() use
- From: Ingo Molnar <mingo@xxxxxxx>
- Date: Sun, 2 Jul 2006 15:37:18 +0200
* pageexec@xxxxxxxxxxx <pageexec@xxxxxxxxxxx> wrote:
on i386 there're two macros used for testing the userland execution
mode: user_mode() and user_mode_vm(), which is not intuitive as on
many (all?) other architectures there's only user_mode() and
architecture independent code is written with user_mode() only, and
even on i386 someone can make the wrong assumption that user_mode()
works as it does on other archs.
two cases in point:
drivers/oprofile/cpu_buffer.c:oprofile_add_sample() uses user_mode()
which can lead to incorrect results if the interrupted task was in v86
mode with a code segment fooling the user_mode() selector RPL check.
also, arch/i386/kernel/kprobes.c:kprobe_exceptions_notify() used to
use user_mode() whereas it really meant user_mode_vm(), this is in
fact incorrect until 2.6.17.
to avoid such mistakes in the future, the suggested solution is to
make user_mode() on i386 consistent with the generic expectation and
make it detect any user mode execution context, that is, it should
take the role of user_mode_vm() and a new user_mode_novm() is
introduced for the i386 specific cases where v86 mode can be excluded.
in short, the patch simply does a
user_mode_vm -> user_mode
user_mode -> user_mode_novm
substitution as appropriate.
Signed-off-by: PaX Team <pageexec@xxxxxxxxxxx>
agreed!
Acked-by: Ingo Molnar <mingo@xxxxxxx>
Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Prev by Date: Re: 2.6.17-mm4 + hostap + pcmcia + lockdep -- possible recursive locking detected -- (af_callback_keys + sk->sk_family#3){-.-?}, at: [<c119d8db>] sock_def_readable+0x15/0x69
- Next by Date: Re: 2.6.17-mm5 dislikes raid-1, just like mm4
- Previous by thread: Re: Linux kernel 2.6.10 sata_nv.c stops working on my hardware
- Next by thread: Re: [PATCH] i386: clean up user_mode() use
- Index(es):