public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug network/31026] New: Reachable assertion in resolv_conf.c:570: update_from_conf: Assertion `resolv_conf_matches (resp, conf)' failed.
@ 2023-11-02 10:56 joshua at joshua dot hu
  0 siblings, 0 replies; only message in thread
From: joshua at joshua dot hu @ 2023-11-02 10:56 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=31026

            Bug ID: 31026
           Summary: Reachable assertion in resolv_conf.c:570:
                    update_from_conf: Assertion `resolv_conf_matches
                    (resp, conf)' failed.
           Product: glibc
           Version: 2.40
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: network
          Assignee: unassigned at sourceware dot org
          Reporter: joshua at joshua dot hu
  Target Milestone: ---
             Flags: security?

Hi there,

There is a reachable assert in resolv/resolv_conf.c:update_from_conf:

  /* The overlapping parts of both configurations should agree after
     initialization.  */
  assert (resolv_conf_matches (resp, conf));

resolv_conf_matches returns negative in the case of:

            /* resp->dnsrch is truncated if the number of elements
               exceeds MAXDNSRCH, or if the combined storage space for
               the search list exceeds what can be stored in
               resp->defdname.  */
            if (i == MAXDNSRCH || search_list_size > sizeof (resp->dnsrch))
              break;
            /* Otherwise, a mismatch indicates a match failure.  */
            return false;
          }
Specifically, if the combined storage space for the search line is in excess,
it is already truncated update_from_conf:
    for (i = 0; i < size && i < MAXDNSRCH; ++i)
      {
        resp->dnsrch[i] = alloc_buffer_copy_string
          (&buffer, conf->search_list[i]);
        if (resp->dnsrch[i] == NULL)
          /* No more space in resp->defdname.  Truncate.  */
          break;
      }
    resp->dnsrch[i] = NULL;
  }




An example:

echo "search example.org example.com example.net
corp.corp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.examcorp.exam"
>> /etc/resolv.conf
# ping example.com
ping: resolv_conf.c:570: update_from_conf: Assertion `resolv_conf_matches
(resp, conf)' failed.
Aborted


Cheers,
Josh

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

only message in thread, other threads:[~2023-11-02 10:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-02 10:56 [Bug network/31026] New: Reachable assertion in resolv_conf.c:570: update_from_conf: Assertion `resolv_conf_matches (resp, conf)' failed joshua at joshua dot hu

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).