mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: pageexec@freemail.hu
Cc: torvalds@osdl.org, linux-kernel@vger.kernel.org, arjan@infradead.org
Subject: Re: [PATCH] i386: clean up user_mode() use
Date: Sun, 2 Jul 2006 15:37:18 +0200	[thread overview]
Message-ID: <20060702133718.GA27549@elte.hu> (raw)
In-Reply-To: <44A7BE17.23657.2D6F894E@pageexec.freemail.hu>


* pageexec@freemail.hu <pageexec@freemail.hu> 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@freemail.hu>

agreed!

Acked-by: Ingo Molnar <mingo@elte.hu>

	Ingo

       reply	other threads:[~2006-07-02 13:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <44A7BE17.23657.2D6F894E@pageexec.freemail.hu>
2006-07-02 13:37 ` Ingo Molnar [this message]
2006-07-02 20:10 Chuck Ebbert
2006-07-02 20:42 ` Linus Torvalds
     [not found] ` <44A85518.24327.2FBD646A@pageexec.freemail.hu>
2006-07-02 21:36   ` Linus Torvalds
2006-07-03  4:36     ` Ingo Molnar

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=20060702133718.GA27549@elte.hu \
    --to=mingo@elte.hu \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pageexec@freemail.hu \
    --cc=torvalds@osdl.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