public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Siddhesh Poyarekar <siddhesh@sourceware.org>
To: Florian Weimer <fweimer@redhat.com>
Cc: libc-alpha@sourceware.org, schwab@suse.de, carlos@redhat.com
Subject: Re: [PATCH v3] getaddrinfo: Fix use after free in getcanonname (CVE-2023-4806)
Date: Thu, 14 Sep 2023 07:27:12 -0400	[thread overview]
Message-ID: <77a393e5-34e1-09b3-1fa0-e52387664e0a@sourceware.org> (raw)
In-Reply-To: <87il8d2fhq.fsf@oldenburg3.str.redhat.com>

On 2023-09-14 06:53, Florian Weimer wrote:
>> @@ -262,7 +272,6 @@ convert_hostent_to_gaih_addrtuple (const struct addrinfo *req, int family,
>>   	}
>>         array[i].next = array + i + 1;
>>       }
>> -  array[0].name = h->h_name;
>>     array[count - 1].next = NULL;
> 
> I would expect
> 
>    array[0].name = res->h_name;
> 
> here, but that's not needed because the assignment happens in
> generate_addrinfo, from res->canon, which may have been set with
> res->h_name as a fallback?

Right, we basically only use res->at->name in the gethostbyname4_r path 
as a transitory value (it finally gets duplicated into res->canon) 
because unfortunately we've encoded that into the NSS API :/

Thanks,
Sid

  reply	other threads:[~2023-09-14 11:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-13 17:36 [PATCH] " Siddhesh Poyarekar
2023-09-13 19:03 ` Florian Weimer
2023-09-13 20:56 ` [PATCH v2] " Siddhesh Poyarekar
2023-09-14  8:37   ` Andreas Schwab
2023-09-14  9:48     ` Siddhesh Poyarekar
2023-09-14  9:55       ` Andreas Schwab
2023-09-14  9:57         ` Siddhesh Poyarekar
2023-09-14 10:00           ` Andreas Schwab
2023-09-14 10:06             ` Siddhesh Poyarekar
2023-09-14 10:12               ` Andreas Schwab
2023-09-14 10:24                 ` Siddhesh Poyarekar
2023-09-14 10:13 ` [PATCH v3] " Siddhesh Poyarekar
2023-09-14 10:53   ` Florian Weimer
2023-09-14 11:27     ` Siddhesh Poyarekar [this message]
2023-09-14 22:52   ` Carlos O'Donell
2023-09-15 18:41 ` [COMMITTED] " Siddhesh Poyarekar

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=77a393e5-34e1-09b3-1fa0-e52387664e0a@sourceware.org \
    --to=siddhesh@sourceware.org \
    --cc=carlos@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=schwab@suse.de \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).