Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Mar 2017 15:16:24 +0100
From:      Ed Schouten <ed@nuxi.nl>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        Ed Schouten <ed@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r315701 - in head/sys: amd64/cloudabi32 amd64/cloudabi64 arm/cloudabi32 arm64/cloudabi64 i386/cloudabi32
Message-ID:  <CABh_MKmEMidUHFXw1fpwb8TP7qEktnFPgXH4UUvmu2bmhdgiqA@mail.gmail.com>
In-Reply-To: <20170322090258.GR43712@kib.kiev.ua>
References:  <201703220705.v2M75RHE066483@repo.freebsd.org> <20170322090258.GR43712@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Kostik,

2017-03-22 10:02 GMT+01:00 Konstantin Belousov <kostikbel@gmail.com>:
> On Wed, Mar 22, 2017 at 07:05:27AM +0000, Ed Schouten wrote:
>> Author: ed
>> Date: Wed Mar 22 07:05:27 2017
>> New Revision: 315701
>> URL: https://svnweb.freebsd.org/changeset/base/315701
>>
>> Log:
>>   Set the interpreter path to /nonexistent.
>>
>>   CloudABI executables are statically linked and don't have an
>>   interpreter. Setting the interpreter path to NULL used to work
>>   previously, but r314851 introduced code that checks the string
>>   unconditionally. Running CloudABI executables now causes a null pointer
>>   dereference.
> You could have just reported that the revision breaks cloudabi.

Even though that revision made things crash for me, prior versions of
imgact_elf.c also dereferenced interp_path in several places, which I
interpreted as CloudABI not being a good citizen.

>>   Looking at the rest of imgact_elf.c, it seems various other codepaths
>>   already leaned on the fact that the interpreter path is set. Let's just
>>   go ahead and pick an obviously incorrect interpreter path to appease
>>   imgact_elf.c.
>
> I believe that we should move in the reverse direction, in particular,
> best would be to allow brand to specify that only a statically linked
> binaries can be handled by it.  My reasoning is coming from a desire
> to make brand matching as exact as possible, after dealing with the
> bugs due to too vague matching.

I agree. Sounds perfect!

Similarly, I seem to remember CloudABI's brandinfos set compat_3_brand
for a similar reason: it seems to be required by imgact_elf.c. Would
we also want to change that?

> Could you test the following ?  It supposedly fixes the NULL issue, and
> adds the flag marking brands as only allowing static (really PT_INTERP-less)
> binaries.

I've just given it a try. It works perfectly for me. Thanks!

-- 
Ed Schouten <ed@nuxi.nl>
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CABh_MKmEMidUHFXw1fpwb8TP7qEktnFPgXH4UUvmu2bmhdgiqA>