Re: [PATCH 1/4] exec: Change uselib(2) IS_SREG() failure to EACCES

2020-05-19 Thread Eric W. Biederman
Christian Brauner writes: > On Tue, May 19, 2020 at 07:28:46AM -0500, Eric W. Biederman wrote: >> Andreas Schwab writes: >> >> > On Mai 19 2020, Eric W. Biederman wrote: >> > >> >> I am wondering if there are source trees for libc4 or libc5 around >> >> anywhere that we can look at to see how u

Re: [PATCH 1/4] exec: Change uselib(2) IS_SREG() failure to EACCES

2020-05-19 Thread Christian Brauner
On Tue, May 19, 2020 at 04:32:38PM +0200, Geert Uytterhoeven wrote: > Hi Christian, > > On Tue, May 19, 2020 at 3:15 PM Christian Brauner > wrote: > > On Tue, May 19, 2020 at 06:56:36AM -0500, Eric W. Biederman wrote: > > > Andreas Schwab writes: > > > > On Mai 18 2020, Eric W. Biederman wrote:

Re: [PATCH 1/4] exec: Change uselib(2) IS_SREG() failure to EACCES

2020-05-19 Thread Geert Uytterhoeven
Hi Christian, On Tue, May 19, 2020 at 3:15 PM Christian Brauner wrote: > On Tue, May 19, 2020 at 06:56:36AM -0500, Eric W. Biederman wrote: > > Andreas Schwab writes: > > > On Mai 18 2020, Eric W. Biederman wrote: > > >> If it was only libc4 and libc5 that used the uselib system call then it > >

Re: [PATCH 1/4] exec: Change uselib(2) IS_SREG() failure to EACCES

2020-05-19 Thread Christian Brauner
On Tue, May 19, 2020 at 07:28:46AM -0500, Eric W. Biederman wrote: > Andreas Schwab writes: > > > On Mai 19 2020, Eric W. Biederman wrote: > > > >> I am wondering if there are source trees for libc4 or libc5 around > >> anywhere that we can look at to see how usage of uselib evolved. > > > > libc

Re: [PATCH 1/4] exec: Change uselib(2) IS_SREG() failure to EACCES

2020-05-19 Thread Christian Brauner
On Tue, May 19, 2020 at 06:56:36AM -0500, Eric W. Biederman wrote: > Andreas Schwab writes: > > > On Mai 18 2020, Eric W. Biederman wrote: > > > >> If it was only libc4 and libc5 that used the uselib system call then it > >> can probably be removed after enough time. > > > > Only libc4 used it, l

Re: [PATCH 1/4] exec: Change uselib(2) IS_SREG() failure to EACCES

2020-05-19 Thread Eric W. Biederman
Andreas Schwab writes: > On Mai 19 2020, Eric W. Biederman wrote: > >> I am wondering if there are source trees for libc4 or libc5 around >> anywhere that we can look at to see how usage of uselib evolved. > > libc5 is available from archive.debian.org. > > http://archive.debian.org/debian-archiv

Re: [PATCH 1/4] exec: Change uselib(2) IS_SREG() failure to EACCES

2020-05-19 Thread Andreas Schwab
On Mai 19 2020, Eric W. Biederman wrote: > I am wondering if there are source trees for libc4 or libc5 around > anywhere that we can look at to see how usage of uselib evolved. libc5 is available from archive.debian.org. http://archive.debian.org/debian-archive/debian/pool/main/libc/libc/libc_5.

Re: [PATCH 1/4] exec: Change uselib(2) IS_SREG() failure to EACCES

2020-05-19 Thread Eric W. Biederman
Andreas Schwab writes: > On Mai 18 2020, Eric W. Biederman wrote: > >> If it was only libc4 and libc5 that used the uselib system call then it >> can probably be removed after enough time. > > Only libc4 used it, libc5 was already ELF. binfmt_elf.c supports uselib. In a very a.out ish way. Do

Re: [PATCH 1/4] exec: Change uselib(2) IS_SREG() failure to EACCES

2020-05-19 Thread Andreas Schwab
On Mai 18 2020, Eric W. Biederman wrote: > If it was only libc4 and libc5 that used the uselib system call then it > can probably be removed after enough time. Only libc4 used it, libc5 was already ELF. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69

Re: [PATCH 1/4] exec: Change uselib(2) IS_SREG() failure to EACCES

2020-05-19 Thread Christian Brauner
On Mon, May 18, 2020 at 06:57:15PM -0500, Eric W. Biederman wrote: > Christian Brauner writes: > > > On Mon, May 18, 2020 at 04:43:20PM +0200, Jann Horn wrote: > >> On Mon, May 18, 2020 at 3:03 PM Christian Brauner > >> wrote: > >> > Also - gulp (puts on flame proof suit) - may I suggest we chec

Re: [PATCH 1/4] exec: Change uselib(2) IS_SREG() failure to EACCES

2020-05-18 Thread Eric W. Biederman
Christian Brauner writes: > On Mon, May 18, 2020 at 04:43:20PM +0200, Jann Horn wrote: >> On Mon, May 18, 2020 at 3:03 PM Christian Brauner >> wrote: >> > Also - gulp (puts on flame proof suit) - may I suggest we check if there >> > are any distros out there that still set CONFIG_USELIB=y >> >>

Re: [PATCH 1/4] exec: Change uselib(2) IS_SREG() failure to EACCES

2020-05-18 Thread Christian Brauner
On Mon, May 18, 2020 at 04:43:20PM +0200, Jann Horn wrote: > On Mon, May 18, 2020 at 3:03 PM Christian Brauner > wrote: > > Also - gulp (puts on flame proof suit) - may I suggest we check if there > > are any distros out there that still set CONFIG_USELIB=y > > Debian seems to have it enabled on

Re: [PATCH 1/4] exec: Change uselib(2) IS_SREG() failure to EACCES

2020-05-18 Thread Jann Horn
On Mon, May 18, 2020 at 3:03 PM Christian Brauner wrote: > Also - gulp (puts on flame proof suit) - may I suggest we check if there > are any distros out there that still set CONFIG_USELIB=y Debian seems to have it enabled on x86... https://salsa.debian.org/kernel-team/linux/-/blob/master/debian

Re: [PATCH 1/4] exec: Change uselib(2) IS_SREG() failure to EACCES

2020-05-18 Thread Christian Brauner
On Sun, May 17, 2020 at 10:54:54PM -0700, Kees Cook wrote: > Change uselib(2)' S_ISREG() error return to EACCES instead of EINVAL so > the behavior matches execve(2), and the seemingly documented value. > The "not a regular file" failure mode of execve(2) is explicitly > documented[1], but it is no

[PATCH 1/4] exec: Change uselib(2) IS_SREG() failure to EACCES

2020-05-17 Thread Kees Cook
Change uselib(2)' S_ISREG() error return to EACCES instead of EINVAL so the behavior matches execve(2), and the seemingly documented value. The "not a regular file" failure mode of execve(2) is explicitly documented[1], but it is not mentioned in uselib(2)[2] which does, however, say that open(2) a