From patchwork Thu Mar 20 17:29:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Aaron Merey X-Patchwork-Id: 108636 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 869903858427 for ; Thu, 20 Mar 2025 17:31:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 869903858427 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=OP3Tg8OG X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id D6F843857B9B for ; Thu, 20 Mar 2025 17:29:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D6F843857B9B Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D6F843857B9B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1742491791; cv=none; b=pcwwb3qvvKYjVbv4oFyoa5XS2RRZvLJz4bZIjf52RP6sCxQvW6pB/XSyK0ukJa9xa3iwXqj5NoTqCY/wn2cJDIPkg/OpL4++1tGdMYaCu4zkXxqU8E/Ojg0XAu7D/BQtAaYax23A87kBRPLfKMK7n8rS6lsQV16h6BtlTgpsgoU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1742491791; c=relaxed/simple; bh=7+pPsES/ycfm/xc12lubupRS61Xb2V8FeaMAW94jjF0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Y1JZlxeAjZL0ONmxfu5l11C6rtfhx2MFklWuFSj0Hj/n2NzQhyefqO3bdN1OMCv8zBUDBMCFEQN1yZEorlY0vXwVnI/KVwI5unotZdNYx2ka0l2oRIUkdDImLpjhPMsk6TI/aLk32YB+Xedv6IsE43jLj0o6nlxkx+sWOPETLGU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D6F843857B9B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1742491790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rddgz2T5n7KO+3ojZFKAeg027lsP/MHG1J7BNFMZJP4=; b=OP3Tg8OGDll0s93iPFPC4WU07xt56VO4pJUkZzJaTmnKl61APwQHZtwQ6eBONXUZR5WkLY py7+w8q1yZigzTVBZgKN6VoFvURDv/LnmHcN6olSRIPYV1m/mg7vMeW8JPOBVf87OQYmDg fTffEicm0i9/mPRcbvuYVWyDj2tv7N4= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-167-oosGwoS_PEa3qtygOrWT8A-1; Thu, 20 Mar 2025 13:29:49 -0400 X-MC-Unique: oosGwoS_PEa3qtygOrWT8A-1 X-Mimecast-MFC-AGG-ID: oosGwoS_PEa3qtygOrWT8A_1742491788 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CA37C18454E3 for ; Thu, 20 Mar 2025 17:29:35 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.66.106]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BBC161800370; Thu, 20 Mar 2025 17:29:34 +0000 (UTC) From: Aaron Merey To: libc-alpha@sourceware.org Cc: Aaron Merey , =?utf-8?b?RnLDqWTDqXJpYyBCw6lyYXQ=?= Subject: [PATCH 1/2] Prepare inet_pton to be fortified Date: Thu, 20 Mar 2025 13:29:17 -0400 Message-ID: <20250320172920.993312-1-amerey@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: JKILJYeQ8Ju96uAk8Ryaq9HTdOtXAO2D9ic5TKLHp_4_1742491788 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, PROLO_LEO2, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_W, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org Split inet_pton internals such as __inet_pton_length from the inet_pton entry point. This allows the internals to be built with fortification while leaving the inet_pton entry point unchanged. Co-authored-by: Frédéric Bérat --- This patch series is intended to be applied on top of the inet_ntop _FORTIFY_SOURCE patch series: https://sourceware.org/pipermail/libc-alpha/2025-March/165332.html resolv/Makefile | 6 + resolv/inet_pton.c | 187 -------------------------------- resolv/inet_pton_length.c | 223 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 229 insertions(+), 187 deletions(-) create mode 100644 resolv/inet_pton_length.c diff --git a/resolv/Makefile b/resolv/Makefile index 48b16dc2b2..a49fac7f8a 100644 --- a/resolv/Makefile +++ b/resolv/Makefile @@ -38,6 +38,7 @@ routines := \ inet_addr \ inet_ntop \ inet_pton \ + inet_pton_length \ ns_makecanon \ ns_name_compress \ ns_name_length_uncompressed \ @@ -73,6 +74,11 @@ routines := \ resolv_context \ # routines +# Exclude fortified routines from being built with _FORTIFY_SOURCE +routines_no_fortify += \ + inet_pton \ + # routines_no_fortify + tests = tst-aton tst-leaks tst-inet_ntop tests-container = tst-leaks2 diff --git a/resolv/inet_pton.c b/resolv/inet_pton.c index 88d63c61c7..5307a5b243 100644 --- a/resolv/inet_pton.c +++ b/resolv/inet_pton.c @@ -33,33 +33,7 @@ */ #include -#include -#include -#include -#include #include -#include -#include -#include - -static int inet_pton4 (const char *src, const char *src_end, u_char *dst); -static int inet_pton6 (const char *src, const char *src_end, u_char *dst); - -int -__inet_pton_length (int af, const char *src, size_t srclen, void *dst) -{ - switch (af) - { - case AF_INET: - return inet_pton4 (src, src + srclen, dst); - case AF_INET6: - return inet_pton6 (src, src + srclen, dst); - default: - __set_errno (EAFNOSUPPORT); - return -1; - } -} -libc_hidden_def (__inet_pton_length) /* Like __inet_pton_length, but use strlen (SRC) as the length of SRC. */ @@ -71,164 +45,3 @@ __inet_pton (int af, const char *src, void *dst) libc_hidden_def (__inet_pton) weak_alias (__inet_pton, inet_pton) libc_hidden_weak (inet_pton) - -/* Like inet_aton but without all the hexadecimal, octal and shorthand - (and trailing garbage is not ignored). Return 1 if SRC is a valid - dotted quad, else 0. This function does not touch DST unless it's - returning 1. - Author: Paul Vixie, 1996. */ -static int -inet_pton4 (const char *src, const char *end, unsigned char *dst) -{ - int saw_digit, octets, ch; - unsigned char tmp[NS_INADDRSZ], *tp; - - saw_digit = 0; - octets = 0; - *(tp = tmp) = 0; - while (src < end) - { - ch = *src++; - if (ch >= '0' && ch <= '9') - { - unsigned int new = *tp * 10 + (ch - '0'); - - if (saw_digit && *tp == 0) - return 0; - if (new > 255) - return 0; - *tp = new; - if (! saw_digit) - { - if (++octets > 4) - return 0; - saw_digit = 1; - } - } - else if (ch == '.' && saw_digit) - { - if (octets == 4) - return 0; - *++tp = 0; - saw_digit = 0; - } - else - return 0; - } - if (octets < 4) - return 0; - memcpy (dst, tmp, NS_INADDRSZ); - return 1; -} - -/* Return the value of CH as a hexadecimal digit, or -1 if it is a - different type of character. */ -static int -hex_digit_value (char ch) -{ - if ('0' <= ch && ch <= '9') - return ch - '0'; - if ('a' <= ch && ch <= 'f') - return ch - 'a' + 10; - if ('A' <= ch && ch <= 'F') - return ch - 'A' + 10; - return -1; -} - -/* Convert presentation-level IPv6 address to network order binary - form. Return 1 if SRC is a valid [RFC1884 2.2] address, else 0. - This function does not touch DST unless it's returning 1. - Author: Paul Vixie, 1996. Inspired by Mark Andrews. */ -static int -inet_pton6 (const char *src, const char *src_endp, unsigned char *dst) -{ - unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp; - const char *curtok; - int ch; - size_t xdigits_seen; /* Number of hex digits since colon. */ - unsigned int val; - - tp = memset (tmp, '\0', NS_IN6ADDRSZ); - endp = tp + NS_IN6ADDRSZ; - colonp = NULL; - - /* Leading :: requires some special handling. */ - if (src == src_endp) - return 0; - if (*src == ':') - { - ++src; - if (src == src_endp || *src != ':') - return 0; - } - - curtok = src; - xdigits_seen = 0; - val = 0; - while (src < src_endp) - { - ch = *src++; - int digit = hex_digit_value (ch); - if (digit >= 0) - { - if (xdigits_seen == 4) - return 0; - val <<= 4; - val |= digit; - if (val > 0xffff) - return 0; - ++xdigits_seen; - continue; - } - if (ch == ':') - { - curtok = src; - if (xdigits_seen == 0) - { - if (colonp) - return 0; - colonp = tp; - continue; - } - else if (src == src_endp) - return 0; - if (tp + NS_INT16SZ > endp) - return 0; - *tp++ = (unsigned char) (val >> 8) & 0xff; - *tp++ = (unsigned char) val & 0xff; - xdigits_seen = 0; - val = 0; - continue; - } - if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) - && inet_pton4 (curtok, src_endp, tp) > 0) - { - tp += NS_INADDRSZ; - xdigits_seen = 0; - break; /* '\0' was seen by inet_pton4. */ - } - return 0; - } - if (xdigits_seen > 0) - { - if (tp + NS_INT16SZ > endp) - return 0; - *tp++ = (unsigned char) (val >> 8) & 0xff; - *tp++ = (unsigned char) val & 0xff; - } - if (colonp != NULL) - { - /* Replace :: with zeros. */ - if (tp == endp) - /* :: would expand to a zero-width field. */ - return 0; - size_t n = tp - colonp; - memmove (endp - n, colonp, n); - memset (colonp, 0, endp - n - colonp); - tp = endp; - } - if (tp != endp) - return 0; - memcpy (dst, tmp, NS_IN6ADDRSZ); - return 1; -} diff --git a/resolv/inet_pton_length.c b/resolv/inet_pton_length.c new file mode 100644 index 0000000000..c3614074a4 --- /dev/null +++ b/resolv/inet_pton_length.c @@ -0,0 +1,223 @@ +/* Copyright (C) 1996-2025 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* + * Copyright (c) 1996,1999 by Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS + * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE + * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int inet_pton4 (const char *src, const char *src_end, u_char *dst); +static int inet_pton6 (const char *src, const char *src_end, u_char *dst); + +int +__inet_pton_length (int af, const char *src, size_t srclen, void *dst) +{ + switch (af) + { + case AF_INET: + return inet_pton4 (src, src + srclen, dst); + case AF_INET6: + return inet_pton6 (src, src + srclen, dst); + default: + __set_errno (EAFNOSUPPORT); + return -1; + } +} +libc_hidden_def (__inet_pton_length) + +/* Like inet_aton but without all the hexadecimal, octal and shorthand + (and trailing garbage is not ignored). Return 1 if SRC is a valid + dotted quad, else 0. This function does not touch DST unless it's + returning 1. + Author: Paul Vixie, 1996. */ +static int +inet_pton4 (const char *src, const char *end, unsigned char *dst) +{ + int saw_digit, octets, ch; + unsigned char tmp[NS_INADDRSZ], *tp; + + saw_digit = 0; + octets = 0; + *(tp = tmp) = 0; + while (src < end) + { + ch = *src++; + if (ch >= '0' && ch <= '9') + { + unsigned int new = *tp * 10 + (ch - '0'); + + if (saw_digit && *tp == 0) + return 0; + if (new > 255) + return 0; + *tp = new; + if (! saw_digit) + { + if (++octets > 4) + return 0; + saw_digit = 1; + } + } + else if (ch == '.' && saw_digit) + { + if (octets == 4) + return 0; + *++tp = 0; + saw_digit = 0; + } + else + return 0; + } + if (octets < 4) + return 0; + memcpy (dst, tmp, NS_INADDRSZ); + return 1; +} + +/* Return the value of CH as a hexadecimal digit, or -1 if it is a + different type of character. */ +static int +hex_digit_value (char ch) +{ + if ('0' <= ch && ch <= '9') + return ch - '0'; + if ('a' <= ch && ch <= 'f') + return ch - 'a' + 10; + if ('A' <= ch && ch <= 'F') + return ch - 'A' + 10; + return -1; +} + +/* Convert presentation-level IPv6 address to network order binary + form. Return 1 if SRC is a valid [RFC1884 2.2] address, else 0. + This function does not touch DST unless it's returning 1. + Author: Paul Vixie, 1996. Inspired by Mark Andrews. */ +static int +inet_pton6 (const char *src, const char *src_endp, unsigned char *dst) +{ + unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp; + const char *curtok; + int ch; + size_t xdigits_seen; /* Number of hex digits since colon. */ + unsigned int val; + + tp = memset (tmp, '\0', NS_IN6ADDRSZ); + endp = tp + NS_IN6ADDRSZ; + colonp = NULL; + + /* Leading :: requires some special handling. */ + if (src == src_endp) + return 0; + if (*src == ':') + { + ++src; + if (src == src_endp || *src != ':') + return 0; + } + + curtok = src; + xdigits_seen = 0; + val = 0; + while (src < src_endp) + { + ch = *src++; + int digit = hex_digit_value (ch); + if (digit >= 0) + { + if (xdigits_seen == 4) + return 0; + val <<= 4; + val |= digit; + if (val > 0xffff) + return 0; + ++xdigits_seen; + continue; + } + if (ch == ':') + { + curtok = src; + if (xdigits_seen == 0) + { + if (colonp) + return 0; + colonp = tp; + continue; + } + else if (src == src_endp) + return 0; + if (tp + NS_INT16SZ > endp) + return 0; + *tp++ = (unsigned char) (val >> 8) & 0xff; + *tp++ = (unsigned char) val & 0xff; + xdigits_seen = 0; + val = 0; + continue; + } + if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) + && inet_pton4 (curtok, src_endp, tp) > 0) + { + tp += NS_INADDRSZ; + xdigits_seen = 0; + break; /* '\0' was seen by inet_pton4. */ + } + return 0; + } + if (xdigits_seen > 0) + { + if (tp + NS_INT16SZ > endp) + return 0; + *tp++ = (unsigned char) (val >> 8) & 0xff; + *tp++ = (unsigned char) val & 0xff; + } + if (colonp != NULL) + { + /* Replace :: with zeros. */ + if (tp == endp) + /* :: would expand to a zero-width field. */ + return 0; + size_t n = tp - colonp; + memmove (endp - n, colonp, n); + memset (colonp, 0, endp - n - colonp); + tp = endp; + } + if (tp != endp) + return 0; + memcpy (dst, tmp, NS_IN6ADDRSZ); + return 1; +} From patchwork Thu Mar 20 17:29:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Aaron Merey X-Patchwork-Id: 108637 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1B3D53857B91 for ; Thu, 20 Mar 2025 17:31:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1B3D53857B91 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=IRrMA2LE X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id B7AB63857C6E for ; Thu, 20 Mar 2025 17:29:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B7AB63857C6E Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B7AB63857C6E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1742491794; cv=none; b=ThhSOgZSmddzoPzbNrXA9jTyuMGUDNiubNPvLOXU/Je9qKh+3CxIj4RrWhEbFitpZpKOq3wS1Fbyu4KyrE1s+spEPOKrdLSrxDhg5DVgjE4jzmNluSgvBGy8f3dratmgAlpeYBfRK9NMkZrtdP90QK8y9FfCHrd01tFWJ+3NcOM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1742491794; c=relaxed/simple; bh=F4j8SwRewelHQ6xah2PFMTX84fsD/TQ8NeIn3Sga8zo=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=vgK1CJyY5ehtY5fVJ+CD8Jkw3yNTb2OIj9Xy/FhC5928kv4QO+ENnXLTZyM4hrTskUgwjm6QzncKOLyxUEhSyJJXkiaE642Ctp20nqwgUFrcFvcgRMwc0E5uVzTXS+OAZ5AB8tH3zb7UHUl6Sz7r8MIecWA/ibjTyvC5p+sRe4Y= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B7AB63857C6E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1742491794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ce2fyWz2MhRBq9eyRJgZJc1aNBLd4ks8bz0D1l0CeOo=; b=IRrMA2LEt94quVD3cRI9cCEntAxic9LIetwSYZTHCeFDeGzuNmigvon5ZmZAYPf47KkGRY lDXVaj6YZQuedg63WApBG0iTVETHtVPA4KskDbqhTVK8jOx16sTlFrGMkhG6/N+GPQrNIV bL1M7IGSCbun95yb/GfYBwSxGsk+zfI= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-689-ZIFEj4rUOs66NMhg3m0gcA-1; Thu, 20 Mar 2025 13:29:52 -0400 X-MC-Unique: ZIFEj4rUOs66NMhg3m0gcA-1 X-Mimecast-MFC-AGG-ID: ZIFEj4rUOs66NMhg3m0gcA_1742491790 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0C205185FBB7 for ; Thu, 20 Mar 2025 17:29:39 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.66.106]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 12C4F1800370; Thu, 20 Mar 2025 17:29:37 +0000 (UTC) From: Aaron Merey To: libc-alpha@sourceware.org Cc: Aaron Merey , =?utf-8?b?RnLDqWTDqXJpYyBCw6lyYXQ=?= Subject: [PATCH 2/2] Add _FORTIFY_SOURCE support for inet_ntop Date: Thu, 20 Mar 2025 13:29:18 -0400 Message-ID: <20250320172920.993312-2-amerey@redhat.com> In-Reply-To: <20250320172920.993312-1-amerey@redhat.com> References: <20250320172920.993312-1-amerey@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: QGdLWBSejLGlU5087skapO5Pnf6_NGcRCXtbsvrQA2I_1742491790 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_W, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org Add function __inet_pton_chk which calls __chk_fail when the size of argument dst is too small. inet_pton is redirected to __inet_pton_chk or __inet_pton_warn when _FORTIFY_SOURCE is > 0. Also add tests to debug/tst-fortify.c, update the abilist with __inet_pton_chk and mention inet_pton fortification in maint.texi. Co-authored-by: Frédéric Bérat --- debug/Makefile | 1 + debug/Versions | 1 + debug/inet_pton_chk.c | 30 +++++++++++++++++++ debug/tst-fortify.c | 24 +++++++++++++++ include/arpa/inet.h | 2 ++ inet/bits/inet-fortified-decl.h | 7 +++++ inet/bits/inet-fortified.h | 20 +++++++++++++ manual/maint.texi | 2 ++ sysdeps/mach/hurd/i386/libc.abilist | 1 + sysdeps/mach/hurd/x86_64/libc.abilist | 1 + sysdeps/unix/sysv/linux/aarch64/libc.abilist | 1 + sysdeps/unix/sysv/linux/alpha/libc.abilist | 1 + sysdeps/unix/sysv/linux/arc/libc.abilist | 1 + sysdeps/unix/sysv/linux/arm/be/libc.abilist | 1 + sysdeps/unix/sysv/linux/arm/le/libc.abilist | 1 + sysdeps/unix/sysv/linux/csky/libc.abilist | 1 + sysdeps/unix/sysv/linux/hppa/libc.abilist | 1 + sysdeps/unix/sysv/linux/i386/libc.abilist | 1 + .../sysv/linux/loongarch/lp64/libc.abilist | 1 + .../sysv/linux/m68k/coldfire/libc.abilist | 1 + .../unix/sysv/linux/m68k/m680x0/libc.abilist | 1 + .../sysv/linux/microblaze/be/libc.abilist | 1 + .../sysv/linux/microblaze/le/libc.abilist | 1 + .../sysv/linux/mips/mips32/fpu/libc.abilist | 1 + .../sysv/linux/mips/mips32/nofpu/libc.abilist | 1 + .../sysv/linux/mips/mips64/n32/libc.abilist | 1 + .../sysv/linux/mips/mips64/n64/libc.abilist | 1 + sysdeps/unix/sysv/linux/or1k/libc.abilist | 1 + .../linux/powerpc/powerpc32/fpu/libc.abilist | 1 + .../powerpc/powerpc32/nofpu/libc.abilist | 1 + .../linux/powerpc/powerpc64/be/libc.abilist | 1 + .../linux/powerpc/powerpc64/le/libc.abilist | 1 + .../unix/sysv/linux/riscv/rv32/libc.abilist | 1 + .../unix/sysv/linux/riscv/rv64/libc.abilist | 1 + .../unix/sysv/linux/s390/s390-32/libc.abilist | 1 + .../unix/sysv/linux/s390/s390-64/libc.abilist | 1 + sysdeps/unix/sysv/linux/sh/be/libc.abilist | 1 + sysdeps/unix/sysv/linux/sh/le/libc.abilist | 1 + .../sysv/linux/sparc/sparc32/libc.abilist | 1 + .../sysv/linux/sparc/sparc64/libc.abilist | 1 + .../unix/sysv/linux/x86_64/64/libc.abilist | 1 + .../unix/sysv/linux/x86_64/x32/libc.abilist | 1 + 42 files changed, 121 insertions(+) create mode 100644 debug/inet_pton_chk.c diff --git a/debug/Makefile b/debug/Makefile index 905f2bf7e0..dabeb6c375 100644 --- a/debug/Makefile +++ b/debug/Makefile @@ -56,6 +56,7 @@ routines = \ gets_chk \ getwd_chk \ inet_ntop_chk \ + inet_pton_chk \ longjmp_chk \ mbsnrtowcs_chk \ mbsrtowcs_chk \ diff --git a/debug/Versions b/debug/Versions index 2ae5747f8d..6b9ec1eb46 100644 --- a/debug/Versions +++ b/debug/Versions @@ -66,6 +66,7 @@ libc { } GLIBC_2.42 { __inet_ntop_chk; + __inet_pton_chk; } GLIBC_PRIVATE { __fortify_fail; diff --git a/debug/inet_pton_chk.c b/debug/inet_pton_chk.c new file mode 100644 index 0000000000..965cf5e116 --- /dev/null +++ b/debug/inet_pton_chk.c @@ -0,0 +1,30 @@ +/* Copyright (C) 2025 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + +int +__inet_pton_chk (int af, const char *src, void *dst, size_t dst_size) +{ + if ((af == AF_INET && dst_size < 4) + || (af == AF_INET6 && dst_size < 16)) + __chk_fail (); + + return __inet_pton (af, src, dst); +} +libc_hidden_def (__inet_pton_chk) diff --git a/debug/tst-fortify.c b/debug/tst-fortify.c index cd649369d9..c4c28e6e13 100644 --- a/debug/tst-fortify.c +++ b/debug/tst-fortify.c @@ -1853,6 +1853,30 @@ do_test (void) CHK_FAIL_END #endif + const char *ipv4str = "127.0.0.1"; + const char *ipv6str = "::1"; + + if (inet_pton (AF_INET, ipv4str, (void *) &addr) != 1) + FAIL (); + if (inet_pton (AF_INET6, ipv6str, (void *) &addr6) != 1) + FAIL (); + +#if __USE_FORTIFY_LEVEL >= 1 + char smallbuf[2]; + + CHK_FAIL_START + inet_pton (AF_INET, ipv4str, (void *) smallbuf); + CHK_FAIL_END + + CHK_FAIL_START + inet_pton (AF_INET6, ipv6str, (void *) smallbuf); + CHK_FAIL_END + + CHK_FAIL_START + inet_pton (AF_INET6, ipv6str, (void *) &addr); + CHK_FAIL_END +#endif + return ret; } diff --git a/include/arpa/inet.h b/include/arpa/inet.h index a02892f48a..3db8f1a96f 100644 --- a/include/arpa/inet.h +++ b/include/arpa/inet.h @@ -19,6 +19,8 @@ libc_hidden_proto (__inet_ntop_chk) libc_hidden_proto (inet_pton) extern __typeof (inet_pton) __inet_pton; libc_hidden_proto (__inet_pton) +libc_hidden_proto (__inet_pton_chk) + extern __typeof (inet_makeaddr) __inet_makeaddr; libc_hidden_proto (__inet_makeaddr) libc_hidden_proto (inet_netof) diff --git a/inet/bits/inet-fortified-decl.h b/inet/bits/inet-fortified-decl.h index 23e3cf4b22..748a119f14 100644 --- a/inet/bits/inet-fortified-decl.h +++ b/inet/bits/inet-fortified-decl.h @@ -32,4 +32,11 @@ extern const char *__REDIRECT_NTH (__inet_ntop_chk_warn, __warnattr ("inet_ntop called with bigger length than " "size of destination buffer"); +extern int __inet_pton_chk (int, const char *, void *, size_t); + +extern int __REDIRECT_FORTIFY_NTH (__inet_pton_alias, + (int, const char *, void *), inet_pton); +extern int __REDIRECT_NTH (__inet_pton_chk_warn, + (int, const char *, void *, size_t), __inet_pton_chk) + __warnattr ("inet_pton called with a destination buffer size too small"); #endif /* bits/inet-fortified-decl.h. */ diff --git a/inet/bits/inet-fortified.h b/inet/bits/inet-fortified.h index 4f6bc34b0f..2f0e99d6a2 100644 --- a/inet/bits/inet-fortified.h +++ b/inet/bits/inet-fortified.h @@ -38,4 +38,24 @@ __NTH (inet_ntop (int __af, __af, __src, __dst, __dst_size); }; +__fortify_function __attribute_overloadable__ int +__NTH (inet_pton (int __af, + const char *__restrict __src, + __fortify_clang_overload_arg (void *, __restrict, __dst))) + __fortify_clang_warning_only_if_bos0_lt + (4, __dst, "inet_pton called with destination buffer size less than 4") +{ + size_t scale = 0; + if (__af == AF_INET) + scale = 1; + else if (__af == AF_INET6) + scale = 4; + else + return __inet_pton_alias (__af, __src, __dst); + + return __glibc_fortify (inet_pton, 4, scale, + __glibc_objsize (__dst), + __af, __src, __dst); +}; + #endif /* bits/inet-fortified.h. */ diff --git a/manual/maint.texi b/manual/maint.texi index ce6a556c68..b6ee5b6e3b 100644 --- a/manual/maint.texi +++ b/manual/maint.texi @@ -305,6 +305,8 @@ The following functions and macros are fortified in @theglibc{}: @item @code{inet_ntop} +@item @code{inet_pton} + @item @code{longjmp} @item @code{mbsnrtowcs} diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index facb01bf8c..0b963dc890 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -2585,6 +2585,7 @@ GLIBC_2.41 pthread_mutexattr_setrobust_np F GLIBC_2.41 pthread_mutexattr_settype F GLIBC_2.41 pthread_sigmask F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_barrier_destroy F GLIBC_2.42 pthread_barrier_init F GLIBC_2.42 pthread_barrier_wait F diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist index 3c76f6ae52..b9e9349b9d 100644 --- a/sysdeps/mach/hurd/x86_64/libc.abilist +++ b/sysdeps/mach/hurd/x86_64/libc.abilist @@ -2268,6 +2268,7 @@ GLIBC_2.41 pthread_mutexattr_setrobust_np F GLIBC_2.41 pthread_mutexattr_settype F GLIBC_2.41 pthread_sigmask F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_barrier_destroy F GLIBC_2.42 pthread_barrier_init F GLIBC_2.42 pthread_barrier_wait F diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index afbb38fb0e..41f8f39911 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -2751,4 +2751,5 @@ GLIBC_2.39 stdc_trailing_zeros_us F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist index ea11409903..34efc96781 100644 --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist @@ -3098,6 +3098,7 @@ GLIBC_2.4 wscanf F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist index c6edd66fe4..de7c618d28 100644 --- a/sysdeps/unix/sysv/linux/arc/libc.abilist +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist @@ -2512,4 +2512,5 @@ GLIBC_2.39 stdc_trailing_zeros_us F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index 00e46c2f7f..96f0314b16 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -2804,6 +2804,7 @@ GLIBC_2.4 xprt_unregister F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index 3a87471bfe..635468fa13 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -2801,6 +2801,7 @@ GLIBC_2.4 xprt_unregister F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist index b819f40f50..490694ddce 100644 --- a/sysdeps/unix/sysv/linux/csky/libc.abilist +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2788,4 +2788,5 @@ GLIBC_2.39 stdc_trailing_zeros_us F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index 5cb0987348..b1905da767 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2825,6 +2825,7 @@ GLIBC_2.41 cacheflush F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index 1ec48127e1..424ef34a8b 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -3008,6 +3008,7 @@ GLIBC_2.4 unshare F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F diff --git a/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist b/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist index 82b6b0d196..420471eb24 100644 --- a/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist +++ b/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist @@ -2272,4 +2272,5 @@ GLIBC_2.39 stdc_trailing_zeros_us F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index 03818c428f..95a68c7cc1 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -2784,6 +2784,7 @@ GLIBC_2.4 xprt_unregister F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index a2b3d25f48..442e82b6d2 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2951,6 +2951,7 @@ GLIBC_2.4 unshare F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index bc00403c50..20f7712988 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2837,4 +2837,5 @@ GLIBC_2.39 stdc_trailing_zeros_us F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index 5606a7027b..f61ed3bf26 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2834,4 +2834,5 @@ GLIBC_2.39 stdc_trailing_zeros_us F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index 5fab619fd6..381120cc16 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2912,6 +2912,7 @@ GLIBC_2.4 unshare F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index 5ba810d096..2f51146084 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -2910,6 +2910,7 @@ GLIBC_2.4 unshare F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index e1b8f13414..e6071be2ae 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -2918,6 +2918,7 @@ GLIBC_2.4 unshare F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist index c0ee223f3f..f41e209a2b 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist @@ -2820,6 +2820,7 @@ GLIBC_2.4 unshare F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F diff --git a/sysdeps/unix/sysv/linux/or1k/libc.abilist b/sysdeps/unix/sysv/linux/or1k/libc.abilist index 227746ae57..bbcdb31f09 100644 --- a/sysdeps/unix/sysv/linux/or1k/libc.abilist +++ b/sysdeps/unix/sysv/linux/or1k/libc.abilist @@ -2262,4 +2262,5 @@ GLIBC_2.40 swapcontext F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index 46fd69dc86..e0ea22b9c6 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -3141,6 +3141,7 @@ GLIBC_2.4 wscanf F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index 9887e117d8..16b9a771f1 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -3186,6 +3186,7 @@ GLIBC_2.4 wscanf F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist index 2600dc2941..070f6f5a08 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist @@ -2895,6 +2895,7 @@ GLIBC_2.4 wscanf F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist index d803fecff8..4378d1d922 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist @@ -2971,4 +2971,5 @@ GLIBC_2.39 stdc_trailing_zeros_us F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist index a2646bde63..48c6e269a5 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist @@ -2515,4 +2515,5 @@ GLIBC_2.40 __riscv_hwprobe F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist index ad18f29f40..a8b0c6aca7 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist @@ -2715,4 +2715,5 @@ GLIBC_2.40 __riscv_hwprobe F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index 2f76c27fb9..6c00b8440b 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -3139,6 +3139,7 @@ GLIBC_2.4 wscanf F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist index 4ea336999c..f866e5d6f3 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist @@ -2932,6 +2932,7 @@ GLIBC_2.4 wscanf F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index f245f8f755..4f2db8cb9b 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -2831,6 +2831,7 @@ GLIBC_2.4 unshare F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index 4c654a51a3..a73473ee32 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -2828,6 +2828,7 @@ GLIBC_2.4 unshare F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index d89a81edcd..dc7e27db2a 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -3160,6 +3160,7 @@ GLIBC_2.4 wscanf F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist index ee7b84249c..2ee97f42fb 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist @@ -2796,6 +2796,7 @@ GLIBC_2.4 unshare F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist index 00155d9f3e..a7ada1ea53 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist @@ -2747,6 +2747,7 @@ GLIBC_2.4 unshare F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist index 18765ec3b8..f41ab77c1e 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist @@ -2766,4 +2766,5 @@ GLIBC_2.39 stdc_trailing_zeros_us F GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F +GLIBC_2.42 __inet_pton_chk F GLIBC_2.42 pthread_gettid_np F