All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Alejandro Colomar <alx@kernel.org>
Cc: linux-mm@kvack.org, "Eric W. Biederman" <ebiederm@xmission.com>,
	Matthew Wilcox <willy@infradead.org>,
	David Howells <dhowells@redhat.com>,
	Rolf Eike Beer <eb@emlix.com>, Arnd Bergmann <arnd@arndb.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: Re: [PATCH v1] elf, uapi: Remove struct tag 'dynamic'
Date: Fri, 22 Sep 2023 10:03:37 -0700	[thread overview]
Message-ID: <202309221001.F8554AEB4@keescook> (raw)
In-Reply-To: <20230829185121.326228-1-alx@kernel.org>

On Tue, Aug 29, 2023 at 08:51:22PM +0200, Alejandro Colomar wrote:
> Such a generic struct tag shouldn't have been exposed in a public
> header.  Since it's undocumented, we can assume it's a historical
> accident.  And since no software (at least on Debian) relies on this
> tag, we can safely remove it.
> 
> Here are the results of a Debian Code Search[1]:
> 
> $ # packages that contain 'include [<"]linux/elf\.h[">]'
> $ curl -s https://codesearch.debian.net/results/e5e7c74dfcdae609/packages.txt > include
> $ # packages that contain '\bstruct dynamic\b'
> $ curl -s https://codesearch.debian.net/results/b23577e099048c6a/packages.txt > struct
> $ cat struct include | sort | uniq -d
> chromium
> hurd
> linux
> qemu
> qt6-webengine
> qtwebengine-opensource-src
> $ # chromium: Seems to hold a copy of the UAPI header.  No uses of the tag.
> $ # hurd:     Same thing as chromium.
> $ # linux:    :)
> $ # qemu:     Same thing as chromium.
> $ # qt6-webengine:  Same thing as all.
> $ # qtwebengine-opensource-src:  Yet another copy.
> 
> Link: [1] <https://codesearch.debian.net/>
> Link: <https://lore.kernel.org/linux-mm/87wmxdokum.fsf@email.froward.int.ebiederm.org/T/>
> Cc: "Eric W. Biederman" <ebiederm@xmission.com>
> Cc: Matthew Wilcox <willy@infradead.org>
> Cc: David Howells <dhowells@redhat.com>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Rolf Eike Beer <eb@emlix.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> Signed-off-by: Alejandro Colomar <alx@kernel.org>

[fixed Cc: list for linux-mm]
[fixed link reference]

Applied to for-next/execve tree. Thanks!

https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?h=for-next/execve&id=d113624679391d9088d0e8fd06797711eb1285ac

-Kees

> ---
>  include/uapi/linux/elf.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/uapi/linux/elf.h b/include/uapi/linux/elf.h
> index e0e159138331..342bd7f2e025 100644
> --- a/include/uapi/linux/elf.h
> +++ b/include/uapi/linux/elf.h
> @@ -140,7 +140,7 @@ typedef __s64	Elf64_Sxword;
>  #define ELF64_ST_BIND(x)	ELF_ST_BIND(x)
>  #define ELF64_ST_TYPE(x)	ELF_ST_TYPE(x)
>  
> -typedef struct dynamic {
> +typedef struct {
>    Elf32_Sword d_tag;
>    union {
>      Elf32_Sword	d_val;
> -- 
> 2.40.1
> 

-- 
Kees Cook


      parent reply	other threads:[~2023-09-22 17:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-29 12:08 'struct dynamic': struct tag leak in UAPI headers Alejandro Colomar
2023-08-29 12:24 ` Matthew Wilcox
2023-08-29 13:27   ` Alejandro Colomar
2023-08-29 14:17     ` Matthew Wilcox
2023-08-29 14:20       ` Alejandro Colomar
2023-08-29 16:48         ` Eric W. Biederman
2023-08-29 17:46           ` Alejandro Colomar
     [not found] ` <20230829185121.326228-1-alx@kernel.org>
     [not found]   ` <6bd4800d-5e99-48a0-a407-2213112f4fb2@kernel.org>
     [not found]     ` <202309220940.B2730B3B@keescook>
2023-09-22 16:44       ` Ping: [PATCH v1] elf, uapi: Remove struct tag 'dynamic' Kees Cook
2023-09-22 17:01         ` Alejandro Colomar
2023-09-22 17:03   ` Kees Cook [this message]

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=202309221001.F8554AEB4@keescook \
    --to=keescook@chromium.org \
    --cc=alx@kernel.org \
    --cc=arnd@arndb.de \
    --cc=dhowells@redhat.com \
    --cc=eb@emlix.com \
    --cc=ebiederm@xmission.com \
    --cc=linux-mm@kvack.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=willy@infradead.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.