[RESEND] elf: correct note name comment

Message ID a7e56e9c0f821348a4c833ac07e7518f457cbdb8.1687413763.git.baruch@tkos.co.il
State New
Headers
Series [RESEND] elf: correct note name comment |

Commit Message

Baruch Siach June 22, 2023, 6:02 a.m. UTC
  Only the NT_PRFPREG note is named "LINUX". Correct the comment
accordingly.

Fixes: 00e19ceec80b ("ELF: Add ELF program property parsing support")
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---

Resending in hope kvack.org mail server would be willing to accept my
submission this time.

Adding LKML as a safety net.
---
 include/uapi/linux/elf.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Kees Cook June 22, 2023, 8:07 p.m. UTC | #1
On Thu, Jun 22, 2023 at 09:02:43AM +0300, Baruch Siach wrote:
> Only the NT_PRFPREG note is named "LINUX". Correct the comment
> accordingly.
> 
> Fixes: 00e19ceec80b ("ELF: Add ELF program property parsing support")
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
> 
> Resending in hope kvack.org mail server would be willing to accept my
> submission this time.
> 
> Adding LKML as a safety net.
> ---
>  include/uapi/linux/elf.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git include/uapi/linux/elf.h include/uapi/linux/elf.h
> index ac3da855fb19..a8a0cced62c6 100644
> --- include/uapi/linux/elf.h
> +++ include/uapi/linux/elf.h
> @@ -372,7 +372,7 @@ 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 all these is "LINUX".
> + * The note name for most types is "CORE". NT_PRFPREG note is named "LINUX".
>   */
>  #define NT_PRSTATUS	1
>  #define NT_PRFPREG	2

Is this accurate? I see this logic in fs/binfmt_elf.c:

                bool is_fpreg = note_type == NT_PRFPREG;
		...
                fill_note(&t->notes[note_iter], is_fpreg ? "CORE" : "LINUX",
                          note_type, ret, data);

i.e. only FPREG is named "CORE", otherwise "LINUX".

Shouldn't this patch have CORE and LINUX swapped?
  

Patch

diff --git include/uapi/linux/elf.h include/uapi/linux/elf.h
index ac3da855fb19..a8a0cced62c6 100644
--- include/uapi/linux/elf.h
+++ include/uapi/linux/elf.h
@@ -372,7 +372,7 @@  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 all these is "LINUX".
+ * The note name for most types is "CORE". NT_PRFPREG note is named "LINUX".
  */
 #define NT_PRSTATUS	1
 #define NT_PRFPREG	2