Hi Kostik,

2017-03-22 10:02 GMT+01:00 Konstantin Belousov <kostik...@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 <e...@nuxi.nl>
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to