[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z3alYSFvKLf0e+/K@e133380.arm.com>
Date: Thu, 2 Jan 2025 14:40:33 +0000
From: Dave Martin <Dave.Martin@....com>
To: Akihiko Odaki <akihiko.odaki@...nix.com>
Cc: Eric Biederman <ebiederm@...ssion.com>, Kees Cook <kees@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
Mark Brown <broonie@...nel.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, devel@...nix.com
Subject: Re: [PATCH] elf: Correct note name comment
Hi,
On Wed, Dec 25, 2024 at 03:46:44PM +0900, Akihiko Odaki wrote:
> NT_PRSTATUS note is also named "CORE". Correct the comment accordingly.
>
> Fixes: 00e19ceec80b ("ELF: Add ELF program property parsing support")
> Signed-off-by: Akihiko Odaki <akihiko.odaki@...nix.com>
> ---
> include/uapi/linux/elf.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/uapi/linux/elf.h b/include/uapi/linux/elf.h
> index b54b313bcf07..4f00cdca38b2 100644
> --- a/include/uapi/linux/elf.h
> +++ b/include/uapi/linux/elf.h
> @@ -372,8 +372,8 @@ typedef struct elf64_shdr {
> * Notes used in ET_CORE. Architectures export some of the arch register sets
> * using the corresponding note types via the PTRACE_GETREGSET and
> * PTRACE_SETREGSET requests.
> - * The note name for these types is "LINUX", except NT_PRFPREG that is named
> - * "CORE".
> + * The note name for these types is "LINUX", except NT_PRSTATUS and NT_PRFPREG
> + * that are named "CORE".
> */
> #define NT_PRSTATUS 1
> #define NT_PRFPREG 2
[...]
This still seems rather confusing. It's not clear which note types are
being referred to in "for these types". I think this statement was
supposed to refer only to the architectural regset notes.
I guess "CORE" was for generic coredump notes goverened by common
specs, and LINUX was for Linux-specific stuff, but I suspect that this
distinction may have bitrotted. It looks like the ELF specs never
defined the core dump format, so the concept of non-OS-specific
coredump notes may not make much sense.
The ELF specs _do_ explicitly say [1] that the note name must be taken
into account when identifying the type of a note, so the note name for
each kind if note should really be documented explicitly.
Is it worth adding explicit #defines for the note name of each kind
of note, to make the ABI contract explicit?
Cheers
---Dave
[1] e.g.: System V ABI - DRAFT 24 April 2001
https://refspecs.linuxfoundation.org/elf/gabi4+/contents.html
(Linked from ELF and ABI Standards,
https://refspecs.linuxfoundation.org/elf/index.html )
Powered by blists - more mailing lists