From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by sourceware.org (Postfix) with ESMTPS id 060F33858C2C for ; Tue, 13 Feb 2024 12:26:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 060F33858C2C 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 060F33858C2C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::632 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707827197; cv=none; b=f2Q6Mw8dVH7NlTUuqiIYTWEwPYljQNXmo6dBPPRlkXYDbPG+bjxkocx7VnaeRDC4XP9EG0Eh+l09HwQXHm94epIsEoSHEuaPKjUE4clnPOywTVG/hSMqrHAdgUTtun9X+DxMDZFBSucsMMtUENvAKWnSq4Qvf2jvVUzIK+ov4l8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707827197; c=relaxed/simple; bh=MkI5RU1EDgoPYnhYawwn4qV6e7MCysPRGiyOokg/8rU=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=GNiV97EkJ0GTV97HQpfkN0y0ezB4w3UslU3RBhMeGCmVB9DNcaaXr1y+95N6+twvTwwm0NbOV5/0TNRwfQ2ikcyEmhPkdzmBz0qqYYp+Oeg19faYUbBjb+XK35KHTOUc15i2jiF9dwZrvkQlU/1aV+uh/IHHZjKPTEZb9IFHptw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1d918008b99so29577875ad.3 for ; Tue, 13 Feb 2024 04:26:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707827194; x=1708431994; 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=m2vtzoirbPZAcwWpYuAIE2vElRmDQ8R11kDNUpa4W40=; b=QbCXxohCfAtmGrMrxtlas8cByOE1v30g00yKvWOLSule784WGsMjeXpYPJwTIuAr83 iP/NrsJgvH7CgFhlxrghuD3yW0PnCoA9Rx1R9bOwBskpTcKwtVVNA+KeHFFKUPbGJ+wz /hMp7OBSxGQJdUB1oufScQDyGxbz1rJ5nj3u+avhW421P4XepOkoNu/+t8Y7obrTD6x/ kdTZtaz3ZrsukBYmXeq2dhe4yonYr1211jRPA92WWWtqHxGp91+lBI0Xe/aUNqNsId1M 9y/vr0nnpx8JD8yw9Ak0h+eCmxEKy1ZysieNPvPjQ5iCr81XLAk3uAOlS87Ppor609J2 RA1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707827194; x=1708431994; 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=m2vtzoirbPZAcwWpYuAIE2vElRmDQ8R11kDNUpa4W40=; b=v0Jg/L8aEa51FIBgXv4UBMVZJvbLWwQvNc1F+O2B9sQ+765Ttu7fFXQKaNjsrIFFyT 8kV6pFBFzeqWFrudCTTS35Bt3H5MJPD1u1tz1gLwVnjyUBbWUa9pBfpHrbPQncA7annj OgqLnlo6A36pK3dg8/tbiBGTH+HlTn+CXercu+6KuenNnUSNPhwJY2QFNPRU/PjSZryx 1Ej/gKmqw/jt+IRjzuCh6h7fwxkxsd5/KOSFImTpkbN87tCihjbbqoCMAW+eOSgsaYMz NeeW92qqhKEKw5Gmvzq1WMKjrpIPLl9jJpsZdXqn9YiaFX9F9UH/ioiaykpWi9+ue9x8 DEvQ== X-Forwarded-Encrypted: i=1; AJvYcCWEchajF+Cn0XVYyxjQMgEVvX6DQ34prwVs0kZv40JP+M8ntPRUWOy5YJLeUOT/iQG2EXaWYRkLOkq4fdhzyAbXnRJFK/UgwMhC X-Gm-Message-State: AOJu0Yw943Lc98Dpp376s6gXFKSwqsfx/eJ5oRXniBHG7jl11XTmVatX WRSEmMMVRxF9STxijw6cL7RAXTgYMvodTNceMtYTIY6d//8sZ9ddO9vdcDTr+eM= X-Google-Smtp-Source: AGHT+IHv2JAcRlyjHlq84gTK4siDzdVmbYW9ndICE/c+OHx0nZFYK7aW+npzVZdF6/iyfmcJHYOY3w== X-Received: by 2002:a17:903:1309:b0:1d9:5b89:98e4 with SMTP id iy9-20020a170903130900b001d95b8998e4mr7418746plb.41.1707827193968; Tue, 13 Feb 2024 04:26:33 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUcqX0SDoa53n7rzyAHWV4MaL/8Z6sa/iWmECinGOqyUZsJj4lde22FC405RwPa2vuYw5nPSdNdZKVZu5UGgi8IrRn650N/hv0P 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 p6-20020a170902eac600b001d90b9ec345sm1991938pld.114.2024.02.13.04.26.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Feb 2024 04:26:33 -0800 (PST) Message-ID: <318743ac-cc65-4975-9465-7a15bd98f8e2@linaro.org> Date: Tue, 13 Feb 2024 09:26:31 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 05/11] syslog: Build with fortification Content-Language: en-US To: Florian Weimer , libc-alpha@sourceware.org References: <3025a0556566ebbe0955666387d1285b39605de4.1707491940.git.fweimer@redhat.com> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <3025a0556566ebbe0955666387d1285b39605de4.1707491940.git.fweimer@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.5 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: > This causes /proc/self/maps to be processed for certain syslog calls > due to the use of %n. LGTM, thanks. Reviewed-by: Adhemerval Zanella > --- > misc/Makefile | 5 ----- > misc/bits/syslog.h | 4 ++++ > misc/syslog.c | 3 +++ > 3 files changed, 7 insertions(+), 5 deletions(-) > > diff --git a/misc/Makefile b/misc/Makefile > index 6d8528c925..236076a9d6 100644 > --- a/misc/Makefile > +++ b/misc/Makefile > @@ -207,11 +207,6 @@ routines := \ > writev \ > # routines > > -# Exclude fortified routines from being built with _FORTIFY_SOURCE > -routines_no_fortify += \ > - syslog \ > - # routines_no_fortify > - > generated += \ > tst-allocate_once-mem.out \ > tst-allocate_once.mtrace \ > diff --git a/misc/bits/syslog.h b/misc/bits/syslog.h > index aadcd42000..e6f7938a3f 100644 > --- a/misc/bits/syslog.h > +++ b/misc/bits/syslog.h > @@ -31,11 +31,13 @@ > redirections, e.g. long double asm redirections. */ > > #ifdef __va_arg_pack > +# ifndef __glibc_nofortify_syslog > __fortify_function void > syslog (int __pri, const char *__fmt, ...) > { > __syslog_chk (__pri, __USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); > } > +# endif > #elif !defined __cplusplus > # define syslog(pri, ...) \ > __syslog_chk (pri, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__) > @@ -43,9 +45,11 @@ syslog (int __pri, const char *__fmt, ...) > > > #ifdef __USE_MISC > +# ifndef __glibc_nofortify_vsyslog > __fortify_function void > vsyslog (int __pri, const char *__fmt, __gnuc_va_list __ap) > { > __vsyslog_chk (__pri, __USE_FORTIFY_LEVEL - 1, __fmt, __ap); > } > +# endif > #endif > diff --git a/misc/syslog.c b/misc/syslog.c > index 4af87f54fd..68ee3aef5f 100644 > --- a/misc/syslog.c > +++ b/misc/syslog.c > @@ -27,6 +27,9 @@ > * SUCH DAMAGE. > */ > > +#define __glibc_nofortify_syslog > +#define __glibc_nofortify_vsyslog > + > #if defined(LIBC_SCCS) && !defined(lint) > static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94"; > #endif /* LIBC_SCCS and not lint */