From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id 804D93858C35 for ; Mon, 12 Feb 2024 17:14:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 804D93858C35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 804D93858C35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::434 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707758087; cv=none; b=YNWjX1YrR6E81410mjWQ7Pm1aIhC/AqIZkiXyh03AyRaTkOcUXE+8IfxM2cCzY1Pd7tQMvLiRTXA+PJBbKIdARpqbBNTDT2yyFwfZ6T1/Bd6MnstWzajrZ+keOOzJt9NqNZM35LU8u/eY99JkygYykMOVrblqD1LzIGg6JiruNM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707758087; c=relaxed/simple; bh=KI/8QjgPkP8YQ0Kv9EuKQ6OJg8xNTtnDasKJCG5o/xc=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=LSQDC86ksfUYjR1wh1F3lmpB3zXQO6n1ELVhZPqDPa6L/2XyLLqPpM6QzBrXB79GtT91TBcB3U6Ke8qnbzWZ1w8MjLJCh+Fr8t+6KVR5cdcYv6gYmHE0xCiXxulsB7AEi2cDnvinHTkT6XAsHvwghad3n4QtvhlccJ8pxO0gm9M= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-6e04eceebb5so2398841b3a.1 for ; Mon, 12 Feb 2024 09:14:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707758083; x=1708362883; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ZSYEzY/4U13v+Wx10cEvG/fyCJScJ4wP09PoOcFkF/Y=; b=WpwxDpD7F979Ri/qsBitF17eZrnPgouAhSdmgDmbeh1gb1icnlcyMoIizljZLfjzbU UvMR0DT1LEs3ReZTMs5qg5F3AxseH7ySiP6zuBLxP96/q2UPEtHOPv++pa8dFUqINiAR qv0YgLCnm7ykWizZw6HxYsQfjkwTRCouoqkZOferJ7+QwFbDEWe43YONINe7sOXjtAdP GM+DJ48FcqJXSQi2zCC2rfU6FHzFeftsl3+RsQ0cFytjzhzlA8MjFlnnkssIl/3iX7Mv BmrRNc8DSIIpfhmyFobVV4onS8r/0aD0bnlfMMz3s2aWOJ+BQQ09LpjzFuew5QAB+JIR VPFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707758083; x=1708362883; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZSYEzY/4U13v+Wx10cEvG/fyCJScJ4wP09PoOcFkF/Y=; b=RmdqoFbMkkr+eE/oSn7j4tyG8PqvbJzBU94r0mK8c2VRzMj06rMwSOZSN4b249ZCGL OPa/4lxBKKFRNff66XwkKN474KZ2AJFnswlCJexNIQxxWbYwxn0UqkjhssEVmuFTRbyQ l/F6gAe5a1Q2kd+5OJbFNCEX6fdADl93DdSUbSt/942wQnd5mVbCIfBW2b8UFKbb7Ojo 9JXBJfKxvKtazJmKzSXW19ZFQpCuBAIjJIU0B21mETuzeMkGr3HOqBHcgw6vl1BQZNj5 +XV4bKclnvAEOrLfpTDpjUEG4d2/tw7MVYmuPzCASavDmrRsekKG8LJbC7UALurf1twe 8c2A== X-Gm-Message-State: AOJu0Yy3tbxo01sejXgxom9HDmnDWj+BPdcSkrSfntH3MpJDnpz0adcl PYq0z4TptnWIicu+0I1/0mZnNssymPTmDk2qVxG8uulh3ro1xXJtIWdwd1bKkwa5RSUYsL1rx7f t X-Google-Smtp-Source: AGHT+IGFAkQ5cXsk3LdXIgla4zbE1QJBqZXfnYzsimVLZa+V6B+fOYM+qEhr1WotQ96Rj5yAvbfhiw== X-Received: by 2002:a05:6a20:ce4c:b0:19c:8d73:721b with SMTP id id12-20020a056a20ce4c00b0019c8d73721bmr12147564pzb.57.1707758083562; Mon, 12 Feb 2024 09:14:43 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVPlZvLPwh1QGL3dfoFOWp/cT/It3zwI5siBt7drI8xbUh/bTeC8STKD8Gj+MOXnoDmGWMWOw7kETgV7/99diaWo0asyI9vuDBl Received: from ?IPV6:2804:1b3:a7c0:378:a95e:7d43:370e:1d4c? ([2804:1b3:a7c0:378:a95e:7d43:370e:1d4c]) by smtp.gmail.com with ESMTPSA id k7-20020aa79d07000000b006e03b413056sm5803464pfp.188.2024.02.12.09.14.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Feb 2024 09:14:43 -0800 (PST) Message-ID: <8623972a-5966-4953-b537-72bcde371a68@linaro.org> Date: Mon, 12 Feb 2024 14:14:42 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 01/11] misc: Build getdomainname with fortification Content-Language: en-US To: Florian Weimer , libc-alpha@sourceware.org References: <7710004342d09a8e62868a0bc659b5dca5b67324.1707491940.git.fweimer@redhat.com> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <7710004342d09a8e62868a0bc659b5dca5b67324.1707491940.git.fweimer@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 09/02/24 12:24, Florian Weimer wrote: > Introduce __glibc_nofortify_getdomainname to request disabling > the fortification wrapper. I am not very found of __glibc_nofortify_getdomainname escaping to an installed header, but I don't have a better solution. LGTM, thanks. Reviewed-by: Adhemerval Zanella > --- > misc/Makefile | 1 - > misc/getdomain.c | 2 ++ > posix/bits/unistd.h | 3 ++- > sysdeps/mach/hurd/getdomain.c | 2 ++ > 4 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/misc/Makefile b/misc/Makefile > index c273ec6974..44ae89670a 100644 > --- a/misc/Makefile > +++ b/misc/Makefile > @@ -209,7 +209,6 @@ routines := \ > > # Exclude fortified routines from being built with _FORTIFY_SOURCE > routines_no_fortify += \ > - getdomain \ > gethostname \ > syslog \ > # routines_no_fortify > diff --git a/misc/getdomain.c b/misc/getdomain.c > index f6325644c9..f96636821f 100644 > --- a/misc/getdomain.c > +++ b/misc/getdomain.c > @@ -19,6 +19,8 @@ > The result is null-terminated if LEN is large enough for the full > name and the terminator. */ > > +#define __glibc_nofortify_getdomainname > + > #include > #include > #include > diff --git a/posix/bits/unistd.h b/posix/bits/unistd.h > index bd209ec28e..6ed2943bf1 100644 > --- a/posix/bits/unistd.h > +++ b/posix/bits/unistd.h > @@ -149,7 +149,8 @@ __NTH (gethostname (char *__buf, size_t __buflen)) > #endif > > > -#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_UNIX98) > +#if (defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_UNIX98)) \ > + && !defined __glibc_nofortify_getdomainname > __fortify_function int > __NTH (getdomainname (char *__buf, size_t __buflen)) > { > diff --git a/sysdeps/mach/hurd/getdomain.c b/sysdeps/mach/hurd/getdomain.c > index 137ce9ad5b..e24ab2137e 100644 > --- a/sysdeps/mach/hurd/getdomain.c > +++ b/sysdeps/mach/hurd/getdomain.c > @@ -15,6 +15,8 @@ > License along with the GNU C Library; if not, see > . */ > > +#define __glibc_nofortify_getdomainname > + > #include > #include "hurdhost.h" >