public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/vineet/arc-port-latest] elf: Do not signal LA_ACT_CONSISTENT for an empty namespace [BZ #26076]
@ 2020-07-09 16:34 Vineet Gupta
  0 siblings, 0 replies; only message in thread
From: Vineet Gupta @ 2020-07-09 16:34 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3ad5dab476205d6e16156cf0511fa6884b3b0fc4

commit 3ad5dab476205d6e16156cf0511fa6884b3b0fc4
Author: Florian Weimer <fweimer@redhat.com>
Date:   Tue Jul 7 09:58:45 2020 +0200

    elf: Do not signal LA_ACT_CONSISTENT for an empty namespace [BZ #26076]
    
    The auditing interface identifies namespaces by their first loaded
    module.  Once the namespace is empty, it is no longer possible to signal
    LA_ACT_CONSISTENT for it because the first loaded module is already gone
    at that point.
    
    Reviewed-by: Carlos O'Donell <carlos@redhat.com>

Diff:
---
 elf/dl-close.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/elf/dl-close.c b/elf/dl-close.c
index 73b2817bbf..8e146ecee1 100644
--- a/elf/dl-close.c
+++ b/elf/dl-close.c
@@ -781,8 +781,14 @@ _dl_close_worker (struct link_map *map, bool force)
   if (__glibc_unlikely (do_audit))
     {
       struct link_map *head = ns->_ns_loaded;
-      /* Do not call the functions for any auditing object.  */
-      if (head->l_auditing == 0)
+      /* If head is NULL, the namespace has become empty, and the
+	 audit interface does not give us a way to signal
+	 LA_ACT_CONSISTENT for it because the first loaded module is
+	 used to identify the namespace.
+
+	 Furthermore, do not notify auditors of the cleanup of a
+	 failed audit module loading attempt.  */
+      if (head != NULL && head->l_auditing == 0)
 	{
 	  struct audit_ifaces *afct = GLRO(dl_audit);
 	  for (unsigned int cnt = 0; cnt < GLRO(dl_naudit); ++cnt)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-07-09 16:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-09 16:34 [glibc/vineet/arc-port-latest] elf: Do not signal LA_ACT_CONSISTENT for an empty namespace [BZ #26076] Vineet Gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).