lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 29 Mar 2015 22:51:50 +0200
From:	Denys Vlasenko <vda.linux@...glemail.com>
To:	Ingo Molnar <mingo@...nel.org>
Cc:	Denys Vlasenko <dvlasenk@...hat.com>,
	Andy Lutomirski <luto@...capital.net>,
	"H. Peter Anvin" <hpa@...or.com>,
	Brad Spengler <spender@...ecurity.net>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Borislav Petkov <bp@...en8.de>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Andrew Lutomirski <luto@...nel.org>,
	"linux-tip-commits@...r.kernel.org" 
	<linux-tip-commits@...r.kernel.org>
Subject: Re: [tip:x86/asm] x86/asm/entry: Add user_mode_ignore_vm86()

On Sun, Mar 29, 2015 at 9:08 AM, Ingo Molnar <mingo@...nel.org> wrote:
>> >> Would be still nice to have it as an add on patch, if you agree with
>> >> my arguments.
>> >
>> > Given that there are only a very small number of callers left and
>> > they're all Obviously Correct (tm), I'm not too worried about it.
>> > Maybe if we kill off __copy_to_user, I'll be inspired to kill off
>> > user_mode_ignore_vm86 as well :)
>>
>>
>> I was looking at the code involving this function and it looks
>> like a much better name for user_mode_ignore_vm86() would be
>> user_mode_cs().
>>
>> Every time we use it, we check vm8086 mode just before it:
>>
>> perf_event.c
>>
>>         if (regs->flags & X86_VM_MASK)
>>                 return 0x10 * regs->cs;
>>
>>         if (user_mode_ignore_vm86(regs) && regs->cs != __USER_CS)
>>                 return get_segment_base(regs->cs);
>>
>>
>> traps.c (three similar instances):
>>
>>         if (v8086_mode(regs)) {
>> ...
>>                 goto exit;
>>         }
>>         if (user_mode_ignore_vm86(regs))...
>>
>>
>> "_ignore_vm86" part doesn't quite work as an explanation.
>> user_mode_cs() would immediately tell me "do we have a user's cs?"
>
> So what the function name wanted to express is something like this:
>
>         if (user_mode_vm86_mode_already_checked_so_this_is_marginally_faster_but_dont_use_it_otherwise_because_that_would_be_a_roothole())
>         {
>                 ...
>         }
>
> but that name was considered somewhat long.

LOL :D

Seriously, though. I do think that  user_mode_cs(regs)  is a good name.
It's short.
It describes what it in fact checks.
"(is it) user mode cs" reads as a valid English phrase, whereas
"(is it) user mode ignore vm86" does not.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ