Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: Re: [PATCH] [gdb] Detect corrupt link map with zero l_ld and l_addr
Date: Sun, 27 Sep 2026 08:36:47 +0200	[thread overview]
Message-ID: <cdd25ecf-a2aa-480c-a832-4568562ecfae@suse.de> (raw)
In-Reply-To: <20260911150536.2712756-1-tdevries@suse.de>

On 9/11/26 5:05 PM, Tom de Vries wrote:
> +      if (li->l_addr_inferior == 0 && li->l_ld == 0
> +	  && target_read_memory (0, &dummy, 1) != 0)
> +	{
> +	  /* We have l_addr_inferior == 0 and l_ld == 0 (corresponding to link
> +	     map entries l_addr and l_ld).  This can happen with a glibc that:
> +	     - has commit a93d9e03a3 ("Extend struct r_debug to support
> +	       multiple namespaces [BZ #15971]"), but
> +	     - misses commit 88361b408b ("elf: Copy l_addr/l_ld when adding
> +	       ld.so to a new namespace").
> +	     This seems to be the case at least for the alma linux 9.8 BaseOS
> +	     version, which uses glibc v2.34 and backports only the first
> +	     commit (https://bugs.almalinux.org/view.php?id=667 ).
> +	     Detect this here and bail out.  Otherwise, we'll present
> +	     the user with incorrect info for "info shared".
> +
> +	     The target_read_memory is there to detect the improbable
> +	     situation that address 0 is both mapped, and the address of the
> +	     dynamic section.  */
> +	  warning (_("Corrupted shared library entry: zero l_addr and l_ld"));
> +	  return 0;
> +	}

I realized the last part of the comment is not formulated as precise as 
I want.

I've updated it to:
...
The target_read_memory is there to detect the improbable
situation that address 0 is mapped, in which case it might be the
address of the dynamic section.  */
...
and submitted a v2 ( 
https://sourceware.org/pipermail/gdb-patches/2026-September/230665.html 
), with two nits fixed as well.

Thanks,
- Tom

      reply	other threads:[~2026-09-27  6:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-11 15:05 Tom de Vries
2026-09-27  6:36 ` Tom de Vries [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cdd25ecf-a2aa-480c-a832-4568562ecfae@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox