[oi-dev] Opening executable with write flags

Paul Floyd pjfloyd at wanadoo.fr
Mon Jul 14 18:57:21 UTC 2025


On 7/14/25 18:34, Till Wegmüller wrote:
> Hi Paul
>
> Have you tried mdb? We have our own debug data format called CTF and 
> depending on how you compiled your file the DWARF data may be stripped 
> from the binary.
>
> If you want a stacktrace from mdb you can type ::stack
>
> For more detailed usage of mdb check the manpage or ask on #illumos 
> IRC or any illumos mailinglist. There are not many illumos devs here 
> on this list and I have never used gdb. Only ever mdb.
>
Hi

I haven't tried mdb (I'm not a kernel developer).

This just looks like a kernel bug to me (in both Solaris 11.4 and illumos).

The Solaris 11.4 man page says (and I guess illumos is the same):


ETXTBSY        The file is a pure procedure (shared text) file that is
                       being executed and oflagis O_WRONLYor O_RDWR.

The first thing that my testcase does is an open exactly like that with 
O_WRONLY|O_CREAT|O_TRUNC

This succeeds and crashes the exe. Maybe the kernel is only checking for 
O_WRONLY or O_RDWR?

I also wonder if this is not a security issue.

A+

Paul

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openindiana.org/pipermail/oi-dev/attachments/20250714/5e36b2cb/attachment.html>


More information about the oi-dev mailing list