[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220211153706.GW23216@worktop.programming.kicks-ass.net>
Date: Fri, 11 Feb 2022 16:37:06 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Alexander Lobakin <alexandr.lobakin@...el.com>
Cc: linux-hardening@...r.kernel.org, x86@...nel.org,
Borislav Petkov <bp@...en8.de>,
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>,
Christoph Hellwig <hch@....de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>,
Andy Lutomirski <luto@...nel.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 v10 10/15] FG-KASLR: use a scripted approach to handle
.text.* sections
On Wed, Feb 09, 2022 at 07:57:47PM +0100, Alexander Lobakin wrote:
> +sub read_sections {
> + open(my $fh, "\"$readelf\" -SW \"$file\" 2>/dev/null |")
> + or die "$0: ERROR: failed to execute \"$readelf\": $!";
> +
> + while (<$fh>) {
> + my $name;
> + my $align;
> + chomp;
> +
> + ($name, $align) = $_ =~ /^\s*\[[\s0-9]*\]\s*(\.\S*)\s*[A-Z]*\s*[0-9a-f]{16}\s*[0-9a-f]*\s*[0-9a-f]*\s*[0-9a-f]*\s*[0-9a-f]{2}\s*[A-Z]{2}\s*[0-9]\s*[0-9]\s*([0-9]*)$/;
Is there really no readable way to write this?
> +
> + if (!defined($name)) {
> + next;
> + }
> +
> + ## Clang 13 onwards emits __cfi_check_fail only on final
> + ## linking, so it won't appear in .o files and will be
> + ## missing in @sections. Add it manually to prevent
> + ## spawning orphans.
> + if ($name eq ".text.__cfi_check_fail") {
> + $has_ccf = 1;
> + }
How is that relevant, x86-64 doesn't and won't do clang-cfi.
Powered by blists - more mailing lists