[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YKVUgzJ0MVNBgjDd@zn.tnic>
Date: Wed, 19 May 2021 20:10:11 +0200
From: Borislav Petkov <bp@...en8.de>
To: Yu-cheng Yu <yu-cheng.yu@...el.com>
Cc: x86@...nel.org, "H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org, linux-mm@...ck.org,
linux-arch@...r.kernel.org, linux-api@...r.kernel.org,
Arnd Bergmann <arnd@...db.de>,
Andy Lutomirski <luto@...nel.org>,
Balbir Singh <bsingharora@...il.com>,
Cyrill Gorcunov <gorcunov@...il.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Eugene Syromiatnikov <esyr@...hat.com>,
Florian Weimer <fweimer@...hat.com>,
"H.J. Lu" <hjl.tools@...il.com>, Jann Horn <jannh@...gle.com>,
Jonathan Corbet <corbet@....net>,
Kees Cook <keescook@...omium.org>,
Mike Kravetz <mike.kravetz@...cle.com>,
Nadav Amit <nadav.amit@...il.com>,
Oleg Nesterov <oleg@...hat.com>, Pavel Machek <pavel@....cz>,
Peter Zijlstra <peterz@...radead.org>,
Randy Dunlap <rdunlap@...radead.org>,
"Ravi V. Shankar" <ravi.v.shankar@...el.com>,
Vedvyas Shanbhogue <vedvyas.shanbhogue@...el.com>,
Dave Martin <Dave.Martin@....com>,
Weijiang Yang <weijiang.yang@...el.com>,
Pengfei Xu <pengfei.xu@...el.com>,
Haitao Huang <haitao.huang@...el.com>,
Mark Brown <broonie@...nel.org>,
Catalin Marinas <catalin.marinas@....com>
Subject: Re: [PATCH v26 26/30] ELF: Introduce arch_setup_elf_property()
On Tue, Apr 27, 2021 at 01:43:11PM -0700, Yu-cheng Yu wrote:
> @@ -1951,6 +1951,8 @@ config X86_SHADOW_STACK
> depends on AS_WRUSS
> depends on ARCH_HAS_SHADOW_STACK
> select ARCH_USES_HIGH_VMA_FLAGS
> + select ARCH_USE_GNU_PROPERTY
> + select ARCH_BINFMT_ELF_STATE
^^^^^^^^
What's that for? Isn't ARCH_USE_GNU_PROPERTY enough?
> +int arch_setup_elf_property(struct arch_elf_state *state)
> +{
> + int r = 0;
> +
> + if (!IS_ENABLED(CONFIG_X86_SHADOW_STACK))
> + return r;
> +
> + memset(¤t->thread.cet, 0, sizeof(struct cet_status));
> +
> + if (static_cpu_has(X86_FEATURE_SHSTK)) {
cpu_feature_enabled
> + if (state->gnu_property & GNU_PROPERTY_X86_FEATURE_1_SHSTK)
> + r = shstk_setup();
> + }
> +
> + return r;
> +}
> +#endif
...
> diff --git a/include/uapi/linux/elf.h b/include/uapi/linux/elf.h
> index 30f68b42eeb5..24ba55ba8278 100644
> --- a/include/uapi/linux/elf.h
> +++ b/include/uapi/linux/elf.h
> @@ -455,4 +455,13 @@ typedef struct elf64_note {
> /* Bits for GNU_PROPERTY_AARCH64_FEATURE_1_BTI */
> #define GNU_PROPERTY_AARCH64_FEATURE_1_BTI (1U << 0)
>
> +/* .note.gnu.property types for x86: */
> +#define GNU_PROPERTY_X86_FEATURE_1_AND 0xc0000002
Why not 0xc0000001? ARM64 is 0xc0000000...
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists