All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Rich Felker <dalias@libc.org>
Cc: Palmer Dabbelt <palmer@dabbelt.com>,
	ebiederm@xmission.com, damien.lemoal@opensource.wdc.com,
	Niklas.Cassel@wdc.com, viro@zeniv.linux.org.uk,
	Paul Walmsley <paul.walmsley@sifive.com>,
	aou@eecs.berkeley.edu, vapier@gentoo.org, stable@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	linux-riscv@lists.infradead.org, linux-arch@vger.kernel.org,
	geert@linux-m68k.org, linux-m68k@lists.linux-m68k.org,
	gerg@linux-m68k.org, linux-arm-kernel@lists.infradead.org,
	linux-sh@vger.kernel.org, ysato@users.sourceforge.jp
Subject: Re: [PATCH] binfmt_flat: Remove shared library support
Date: Wed, 20 Apr 2022 10:47:39 -0700	[thread overview]
Message-ID: <202204201044.ACFEB0C@keescook> (raw)
In-Reply-To: <20220420165935.GA12207@brightrain.aerifal.cx>

On Wed, Apr 20, 2022 at 12:59:37PM -0400, Rich Felker wrote:
> On Wed, Apr 20, 2022 at 09:17:22AM -0700, Palmer Dabbelt wrote:
> > On Wed, 20 Apr 2022 07:58:03 PDT (-0700), ebiederm@xmission.com wrote:
> > >
> > >In a recent discussion[1] it was reported that the binfmt_flat library
> > >support was only ever used on m68k and even on m68k has not been used
> > >in a very long time.
> > >
> > >The structure of binfmt_flat is different from all of the other binfmt
> > >implementations becasue of this shared library support and it made
> > >life and code review more effort when I refactored the code in fs/exec.c.
> > >
> > >Since in practice the code is dead remove the binfmt_flat shared libarary
> > >support and make maintenance of the code easier.
> > >
> > >[1] https://lkml.kernel.org/r/81788b56-5b15-7308-38c7-c7f2502c4e15@linux-m68k.org
> > >Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
> > >---
> > >
> > >Can the binfmt_flat folks please verify that the shared library support
> > >really isn't used?
> > 
> > I don't actually know follow the RISC-V flat support, last I heard it was still
> > sort of just in limbo (some toolchain/userspace bugs th at needed to be sorted
> > out).  Damien would know better, though, he's already on the thread.  I'll
> > leave it up to him to ack this one, if you were even looking for anything from
> > the RISC-V folks at all (we don't have this in any defconfigs).
> 
> For what it's worth, bimfmt_flat (with or without shared library
> support) should be simple to implement as a binfmt_misc handler if
> anyone needs the old shared library support (or if kernel wanted to
> drop it entirely, which I would be in favor of). That's how I handled
> old aout binaries I wanted to run after aout was removed: trivial
> binfmt_misc loader.

Yeah, I was trying to understand why systems were using binfmt_flat and
not binfmt_elf, given the mention of elf2flat -- is there really such a
large kernel memory footprint savings to be had from removing
binfmt_elf?

But regardless, yes, it seems like if you're doing anything remotely
needing shared libraries with binfmt_flat, such a system could just use
ELF instead.

-- 
Kees Cook

WARNING: multiple messages have this Message-ID (diff)
From: Kees Cook <keescook@chromium.org>
To: Rich Felker <dalias@libc.org>
Cc: Palmer Dabbelt <palmer@dabbelt.com>,
	ebiederm@xmission.com, damien.lemoal@opensource.wdc.com,
	Niklas.Cassel@wdc.com, viro@zeniv.linux.org.uk,
	Paul Walmsley <paul.walmsley@sifive.com>,
	aou@eecs.berkeley.edu, vapier@gentoo.org, stable@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	linux-riscv@lists.infradead.org, linux-arch@vger.kernel.org,
	geert@linux-m68k.org, linux-m68k@lists.linux-m68k.org,
	gerg@linux-m68k.org, linux-arm-kernel@lists.infradead.org,
	linux-sh@vger.kernel.org, ysato@users.sourceforge.jp
Subject: Re: [PATCH] binfmt_flat: Remove shared library support
Date: Wed, 20 Apr 2022 10:47:39 -0700	[thread overview]
Message-ID: <202204201044.ACFEB0C@keescook> (raw)
In-Reply-To: <20220420165935.GA12207@brightrain.aerifal.cx>

On Wed, Apr 20, 2022 at 12:59:37PM -0400, Rich Felker wrote:
> On Wed, Apr 20, 2022 at 09:17:22AM -0700, Palmer Dabbelt wrote:
> > On Wed, 20 Apr 2022 07:58:03 PDT (-0700), ebiederm@xmission.com wrote:
> > >
> > >In a recent discussion[1] it was reported that the binfmt_flat library
> > >support was only ever used on m68k and even on m68k has not been used
> > >in a very long time.
> > >
> > >The structure of binfmt_flat is different from all of the other binfmt
> > >implementations becasue of this shared library support and it made
> > >life and code review more effort when I refactored the code in fs/exec.c.
> > >
> > >Since in practice the code is dead remove the binfmt_flat shared libarary
> > >support and make maintenance of the code easier.
> > >
> > >[1] https://lkml.kernel.org/r/81788b56-5b15-7308-38c7-c7f2502c4e15@linux-m68k.org
> > >Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
> > >---
> > >
> > >Can the binfmt_flat folks please verify that the shared library support
> > >really isn't used?
> > 
> > I don't actually know follow the RISC-V flat support, last I heard it was still
> > sort of just in limbo (some toolchain/userspace bugs th at needed to be sorted
> > out).  Damien would know better, though, he's already on the thread.  I'll
> > leave it up to him to ack this one, if you were even looking for anything from
> > the RISC-V folks at all (we don't have this in any defconfigs).
> 
> For what it's worth, bimfmt_flat (with or without shared library
> support) should be simple to implement as a binfmt_misc handler if
> anyone needs the old shared library support (or if kernel wanted to
> drop it entirely, which I would be in favor of). That's how I handled
> old aout binaries I wanted to run after aout was removed: trivial
> binfmt_misc loader.

Yeah, I was trying to understand why systems were using binfmt_flat and
not binfmt_elf, given the mention of elf2flat -- is there really such a
large kernel memory footprint savings to be had from removing
binfmt_elf?

But regardless, yes, it seems like if you're doing anything remotely
needing shared libraries with binfmt_flat, such a system could just use
ELF instead.

-- 
Kees Cook

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

WARNING: multiple messages have this Message-ID (diff)
From: Kees Cook <keescook@chromium.org>
To: Rich Felker <dalias@libc.org>
Cc: Palmer Dabbelt <palmer@dabbelt.com>,
	ebiederm@xmission.com, damien.lemoal@opensource.wdc.com,
	Niklas.Cassel@wdc.com, viro@zeniv.linux.org.uk,
	Paul Walmsley <paul.walmsley@sifive.com>,
	aou@eecs.berkeley.edu, vapier@gentoo.org, stable@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	linux-riscv@lists.infradead.org, linux-arch@vger.kernel.org,
	geert@linux-m68k.org, linux-m68k@lists.linux-m68k.org,
	gerg@linux-m68k.org, linux-arm-kernel@lists.infradead.org,
	linux-sh@vger.kernel.org, ysato@users.sourceforge.jp
Subject: Re: [PATCH] binfmt_flat: Remove shared library support
Date: Wed, 20 Apr 2022 10:47:39 -0700	[thread overview]
Message-ID: <202204201044.ACFEB0C@keescook> (raw)
In-Reply-To: <20220420165935.GA12207@brightrain.aerifal.cx>

On Wed, Apr 20, 2022 at 12:59:37PM -0400, Rich Felker wrote:
> On Wed, Apr 20, 2022 at 09:17:22AM -0700, Palmer Dabbelt wrote:
> > On Wed, 20 Apr 2022 07:58:03 PDT (-0700), ebiederm@xmission.com wrote:
> > >
> > >In a recent discussion[1] it was reported that the binfmt_flat library
> > >support was only ever used on m68k and even on m68k has not been used
> > >in a very long time.
> > >
> > >The structure of binfmt_flat is different from all of the other binfmt
> > >implementations becasue of this shared library support and it made
> > >life and code review more effort when I refactored the code in fs/exec.c.
> > >
> > >Since in practice the code is dead remove the binfmt_flat shared libarary
> > >support and make maintenance of the code easier.
> > >
> > >[1] https://lkml.kernel.org/r/81788b56-5b15-7308-38c7-c7f2502c4e15@linux-m68k.org
> > >Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
> > >---
> > >
> > >Can the binfmt_flat folks please verify that the shared library support
> > >really isn't used?
> > 
> > I don't actually know follow the RISC-V flat support, last I heard it was still
> > sort of just in limbo (some toolchain/userspace bugs th at needed to be sorted
> > out).  Damien would know better, though, he's already on the thread.  I'll
> > leave it up to him to ack this one, if you were even looking for anything from
> > the RISC-V folks at all (we don't have this in any defconfigs).
> 
> For what it's worth, bimfmt_flat (with or without shared library
> support) should be simple to implement as a binfmt_misc handler if
> anyone needs the old shared library support (or if kernel wanted to
> drop it entirely, which I would be in favor of). That's how I handled
> old aout binaries I wanted to run after aout was removed: trivial
> binfmt_misc loader.

Yeah, I was trying to understand why systems were using binfmt_flat and
not binfmt_elf, given the mention of elf2flat -- is there really such a
large kernel memory footprint savings to be had from removing
binfmt_elf?

But regardless, yes, it seems like if you're doing anything remotely
needing shared libraries with binfmt_flat, such a system could just use
ELF instead.

-- 
Kees Cook

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-04-20 17:47 UTC|newest]

Thread overview: 85+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-14  9:10 [PATCH v2] binfmt_flat: do not stop relocating GOT entries prematurely on riscv Niklas Cassel
2022-04-14  9:10 ` Niklas Cassel
2022-04-14 23:05 ` Kees Cook
2022-04-14 23:05   ` Kees Cook
2022-04-15  1:24   ` Niklas Cassel
2022-04-15  1:24     ` Niklas Cassel
2022-04-14 23:27 ` Kees Cook
2022-04-14 23:27   ` Kees Cook
2022-04-14 23:41   ` Damien Le Moal
2022-04-14 23:41     ` Damien Le Moal
2022-04-15  1:26   ` Konstantin Ryabitsev
2022-04-15  1:26     ` Konstantin Ryabitsev
2022-04-16  0:14     ` Kees Cook
2022-04-16  0:14       ` Kees Cook
2022-04-14 23:51 ` Damien Le Moal
2022-04-14 23:51   ` Damien Le Moal
2022-04-15  0:30   ` Niklas Cassel
2022-04-15  0:30     ` Niklas Cassel
2022-04-15  0:56     ` Damien Le Moal
2022-04-15  0:56       ` Damien Le Moal
2022-04-15  1:08       ` Niklas Cassel
2022-04-15  1:08         ` Niklas Cassel
2022-04-15  1:13         ` Damien Le Moal
2022-04-15  1:13           ` Damien Le Moal
2022-04-15  2:11           ` Niklas Cassel
2022-04-15  2:11             ` Niklas Cassel
2022-04-15  2:14             ` Damien Le Moal
2022-04-15  2:14               ` Damien Le Moal
2022-04-20  4:04     ` Greg Ungerer
2022-04-20  4:04       ` Greg Ungerer
2022-04-20 14:58       ` [PATCH] binfmt_flat: Remove shared library support Eric W. Biederman
2022-04-20 14:58         ` Eric W. Biederman
2022-04-20 14:58         ` Eric W. Biederman
2022-04-20 14:58         ` Eric W. Biederman
2022-04-20 16:17         ` Palmer Dabbelt
2022-04-20 16:17           ` Palmer Dabbelt
2022-04-20 16:17           ` Palmer Dabbelt
2022-04-20 16:59           ` Rich Felker
2022-04-20 16:59             ` Rich Felker
2022-04-20 16:59             ` Rich Felker
2022-04-20 17:47             ` Kees Cook [this message]
2022-04-20 17:47               ` Kees Cook
2022-04-20 17:47               ` Kees Cook
2022-04-20 20:04               ` Arnd Bergmann
2022-04-20 20:04                 ` Arnd Bergmann
2022-04-20 20:04                 ` Arnd Bergmann
2022-04-20 20:23                 ` Rich Felker
2022-04-20 20:23                   ` Rich Felker
2022-04-20 20:23                   ` Rich Felker
2022-04-20 23:00                   ` Damien Le Moal
2022-04-20 23:00                     ` Damien Le Moal
2022-04-20 23:00                     ` Damien Le Moal
2022-04-25  3:38               ` Rob Landley
2022-04-25  3:38                 ` Rob Landley
2022-04-25  3:38                 ` Rob Landley
2022-04-25  7:40                 ` Greg Ungerer
2022-04-25  7:40                   ` Greg Ungerer
2022-04-25  7:40                   ` Greg Ungerer
2022-04-20 23:36         ` Damien Le Moal
2022-04-20 23:36           ` Damien Le Moal
2022-04-20 23:36           ` Damien Le Moal
2022-04-20 23:53         ` Greg Ungerer
2022-04-20 23:53           ` Greg Ungerer
2022-04-20 23:53           ` Greg Ungerer
2022-04-21  6:52           ` Geert Uytterhoeven
2022-04-21  6:52             ` Geert Uytterhoeven
2022-04-21  6:52             ` Geert Uytterhoeven
2022-04-21  7:12             ` Arnd Bergmann
2022-04-21  7:12               ` Arnd Bergmann
2022-04-21  7:12               ` Arnd Bergmann
2022-04-22 10:26               ` Vladimir Murzin
2022-04-22 10:26                 ` Vladimir Murzin
2022-04-22 10:26                 ` Vladimir Murzin
2022-04-22 15:18               ` Patrice CHOTARD
2022-04-21 12:43             ` Rich Felker
2022-04-21 12:43               ` Rich Felker
2022-04-21 12:43               ` Rich Felker
2022-04-25  3:50               ` Rob Landley
2022-04-25  3:50                 ` Rob Landley
2022-04-25  3:50                 ` Rob Landley
2022-04-21  0:05         ` (subset) " Kees Cook
2022-04-21  0:05           ` Kees Cook
2022-04-21  0:05           ` Kees Cook
2022-04-16  4:25 ` [PATCH v2] binfmt_flat: do not stop relocating GOT entries prematurely on riscv Kees Cook
2022-04-16  4:25   ` 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=202204201044.ACFEB0C@keescook \
    --to=keescook@chromium.org \
    --cc=Niklas.Cassel@wdc.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=dalias@libc.org \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=ebiederm@xmission.com \
    --cc=geert@linux-m68k.org \
    --cc=gerg@linux-m68k.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=stable@vger.kernel.org \
    --cc=vapier@gentoo.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=ysato@users.sourceforge.jp \
    /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.