i386: clean up user_mode() use
In-Reply-To: <[email protected]>
Quoted 10 lines · Ingo Molnar
Quoted 10 lines
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 ofuser_mode_vm()and a newuser_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
Quoted 7 lines
Quoted 3 lines
substitution as appropriate.
Signed-off-by PaX Team <[email protected]>agreed!
Acked-by Ingo Molnar <[email protected]>
Please make that second one
user_mode_novm86
Otherwise people might think it means "user mode no virtual memory."
Signature · 2 lines
Chuck "You can't read a newspaper if you can't read." --George W. Bush
Quoted 3 lines · Chuck Ebbert
Quoted 3 lines
Quoted 3 lines
user_mode_vm->user_mode
user_mode->user_mode_novm
No. Horrible.
I'm disgusted that somebody really would even consider something like this. It CHANGES SEMANTICS for the same name, which is a maintenance nightmare and a security bug. Now some patch assumes the new behaviour, gets back-ported, and is subtly broken.
If you want to get rid of the "user_mode()" thing, don't re-use the name with somethign that means something else.
Just do
user_mode() -> user_mode_novm86()
instead, and leave the old macro entirely behind.
Linus
Quoted 3 lines · On Sun, 2 Jul 2006, [email protected] wrote:
the fact that arch *independent* code makes use of
user_mode()was apparently lost on you.
Argh. Yes, there's one single use, apparently.
Sad.
Linus
Quoted 8 lines · Linus Torvalds
Quoted 3 lines · On Sun, 2 Jul 2006, [email protected] wrote:
the fact that arch *independent* code makes use of
user_mode()was apparently lost on you.Argh. Yes, there's one single use, apparently.
Sad.
but even for new non-generic per-arch code a couple of security holes were introduced due to the existing semantics of user_mode(). So this indeed changes semantics and it's totally intentional.
so i think we should bite the bullet and should apply this patch. We have a constant influx of user_mode() using code and as practice has shown it, people dont really consider the vm86 angle of it.
Ingo