From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by sourceware.org (Postfix) with ESMTPS id 78B623858D38 for ; Mon, 12 Feb 2024 17:34:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 78B623858D38 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 78B623858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::636 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707759248; cv=none; b=vbxEvVXu3lRyJna2EYOU1TjqoJJ1JCP1887DuNvMLNpIE7qGCixX1QTZr9vfLxnJ7APGsVNPKl8bSTsLn4vRjf4BoRXlTBfZOOkyN6mKTMKgzUfkY9xnsGn+ZjH2erkJmuLUteraQQpVbM/CAMzCTji5u9Z7ebfHSJPqRR1Zfsc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707759248; c=relaxed/simple; bh=gNPjBFkmRCk2XhB8M7LcwSFQBGH6/bPoj9DJ2PB8WH4=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=DvAkLgfULxD/GM3ZbcedJmbLahQPCjDR/TkLCUN6FLy0P/MFrDmXDSlILcoRMpOlU6D6XMw73/3jq+ZsO4iO6efdBATx6Ds9A2WWU0SOoiAUq6hBz6FpCaSm4cwgOAq6yNili0V7++QG/KQ7rObJ2FtUx8+XYpIUmX8T+sh1ypk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1d94323d547so29967365ad.3 for ; Mon, 12 Feb 2024 09:34:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707759245; x=1708364045; 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=CXMH4IJc0X5BO+B6rMU/CzufsF2HsIDy9PvrI1dJ7GA=; b=q1wZuw2HJCnPYLKMKgmoxydQ1aatrxYDc6MgI5f3Oi/0SvsobcOQ5Ok0Ih9pUIdYB3 g3oiUEiGg9sReZRbFzYkv7ZbJgZbhZqJlaFmR8Oodc6go6YWjfIFfWRHwPKIbje0SDKQ 6F8pDmeLIeLrj+vTjyYEmM9BquQum2ybzXS07Y6Q2jvFtVAVtZkerJ0/MHUDdHus9OaD s4iZh+IU9ERCL/SycIFd3CSHh9HOcMOTk0JOzMzzPS1UNwVJAcv/Ys0nHvxHwbR4n2Qa OFazI2z5dZcIKI+/DPcBlUaBvsHkmc55MFFsScwLGUNiKVuNjqs5vjnsQC86YKC3g7My JHVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707759245; x=1708364045; 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=CXMH4IJc0X5BO+B6rMU/CzufsF2HsIDy9PvrI1dJ7GA=; b=N4jd+gIHI8fQhcQUm2HQ3YtJSQvWudvH6l9H5z6u3C6upPoZ0VFbrtGtpXP8wutSzm sQyki7Mxf+ISn0F6kRqrHqXU16EGHwTEADldpe49puRgDRDEKl/UHekL8CWIjLFgVMEX ictJujpPlp6o+u6ISRnjjXFXzDio4UANC2xJswAoaEjQrHKb4nbdlpyMhCi6ZH8vimI0 2JJ4cbDlLFGFGKFRQMHWDMrIYO/+I6vPMTrJTpaDSSu61FfuEnI9pnc5fMfjd0hS8Cce sifIL2QbxMW8rYaWKRkKLvLJhNHsHLNkeK0/up2OR36roxp2BOSCWmrjQCBLA2eZt4+x 1Ecw== X-Forwarded-Encrypted: i=1; AJvYcCW5g6UM814rEz2BbCNFDwCb/XDG0+hdV4ahfCQ93NEttuC6u40HAMgD5DBO6U4gQBq8nhHlmRk1a/qPMOMG+rIXrLBqVjeIBN7X X-Gm-Message-State: AOJu0YxOjoi6FhHXcqVnG2pMDsf5xjUg0BH7P/C66uPLdc2FoKR4knYq gMHfG+KRPfZaypo4CGcpCaurmSKsM4PQdWGhVy9ozoGaeXNibCe9STsIjSK0U14iBYJXe2LUeph z X-Google-Smtp-Source: AGHT+IGNRVjuL3D3nPoP6nmInpROFk1WbvNwHnmPKzoxTtT+k5JKlrMlwTA53q98HIDyLArDdjcupA== X-Received: by 2002:a17:903:22cd:b0:1d9:ec19:2c95 with SMTP id y13-20020a17090322cd00b001d9ec192c95mr6663858plg.58.1707759245357; Mon, 12 Feb 2024 09:34:05 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVI+8j/xT+Yj5LgI+kpXPmQ4wnn/z9jWwSNb823CXTsHANAK77BZ6PSvJ8NO8BDK5CZnkMWu1wtrO455vZ+cRf2KZBAU/IGXACy 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 lo12-20020a170903434c00b001d88f0359c1sm596795plb.278.2024.02.12.09.34.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Feb 2024 09:34:04 -0800 (PST) Message-ID: Date: Mon, 12 Feb 2024 14:34:02 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 03/11] libio: Add fortify wrapper for internal __snprintf Content-Language: en-US To: Florian Weimer , libc-alpha@sourceware.org References: <45d399f3e70726984705466772370ba33ce3aa8a.1707491940.git.fweimer@redhat.com> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <45d399f3e70726984705466772370ba33ce3aa8a.1707491940.git.fweimer@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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,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:25, Florian Weimer wrote: > --- > debug/snprintf_chk.c | 1 + > include/bits/stdio2.h | 9 +++++++++ > include/stdio.h | 1 + > 3 files changed, 11 insertions(+) > > diff --git a/debug/snprintf_chk.c b/debug/snprintf_chk.c > index 995d805f5d..ea02efec3e 100644 > --- a/debug/snprintf_chk.c > +++ b/debug/snprintf_chk.c > @@ -40,4 +40,5 @@ ___snprintf_chk (char *s, size_t maxlen, int flag, size_t slen, > > return ret; > } > +ldbl_hidden_def (___snprintf_chk, __snprintf_chk) > ldbl_strong_alias (___snprintf_chk, __snprintf_chk) I am seeing a build failure on powerpc64le with config options --enable-stack-protector=all --enable-tunables=yes --enable-bind-now=yes --enable-profile=yes --enable-fortify-source=2 --enable-hardcoded-path-in-tests: powerpc64le-glibc-linux-gnu-gcc gconv_conf.c -c -std=gnu11 -fgnu89-inline -g -O2 -Wall -Wwrite-strings -Wundef -Werror -fmerge-all-constants -frounding-math -fstack-protector-all -fno-common -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=2 -Wstrict-prototypes -Wold-style-definition -fmath-errno -mabi=ieeelongdouble -Wno-psabi -mno-gnu-attribute -mlong-double-128 -fPIE [....] In file included from gconv_conf.c:26: ../include/stdio.h:65:1: error: ‘asm’ declaration ignored due to conflict with previous rename [-Werror=pragmas] 65 | stdio_hidden_ldbl_proto (__, snprintf_chk) | ^~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors All other ABIs build fine. > diff --git a/include/bits/stdio2.h b/include/bits/stdio2.h > index 6d7cf4306f..fb909c21ee 100644 > --- a/include/bits/stdio2.h > +++ b/include/bits/stdio2.h > @@ -1 +1,10 @@ > #include > + > +__fortify_function int > +__NTH (__snprintf (char *__restrict __s, size_t __n, > + const char *__restrict __fmt, ...)) > +{ > + return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, > + __glibc_objsize (__s), __fmt, > + __va_arg_pack ()); > +} > diff --git a/include/stdio.h b/include/stdio.h > index 24f1652f19..364f4d22a1 100644 > --- a/include/stdio.h > +++ b/include/stdio.h > @@ -62,6 +62,7 @@ extern int __vsscanf (const char *__restrict __s, > extern int __sprintf_chk (char *, int, size_t, const char *, ...) __THROW; > extern int __snprintf_chk (char *, size_t, int, size_t, const char *, ...) > __THROW; > +stdio_hidden_ldbl_proto (__, snprintf_chk) > extern int __vsprintf_chk (char *, int, size_t, const char *, > __gnuc_va_list) __THROW; > extern int __vsnprintf_chk (char *, size_t, int, size_t, const char *,