[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220103154023.7326-1-alexandr.lobakin@intel.com>
Date: Mon, 3 Jan 2022 16:40:23 +0100
From: Alexander Lobakin <alexandr.lobakin@...el.com>
To: Borislav Petkov <bp@...en8.de>
Cc: Alexander Lobakin <alexandr.lobakin@...el.com>,
linux-hardening@...r.kernel.org, x86@...nel.org,
Jesse Brandeburg <jesse.brandeburg@...el.com>,
Kristen Carlson Accardi <kristen@...ux.intel.com>,
Kees Cook <keescook@...omium.org>,
Miklos Szeredi <miklos@...redi.hu>,
Ard Biesheuvel <ardb@...nel.org>,
Tony Luck <tony.luck@...el.com>,
Bruce Schlobohm <bruce.schlobohm@...el.com>,
Jessica Yu <jeyu@...nel.org>,
kernel test robot <lkp@...el.com>,
Miroslav Benes <mbenes@...e.cz>,
Evgenii Shatokhin <eshatokhin@...tuozzo.com>,
Jonathan Corbet <corbet@....net>,
Masahiro Yamada <masahiroy@...nel.org>,
Michal Marek <michal.lkml@...kovi.net>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>,
Thomas Gleixner <tglx@...utronix.de>,
Will Deacon <will@...nel.org>, Ingo Molnar <mingo@...hat.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Arnd Bergmann <arnd@...db.de>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Nathan Chancellor <nathan@...nel.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Marios Pomonis <pomonis@...gle.com>,
Sami Tolvanen <samitolvanen@...gle.com>,
"H.J. Lu" <hjl.tools@...il.com>, Nicolas Pitre <nico@...xnic.net>,
linux-kernel@...r.kernel.org, linux-kbuild@...r.kernel.org,
linux-arch@...r.kernel.org, live-patching@...r.kernel.org,
llvm@...ts.linux.dev
Subject: Re: [PATCH v9 03/15] kallsyms: Hide layout
From: Borislav Petkov <bp@...en8.de>
Date: Thu, 30 Dec 2021 23:36:00 +0100
> On Thu, Dec 23, 2021 at 01:21:57AM +0100, Alexander Lobakin wrote:
> > Subject: Re: [PATCH v9 03/15] kallsyms: Hide layout
>
> That title is kinda laconic...
"kallsyms: randomize /proc/kallsyms output order"?
>
> > From: Kristen Carlson Accardi <kristen@...ux.intel.com>
> >
> > This patch makes /proc/kallsyms display in a random order, rather
>
> Avoid having "This patch" or "This commit" in the commit message. It is
> tautologically useless.
>
> Also, do
>
> $ git grep 'This patch' Documentation/process
>
> for more details.
Goes straight from the original series. Worth changing anyways.
>
> > than sorted by address in order to hide the newly randomized address
> > layout.
>
> Sorted by address?
>
> My /proc/kallsyms says
>
> $ awk '{ print $1 }' /proc/kallsyms | uniq -c
> 119086 0000000000000000
>
> so all the addresses are 0. Aha, and when I list them as root, only then
> I see non-null addresses.
>
> So why do we that patch at all?
It displays zeros for non-roots, but the symbols are still sorted by
their addresses. As a result, if you leak one address, you could
determine some others.
This is especially critical with FG-KASLR as its text layout is
random each time and sorted /proc/kallsyms would make the entire
feature useless.
>
> > alobakin:
> > Don't depend FG-KASLR and always do that for unpriviledged accesses
>
> Unknown word [unpriviledged] in commit message, suggestions:
> ['unprivileged', 'underprivileged', 'privileged']
I either have some problems with checkpatch + codespell, or they
missed all that typos you're noticing. Thanks, and apologies =\
>
> > as suggested by several folks.
> > Also, introduce and use a shuffle_array() macro which shuffles an
> > array using Fisher-Yates.
>
> Fisher-Yates what?
>
> /me goes and looks at the wikipedia article.
>
> Aha, a Fisher-Yates shuffle algoithm.
>
> Don't be afraid to explain more in your commit messages and make them
> more reader-friendly.
Sure.
This patch initially was at the tail of the set, after the commits
where this algo is mentioned several times in a more detailed
manner, but I moved it to the head then as the requests for doing
this unconditionally converted it to a pre-requisite.
>
> > We'll make use of it several more times
> > later on.
>
> Not important for this commit.
>
> ...
>
> --
> Regards/Gruss,
> Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette
Thanks!
Al
Powered by blists - more mailing lists