From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) by sourceware.org (Postfix) with ESMTPS id 9330E3854579 for ; Thu, 17 Nov 2022 18:32:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9330E3854579 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ot1-x32e.google.com with SMTP id l42-20020a9d1b2d000000b0066c6366fbc3so1600658otl.3 for ; Thu, 17 Nov 2022 10:32:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=5GEerDNA/LlVd+oYj5ebTldAGcUFydSe6ksvCfJtjgc=; b=rfGaNVGE0o+nLatbaYUFvM6oJEeAr4oSpJJFstcSMGoBzmwXPRmMAx9Y55J3rGOd3e YyU2x+kQiRtc96kWNRNP7za0e6oGT0sKMzMhi0zko6xWbxqCYMT1jkNaWxnLP8F9xJHs TUQbuHIIXXTjRpPkoKsjj9PUD6QnN0FaAzwpnPf0GKw9O+6fc50Wp7i/s2ziKbcSRUtC wVu64eMaMaKbMSVZimJwM/4B1gSG1NWGc5Gotze3iMV7fu/9bp7Q7DhNb+Gy9axMK4E0 6f/C73BKg4gdF5SGVY/8sZeHr/uuLZLRxnVFjmtPAoKliSTpalCsfDIPfBCPZb8wb+bh oi3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc: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=5GEerDNA/LlVd+oYj5ebTldAGcUFydSe6ksvCfJtjgc=; b=7JeyG01/7ZH+0nfcj/tsj9dECfVTnh8GCHV4Aqcc9LqEifTGdUJ01C+QXQ3nJNSzhH /O0s+e7Jn3VEBGhKpveuYMTztzXtWldhsk4HYYMupXmgiadHWSGObea1pJZCCKcsBAWq rH6sWtbRAiD1x/A8yfgEcaWKMgP1f6jJcHuZhqo2owJHG/R9S0iIAFr73+y0baCSdYmN r1mCUYrzlig/N//bPxyhLLTBJswp0PlE7V9lB13rChFjJOm6WVPMLT8OWHKEscGE+lzR 8kZKUs5IaZ51DwrGneQ3Zqx3crjMY+qp6wbz0O3OXqkUMEcJ+xao0iW4LUGXNAAvrkGJ Zvqw== X-Gm-Message-State: ANoB5pmuC+C5ze/zZuUuOkdpCFLzHg9ORQ5U3qK5IiyrbfBnegEksuCR xvxZaGg4SQKMPYIpeN4s/s0QyHO7XWbDRIPJ X-Google-Smtp-Source: AA0mqf63efPem2cxwDsVSypON3NDRxKtb6GcaNC6DwBsyA+XhscAaGoQwydfpQ2lGGYPqPMr0/z/jg== X-Received: by 2002:a9d:34b:0:b0:66d:c3a2:c6e1 with SMTP id 69-20020a9d034b000000b0066dc3a2c6e1mr1833534otv.23.1668709925814; Thu, 17 Nov 2022 10:32:05 -0800 (PST) Received: from ?IPV6:2804:1b3:a7c1:84f3:2833:5b94:1e27:c35b? ([2804:1b3:a7c1:84f3:2833:5b94:1e27:c35b]) by smtp.gmail.com with ESMTPSA id n2-20020a4abd02000000b004982f2d3c03sm583201oop.25.2022.11.17.10.32.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Nov 2022 10:32:05 -0800 (PST) Message-ID: Date: Thu, 17 Nov 2022 15:32:03 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH] Apply asm redirections in syslog.h before first use [BZ #27087] Content-Language: en-US To: Tulio Magno Quites Machado Filho , libc-alpha@sourceware.org Cc: carlos@redhat.com References: <20221116150803.1990947-1-tuliom@ascii.art.br> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <20221116150803.1990947-1-tuliom@ascii.art.br> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 List-Id: On 16/11/22 12:08, Tulio Magno Quites Machado Filho via Libc-alpha wrote: > From: Tulio Magno Quites Machado Filho > > Similar to d0fa09a770, but for syslog.h when _FORTIFY_SOURCE > 0. > Fixes [BZ #27087] by applying long double-related asm redirections > before using functions in bits/syslog.h. > > Tested with build-many-glibcs.py. LGTM, thanks. Reviewed-by: Adhemerval Zanella > --- > misc/bits/syslog.h | 18 ++++++++++++++---- > misc/sys/syslog.h | 10 +++++----- > 2 files changed, 19 insertions(+), 9 deletions(-) > > diff --git a/misc/bits/syslog.h b/misc/bits/syslog.h > index fd30dd3114..916d2b6f12 100644 > --- a/misc/bits/syslog.h > +++ b/misc/bits/syslog.h > @@ -24,6 +24,20 @@ > extern void __syslog_chk (int __pri, int __flag, const char *__fmt, ...) > __attribute__ ((__format__ (__printf__, 3, 4))); > > +#ifdef __USE_MISC > +extern void __vsyslog_chk (int __pri, int __flag, const char *__fmt, > + __gnuc_va_list __ap) > + __attribute__ ((__format__ (__printf__, 3, 0))); > +#endif > + > +#include > +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 > +# include > +#endif > + > +/* The following functions must be used only after applying all asm > + redirections, e.g. long double asm redirections. */ > + > #ifdef __va_arg_pack > __fortify_function void > syslog (int __pri, const char *__fmt, ...) > @@ -37,10 +51,6 @@ syslog (int __pri, const char *__fmt, ...) > > > #ifdef __USE_MISC > -extern void __vsyslog_chk (int __pri, int __flag, const char *__fmt, > - __gnuc_va_list __ap) > - __attribute__ ((__format__ (__printf__, 3, 0))); > - > __fortify_function void > vsyslog (int __pri, const char *__fmt, __gnuc_va_list __ap) > { > diff --git a/misc/sys/syslog.h b/misc/sys/syslog.h > index d933fea104..3888153ed2 100644 > --- a/misc/sys/syslog.h > +++ b/misc/sys/syslog.h > @@ -205,11 +205,11 @@ extern void vsyslog (int __pri, const char *__fmt, __gnuc_va_list __ap) > /* Define some macros helping to catch buffer overflows. */ > #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function > # include > -#endif > - > -#include > -#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 > -# include > +#else > +# include > +# if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 > +# include > +# endif > #endif > > __END_DECLS