From: Kees Cook <kees@kernel.org>
To: "Balasubrmanian, Vignesh" <vigbalas@amd.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
"Balasubrmanian, Vignesh" <Vignesh.Balasubrmanian@amd.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-toolchains@vger.kernel.org"
<linux-toolchains@vger.kernel.org>,
"mpe@ellerman.id.au" <mpe@ellerman.id.au>,
"npiggin@gmail.com" <npiggin@gmail.com>,
"christophe.leroy@csgroup.eu" <christophe.leroy@csgroup.eu>,
"aneesh.kumar@kernel.org" <aneesh.kumar@kernel.org>,
"naveen.n.rao@linux.ibm.com" <naveen.n.rao@linux.ibm.com>,
"ebiederm@xmission.com" <ebiederm@xmission.com>,
"x86@kernel.org" <x86@kernel.org>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"Petkov, Borislav" <Borislav.Petkov@amd.com>,
"George, Jini Susan" <JiniSusan.George@amd.com>,
"matz@suse.de" <matz@suse.de>,
"binutils@sourceware.org" <binutils@sourceware.org>,
"jhb@FreeBSD.org" <jhb@freebsd.org>,
"felix.willgerodt@intel.com" <felix.willgerodt@intel.com>,
Borislav Petkov <bp@alien8.de>
Subject: Re: [PATCH v3 1/1] x86/elf: Add a new .note section containing xfeatures buffer layout info to x86 core files
Date: Wed, 17 Jul 2024 10:16:52 -0700 [thread overview]
Message-ID: <202407171010.DC51195@keescook> (raw)
In-Reply-To: <a4943b94-3407-42a0-9273-f7948ae8c35b@amd.com>
On Wed, Jul 17, 2024 at 03:02:23PM +0530, Balasubrmanian, Vignesh wrote:
>
> On 7/13/2024 4:12 PM, Thomas Gleixner wrote:
> > Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
> >
> >
> > On Fri, Jul 12 2024 at 15:16, Vignesh Balasubramanian wrote:
> > > diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h
> > > index 1fb83d477..cad37090b 100644
> > > --- a/arch/x86/include/asm/elf.h
> > > +++ b/arch/x86/include/asm/elf.h
> > > @@ -13,6 +13,15 @@
> > > #include <asm/auxvec.h>
> > > #include <asm/fsgsbase.h>
> > >
> > > +struct xfeat_component {
> > > + u32 type;
> > > + u32 size;
> > > + u32 offset;
> > > + u32 flags;
> > > +} __packed;
> > > +
> > > +_Static_assert(sizeof(struct xfeat_component)%4 == 0, "xfeat_component is not aligned");
> > This struct is only used in xstate.c and asm/elf.h is not a UAPI
> > header. So what's the point of declaring it in the header instead of
> > xtsate.c?
> >
> > If this needs to provided for user space consumption, then it want's to
> > be in a UAPI header, no?
> Our initial idea is to pass the "struct xfeat_component" through "glibc".
> is "include/uapi/linux/elf.h" proper header to add this ?
I'd rather not put arch-specific things in the main UAPI elf.h file
unless there is a good reason.
> I couldn't see any proper header inside "arch/x86/include/uapi/asm/".
Other architectures have arch/*/include/uapi/asm/elf.h, so it may be
time to add one for x86 too. For this to be UAPI, I would want to see
more explicit namespacing, e.g. struct x86_xfeat_component, etc.
-Kees
--
Kees Cook
WARNING: multiple messages have this Message-ID (diff)
From: Kees Cook <kees@kernel.org>
To: "Balasubrmanian, Vignesh" <vigbalas@amd.com>
Cc: "matz@suse.de" <matz@suse.de>,
"George, Jini Susan" <JiniSusan.George@amd.com>,
"felix.willgerodt@intel.com" <felix.willgerodt@intel.com>,
"jhb@FreeBSD.org" <jhb@freebsd.org>,
"binutils@sourceware.org" <binutils@sourceware.org>,
"x86@kernel.org" <x86@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"npiggin@gmail.com" <npiggin@gmail.com>,
"Petkov, Borislav" <Borislav.Petkov@amd.com>,
"aneesh.kumar@kernel.org" <aneesh.kumar@kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
Borislav Petkov <bp@alien8.de>,
"christophe.leroy@csgroup.eu" <christophe.leroy@csgroup.eu>,
"linux-toolchains@vger.kernel.org"
<linux-toolchains@vger.kernel.org>,
"naveen.n.rao@linux.ibm.com" <naveen.n.rao@linux.ibm.com>,
Thomas Gleixner <tglx@linutronix.de>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
"Balasubrmanian, Vignesh" <Vignesh.Balasubrmanian@amd.com>,
"ebiederm@xmission.com" <ebiederm@xmission.com>
Subject: Re: [PATCH v3 1/1] x86/elf: Add a new .note section containing xfeatures buffer layout info to x86 core files
Date: Wed, 17 Jul 2024 10:16:52 -0700 [thread overview]
Message-ID: <202407171010.DC51195@keescook> (raw)
In-Reply-To: <a4943b94-3407-42a0-9273-f7948ae8c35b@amd.com>
On Wed, Jul 17, 2024 at 03:02:23PM +0530, Balasubrmanian, Vignesh wrote:
>
> On 7/13/2024 4:12 PM, Thomas Gleixner wrote:
> > Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
> >
> >
> > On Fri, Jul 12 2024 at 15:16, Vignesh Balasubramanian wrote:
> > > diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h
> > > index 1fb83d477..cad37090b 100644
> > > --- a/arch/x86/include/asm/elf.h
> > > +++ b/arch/x86/include/asm/elf.h
> > > @@ -13,6 +13,15 @@
> > > #include <asm/auxvec.h>
> > > #include <asm/fsgsbase.h>
> > >
> > > +struct xfeat_component {
> > > + u32 type;
> > > + u32 size;
> > > + u32 offset;
> > > + u32 flags;
> > > +} __packed;
> > > +
> > > +_Static_assert(sizeof(struct xfeat_component)%4 == 0, "xfeat_component is not aligned");
> > This struct is only used in xstate.c and asm/elf.h is not a UAPI
> > header. So what's the point of declaring it in the header instead of
> > xtsate.c?
> >
> > If this needs to provided for user space consumption, then it want's to
> > be in a UAPI header, no?
> Our initial idea is to pass the "struct xfeat_component" through "glibc".
> is "include/uapi/linux/elf.h" proper header to add this ?
I'd rather not put arch-specific things in the main UAPI elf.h file
unless there is a good reason.
> I couldn't see any proper header inside "arch/x86/include/uapi/asm/".
Other architectures have arch/*/include/uapi/asm/elf.h, so it may be
time to add one for x86 too. For this to be UAPI, I would want to see
more explicit namespacing, e.g. struct x86_xfeat_component, etc.
-Kees
--
Kees Cook
next prev parent reply other threads:[~2024-07-17 17:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-12 9:46 [PATCH v3 0/1] Add XSAVE layout description to Core files for debuggers to support varying XSAVE layouts Vignesh Balasubramanian
2024-07-12 9:46 ` Vignesh Balasubramanian
2024-07-12 9:46 ` [PATCH v3 1/1] x86/elf: Add a new .note section containing xfeatures buffer layout info to x86 core files Vignesh Balasubramanian
2024-07-12 9:46 ` Vignesh Balasubramanian
2024-07-13 10:42 ` Thomas Gleixner
2024-07-13 10:42 ` Thomas Gleixner
2024-07-17 9:32 ` Balasubrmanian, Vignesh
2024-07-17 9:32 ` Balasubrmanian, Vignesh
2024-07-17 17:16 ` Kees Cook [this message]
2024-07-17 17:16 ` Kees Cook
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202407171010.DC51195@keescook \
--to=kees@kernel.org \
--cc=Borislav.Petkov@amd.com \
--cc=JiniSusan.George@amd.com \
--cc=Vignesh.Balasubrmanian@amd.com \
--cc=aneesh.kumar@kernel.org \
--cc=binutils@sourceware.org \
--cc=bp@alien8.de \
--cc=christophe.leroy@csgroup.eu \
--cc=ebiederm@xmission.com \
--cc=felix.willgerodt@intel.com \
--cc=jhb@freebsd.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-toolchains@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=matz@suse.de \
--cc=mpe@ellerman.id.au \
--cc=naveen.n.rao@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=tglx@linutronix.de \
--cc=vigbalas@amd.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.