Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Simon J. Gerraty
Konstantin Belousov wrote: > > Consider a downstream vendor who has support for signed binary > > executions. If rtld allows a backdoor around exec(2) to run an unsigned > > binary, that could be a problem for them. It is on them to add support > > to exec(2) to validate the special case of exec

Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Alexey Dokuchaev
On Mon, May 15, 2017 at 01:00:48PM -0700, Rodney W. Grimes wrote: > > On Mon, May 15, 2017 at 03:09:33PM -0400, Nikolai Lifanov wrote: > > > On 05/15/2017 14:52, Alexey Dokuchaev wrote: > > ... > > Because /bin/chmod is owned by root, not because /libexec/ld-elf.so.1 is > > limiting execution to ro

Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Rodney W. Grimes
> On Mon, May 15, 2017 at 03:09:33PM -0400, Nikolai Lifanov wrote: > > On 05/15/2017 14:52, Alexey Dokuchaev wrote: > > > Does it mean that old Linux' trick of /lib/ld-linux.so.2 /bin/chmod +x > > > /bin/chmod would now be possible on FreeBSD as well? Does this have > > > any security implications

Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Nikolai Lifanov
On 05/15/2017 15:52, Konstantin Belousov wrote: > On Mon, May 15, 2017 at 07:42:23PM +, Alexey Dokuchaev wrote: >> On Mon, May 15, 2017 at 10:40:49PM +0300, Konstantin Belousov wrote: >>> On Mon, May 15, 2017 at 03:37:42PM -0400, Nikolai Lifanov wrote: On 05/15/2017 15:36, Alexey Dokuchaev

Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Konstantin Belousov
On Mon, May 15, 2017 at 07:42:23PM +, Alexey Dokuchaev wrote: > On Mon, May 15, 2017 at 10:40:49PM +0300, Konstantin Belousov wrote: > > On Mon, May 15, 2017 at 03:37:42PM -0400, Nikolai Lifanov wrote: > > > On 05/15/2017 15:36, Alexey Dokuchaev wrote: > > > > ... > > > > Would this now allow e

Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Alexey Dokuchaev
On Mon, May 15, 2017 at 10:40:49PM +0300, Konstantin Belousov wrote: > On Mon, May 15, 2017 at 03:37:42PM -0400, Nikolai Lifanov wrote: > > On 05/15/2017 15:36, Alexey Dokuchaev wrote: > > > ... > > > Would this now allow executing binaries (with or without +x bit) from > > > filesystems mounted wi

Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Konstantin Belousov
On Mon, May 15, 2017 at 03:37:42PM -0400, Nikolai Lifanov wrote: > On 05/15/2017 15:36, Alexey Dokuchaev wrote: > > On Mon, May 15, 2017 at 10:25:29PM +0300, Konstantin Belousov wrote: > >> On Mon, May 15, 2017 at 01:08:55PM -0600, Ian Lepore wrote: > >>> Well, for example, it seems like it would a

Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Alexey Dokuchaev
On Mon, May 15, 2017 at 03:37:42PM -0400, Nikolai Lifanov wrote: > On 05/15/2017 15:36, Alexey Dokuchaev wrote: > > On Mon, May 15, 2017 at 10:25:29PM +0300, Konstantin Belousov wrote: > >> ... > >> The most advanced explanation that I was given in private was among > >> the lines: "if you have an

Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Nikolai Lifanov
On 05/15/2017 15:36, Alexey Dokuchaev wrote: > On Mon, May 15, 2017 at 10:25:29PM +0300, Konstantin Belousov wrote: >> On Mon, May 15, 2017 at 01:08:55PM -0600, Ian Lepore wrote: >>> Well, for example, it seems like it would allow anyone to execute a >>> binary even if the sysadmin had set it to -x

Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Nikolai Lifanov
On 05/15/2017 15:32, Bryan Drewery wrote: > On 5/15/2017 12:29 PM, Konstantin Belousov wrote: >> On Mon, May 15, 2017 at 12:25:20PM -0700, Bryan Drewery wrote: >>> On 5/15/2017 12:00 PM, Konstantin Belousov wrote: On Mon, May 15, 2017 at 06:52:36PM +, Alexey Dokuchaev wrote: > On Mon,

Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Alexey Dokuchaev
On Mon, May 15, 2017 at 10:25:29PM +0300, Konstantin Belousov wrote: > On Mon, May 15, 2017 at 01:08:55PM -0600, Ian Lepore wrote: > > Well, for example, it seems like it would allow anyone to execute a > > binary even if the sysadmin had set it to -x specifically to prevent > > people from running

Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Bryan Drewery
On 5/15/2017 12:29 PM, Konstantin Belousov wrote: > On Mon, May 15, 2017 at 12:25:20PM -0700, Bryan Drewery wrote: >> On 5/15/2017 12:00 PM, Konstantin Belousov wrote: >>> On Mon, May 15, 2017 at 06:52:36PM +, Alexey Dokuchaev wrote: On Mon, May 15, 2017 at 06:48:58PM +, Konstantin Bel

Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Konstantin Belousov
On Mon, May 15, 2017 at 12:25:20PM -0700, Bryan Drewery wrote: > On 5/15/2017 12:00 PM, Konstantin Belousov wrote: > > On Mon, May 15, 2017 at 06:52:36PM +, Alexey Dokuchaev wrote: > >> On Mon, May 15, 2017 at 06:48:58PM +, Konstantin Belousov wrote: > >>> New Revision: 318313 > >>> URL: ht

Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Konstantin Belousov
On Mon, May 15, 2017 at 01:08:55PM -0600, Ian Lepore wrote: > Well, for example, it seems like it would allow anyone to execute a > binary even if the sysadmin had set it to -x specifically to prevent > people from running it. The direct mode does not (and cannot) honor set{u,g}id modes of the exe

Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Bryan Drewery
On 5/15/2017 12:00 PM, Konstantin Belousov wrote: > On Mon, May 15, 2017 at 06:52:36PM +, Alexey Dokuchaev wrote: >> On Mon, May 15, 2017 at 06:48:58PM +, Konstantin Belousov wrote: >>> New Revision: 318313 >>> URL: https://svnweb.freebsd.org/changeset/base/318313 >>> >>> Log: >>> Make ld

Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Alexey Dokuchaev
On Mon, May 15, 2017 at 03:09:33PM -0400, Nikolai Lifanov wrote: > On 05/15/2017 14:52, Alexey Dokuchaev wrote: > > Does it mean that old Linux' trick of /lib/ld-linux.so.2 /bin/chmod +x > > /bin/chmod would now be possible on FreeBSD as well? Does this have > > any security implications? > > Thi

Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Nikolai Lifanov
On 05/15/2017 15:18, Jonathan Anderson wrote: > On 15 May 2017, at 16:44, Jonathan Anderson wrote: > >> You can already execute "non-executable" binaries using the `exec` >> shell built-in: >> >> ``` >> $ cp /bin/sh . >> $ chmod -x sh >> $ exec sh >> ``` > > Er, oops: I ought to have said, you ca

Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Jonathan Anderson
On 15 May 2017, at 16:44, Jonathan Anderson wrote: You can already execute "non-executable" binaries using the `exec` shell built-in: ``` $ cp /bin/sh . $ chmod -x sh $ exec sh ``` Er, oops: I ought to have said, you can execute non-executable binaries by copying and marking them `+x`: ``

Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Jonathan Anderson
On 15 May 2017, at 16:38, Ian Lepore wrote: On Mon, 2017-05-15 at 22:00 +0300, Konstantin Belousov wrote: On Mon, May 15, 2017 at 06:52:36PM +, Alexey Dokuchaev wrote: Does this have any security implications? What do you mean ? Well, for example, it seems like it would allow anyone t

Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Shawn Webb
On Mon, May 15, 2017 at 01:08:55PM -0600, Ian Lepore wrote: > On Mon, 2017-05-15 at 22:00 +0300, Konstantin Belousov wrote: > > On Mon, May 15, 2017 at 06:52:36PM +, Alexey Dokuchaev wrote: > > > > > > On Mon, May 15, 2017 at 06:48:58PM +, Konstantin Belousov > > > wrote: > > > > > > > >

Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Alexey Dokuchaev
On Mon, May 15, 2017 at 01:08:55PM -0600, Ian Lepore wrote: > On Mon, 2017-05-15 at 22:00 +0300, Konstantin Belousov wrote: > > On Mon, May 15, 2017 at 06:52:36PM +, Alexey Dokuchaev wrote: > > > Does this have any security implications? > > > > What do you mean ? > > Well, for example, it se

Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Nikolai Lifanov
On 05/15/2017 14:52, Alexey Dokuchaev wrote: > On Mon, May 15, 2017 at 06:48:58PM +, Konstantin Belousov wrote: >> New Revision: 318313 >> URL: https://svnweb.freebsd.org/changeset/base/318313 >> >> Log: >> Make ld-elf.so.1 directly executable. > > Does it mean that old Linux' trick of /lib/

Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Ian Lepore
On Mon, 2017-05-15 at 22:00 +0300, Konstantin Belousov wrote: > On Mon, May 15, 2017 at 06:52:36PM +, Alexey Dokuchaev wrote: > > > > On Mon, May 15, 2017 at 06:48:58PM +, Konstantin Belousov > > wrote: > > > > > > New Revision: 318313 > > > URL: https://svnweb.freebsd.org/changeset/base/

Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Alexey Dokuchaev
On Mon, May 15, 2017 at 10:00:30PM +0300, Konstantin Belousov wrote: > On Mon, May 15, 2017 at 06:52:36PM +, Alexey Dokuchaev wrote: > > On Mon, May 15, 2017 at 06:48:58PM +, Konstantin Belousov wrote: > > > New Revision: 318313 > > > URL: https://svnweb.freebsd.org/changeset/base/318313 >

Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Konstantin Belousov
On Mon, May 15, 2017 at 06:52:36PM +, Alexey Dokuchaev wrote: > On Mon, May 15, 2017 at 06:48:58PM +, Konstantin Belousov wrote: > > New Revision: 318313 > > URL: https://svnweb.freebsd.org/changeset/base/318313 > > > > Log: > > Make ld-elf.so.1 directly executable. > > Does it mean tha

Re: svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Alexey Dokuchaev
On Mon, May 15, 2017 at 06:48:58PM +, Konstantin Belousov wrote: > New Revision: 318313 > URL: https://svnweb.freebsd.org/changeset/base/318313 > > Log: > Make ld-elf.so.1 directly executable. Does it mean that old Linux' trick of /lib/ld-linux.so.2 /bin/chmod +x /bin/chmod would now be pos

svn commit: r318313 - head/libexec/rtld-elf

2017-05-15 Thread Konstantin Belousov
Author: kib Date: Mon May 15 18:48:58 2017 New Revision: 318313 URL: https://svnweb.freebsd.org/changeset/base/318313 Log: Make ld-elf.so.1 directly executable. Check if passed phdr is actually phdr of the interpreter itself, and decide that this is the case of direct execution. In this