[PATCH] elf: Fix crash in late dlmopen failure when auditing (bug 26076)

Florian Weimer fweimer@redhat.com
Thu Jun 4 16:19:23 GMT 2020

* Carlos O'Donell:

> Please recompute do_audit or refactor to remove do_audit and check
> the appropriate values.

I would like to give up this patch.

The core issue is that

  /* Mark the DSO as being used for auditing.  */
  dlmargs.map->l_auditing = 1;

in elf/rtld.c:load_audit_module is just too late to mark a namespace as
being used for auditing.  This is what the do_audit flag

  bool do_audit = GLRO(dl_naudit) > 0 && !ns->_ns_loaded->l_auditing;

is supposed to check.  The flag should be per-namespace, and set
immediately when the namespace ID is created for the audit module.  This
will make the reporting of audit events to other auditors more
consistent, too.

Szabolcs' namespace rework will conflict with a refactoring here, and
this change does not block the rseq work in anyway.


More information about the Libc-alpha mailing list