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]
Message-ID: <20210220174101.GA29905@zn.tnic>
Date:   Sat, 20 Feb 2021 18:41:01 +0100
From:   Borislav Petkov <bp@...en8.de>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Josh Poimboeuf <jpoimboe@...hat.com>, x86@...nel.org,
        pjt@...gle.com, mbenes@...e.cz, jgross@...e.com,
        linux-kernel@...r.kernel.org
Subject: Re: [RFC][PATCH 6/6] objtool,x86: Rewrite retpoline thunk calls

On Sat, Feb 20, 2021 at 05:48:46PM +0100, Peter Zijlstra wrote:
>  - straight line execution is always better than a round-trip to
>    somewhere else, no matter how trivial.

Sure, but not at that price. Especially not if it is waaay down in perf
profiles.

>  - supposely EIBRS (yeah, I know, there's a paper out there) should
>    result in no longer using retpolines.

Yap, supposedly both vendors have stuff like that in the works. When
that happens, we can finally use ALTERNATIVE_3 in the ratpolines. :-)

>  - I really, as in _REALLY_ don't want to do a CET enabled retpoline

WTF is that? Can we deal with one atrocity at a time pls...

>  - IOW, retpolines should be on their way out (knock on wood)

Yap, my hope too.

>  - doing this was fun :-)

I know.

>  - this stuff was mostly trivial make work stuff I could do with a head
>    full of snot and a headache.

I don't want to imagine what you'd come up with when you're all healthy
and rested. :-P

>  - if we had negative alternatives objtool doesn't need to actually
>    rewrite code in this case. It could simply emit alternative entries
>    and call it a day.

I don't mind the negative alt per se - I mind the implementation I saw.
I'm sure we can come up with something nicer, like, for example, struct
alt_instr.flags to denote that this feature is a NOT feature. IOW, I'd
like for the fact that a feature is a NOT feature or patching needs to
happen in the NOT case, to be explicitly stated with a flag. I.e.,

	if (!boot_cpu_has(a->cpuid) && !(a->flags & PATCH_WHEN_X86_FEATURE_FLAG_NOT_SET))
		continue;

Something like that.
			
>  - objtool already rewrites code

Sure, as long as one can reconstruct from looking at the asm, what
objdool has changed. I fear that'll get out of control if not done with
restraint and proper documentation.

>  - I have more cases for objtool to rewrite code (I'll see if I can
>    rebase and post that this weekend -- no promises).

Oh noes.

>  - also https://lkml.kernel.org/r/20200625200235.GQ4781@hirez.programming.kicks-ass.net

Oh well, I guess you can simply make objtool compile the kernel and be
done with it.

:)

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ