From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dormouse.elm.relay.mailchannels.net (dormouse.elm.relay.mailchannels.net [23.83.212.50]) by sourceware.org (Postfix) with ESMTPS id 91AA63858C27 for ; Mon, 14 Mar 2022 07:59:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 91AA63858C27 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gotplt.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id A0DD32C14CB; Mon, 14 Mar 2022 07:59:19 +0000 (UTC) Received: from pdx1-sub0-mail-a305.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 8C9C62C147D; Mon, 14 Mar 2022 07:59:18 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1647244758; a=rsa-sha256; cv=none; b=vH9EbS/9UoawpKDESUrsZRukugLqT6ul98XmK7csdFWT/a3lXt3096r4XytkhY86DW3wxa nJPGq6mLNGM6zrOvBSygBU02+OqHUaGb7KAtk03PpjwPLiksN1oeU62/1DEpJR15qRx3jk 9fimBc6p3D0C4G1vPdmIB5Ht8QcoHKZypFhbOcqk57AJSdOQ7WdH7mbZ+ogV7F5IK74HTY Wt6KFeo4AeqrnqENqFFurGV3UAOymkVZtlIgBI4JPYdGehsI70PKaza2YXu0HDzuW2GFXl rVvrII9Q1Ce++GUO/mZuG4wOnutXy06hudBM+EuNRYPio4K+2ZVAB086dbVxQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1647244758; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=P42jIFz8RvS+Weiv2fqcp0vWcUl6r1UMi+Mn9Bezl88=; b=4/vrWcu2uBmGG50M6Bj9AOa5wNnhc4XTOLSr7EocA7uTOE2USB4Ee3dydXRS0om6K6GkAe AfsnNoiM1yO0dLIv82IcsRlG19gU0w/5rG8ifmTekA+VfOegRqvNkjiv6oW9LVwV02aUUV GuS4X37X5100Te2wahFECatVxBP+ZBjgn8j2OPT/agudU1lS+Um7coJ+SEPSXOrYUjhL2t UNvueILtDom35RLpFzz+ZDv6UAwLSaDVTgPyDmXoWuiYoc26lCguqvUXmfIgaZjYzwr/DH GWDoOZp+jEvDn5MlMt8CvzKLlQG18yF0tgRlMp+T7p+LOC6Z6NvfIVhnOxoq9w== ARC-Authentication-Results: i=1; rspamd-74bfb75fc6-9rchj; auth=pass smtp.auth=dreamhost smtp.mailfrom=siddhesh@gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a305.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.107.255.147 (trex/6.5.3); Mon, 14 Mar 2022 07:59:19 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Relation-White: 1fefca1720d286c7_1647244759256_3095962310 X-MC-Loop-Signature: 1647244759256:1249695251 X-MC-Ingress-Time: 1647244759256 Received: from [192.168.254.116] (unknown [106.220.192.183]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a305.dreamhost.com (Postfix) with ESMTPSA id 4KH87n1kQKz2g; Mon, 14 Mar 2022 00:59:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gotplt.org; s=dreamhost; t=1647244758; bh=P42jIFz8RvS+Weiv2fqcp0vWcUl6r1UMi+Mn9Bezl88=; h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding; b=IOw+vsdyFdU71OnhAh6OaBO764+lsutBl/nf/XP+tNEXmSDQomKL72c/wpSbo+Y3S rskD0LgcYQwBox0Hi+cGDAIZ7fhW+CRrw1gz0uLN7OpROwOgou8/LqjybYrk93GAPa X5XY29x0AaF3Sxl37/QiR7P9/2zPP3KZn+lfVT1wRoHBiBUN+kH3leG3I2kj5/2B9J zqht6SzZR2jj5rRLhaAWKjsLKIfERoxX9xyx5FePlcu4fasqpJOVNHnT+BSTBFyrE8 dQu6XNsHR2Q+oBWxFxSMVbeJfKxrJMnVwDMcbULwl5oSIEMnyl2kYL7X2hjJxDB9xn c0NP/ZT3ZLNcQ== Message-ID: <4a5642ad-dc2a-8439-8059-545743b2937a@gotplt.org> Date: Mon, 14 Mar 2022 13:29:13 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [Patch v2] Add access function attributes to grp and shadow headers Content-Language: en-US To: Steve Grubb , libc-alpha@sourceware.org References: <4708166.GXAFRqVoOG@x2> From: Siddhesh Poyarekar In-Reply-To: <4708166.GXAFRqVoOG@x2> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3028.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2022 07:59:23 -0000 On 11/03/2022 04:01, Steve Grubb via Libc-alpha wrote: > This patch adds access function attributes to the re-entrant functions > in grp.h and shadow headers. > > v2 - add missing parenthesis > > --- This patch showed up as failed in patchwork CI: https://patchwork.sourceware.org/project/glibc/patch/4708166.GXAFRqVoOG@x2/ https://www.delorie.com/trybots/32bit/7828/misc-tst-bz21269.out However the failure is unrelated to this change. I ran tst-bz21269 in a loop with and without this patch and found that it occasionally timed out. I've filed a separate bug for this: https://sourceware.org/bugzilla/show_bug.cgi?id=28961 LGTM. I'll push once my test run completes. Reviewed-by: Siddhesh Poyarekar > grp/grp.h | 12 ++++++++---- > gshadow/gshadow.h | 12 ++++++++---- > shadow/shadow.h | 12 ++++++++---- > 3 files changed, 24 insertions(+), 12 deletions(-) > --- > diff -urp glibc-2.35.9000-111-g2bbc694df2.orig/grp/grp.h glibc-2.35.9000-111-g2bbc694df2/grp/grp.h > --- glibc-2.35.9000-111-g2bbc694df2.orig/grp/grp.h 2022-02-28 10:47:38.000000000 -0500 > +++ glibc-2.35.9000-111-g2bbc694df2/grp/grp.h 2022-03-10 11:56:18.733069367 -0500 > @@ -130,7 +130,8 @@ extern struct group *getgrnam (const cha > # ifdef __USE_GNU > extern int getgrent_r (struct group *__restrict __resultbuf, > char *__restrict __buffer, size_t __buflen, > - struct group **__restrict __result); > + struct group **__restrict __result) > + __attr_access ((__write_only__, 2, 3)); > # endif > > /* Search for an entry with a matching group ID. > @@ -139,7 +140,8 @@ extern int getgrent_r (struct group *__r > marked with __THROW. */ > extern int getgrgid_r (__gid_t __gid, struct group *__restrict __resultbuf, > char *__restrict __buffer, size_t __buflen, > - struct group **__restrict __result); > + struct group **__restrict __result) > + __attr_access ((__write_only__, 3, 4)); > > /* Search for an entry with a matching group name. > > @@ -148,7 +150,8 @@ extern int getgrgid_r (__gid_t __gid, st > extern int getgrnam_r (const char *__restrict __name, > struct group *__restrict __resultbuf, > char *__restrict __buffer, size_t __buflen, > - struct group **__restrict __result); > + struct group **__restrict __result) > + __attr_access ((__write_only__, 3, 4)); > > # ifdef __USE_MISC > /* Read a group entry from STREAM. This function is not standardized > @@ -161,7 +164,8 @@ extern int getgrnam_r (const char *__res > extern int fgetgrent_r (FILE *__restrict __stream, > struct group *__restrict __resultbuf, > char *__restrict __buffer, size_t __buflen, > - struct group **__restrict __result); > + struct group **__restrict __result) > + __attr_access ((__write_only__, 3, 4)); > # endif > > #endif /* POSIX or reentrant */ > diff -urp glibc-2.35.9000-111-g2bbc694df2.orig/gshadow/gshadow.h glibc-2.35.9000-111-g2bbc694df2/gshadow/gshadow.h > --- glibc-2.35.9000-111-g2bbc694df2.orig/gshadow/gshadow.h 2022-02-28 10:47:38.000000000 -0500 > +++ glibc-2.35.9000-111-g2bbc694df2/gshadow/gshadow.h 2022-03-10 12:10:00.417407391 -0500 > @@ -108,19 +108,23 @@ extern int putsgent (const struct sgrp * > or due to the implementation they are cancellation points and > therefore not marked with __THROW. */ > extern int getsgent_r (struct sgrp *__result_buf, char *__buffer, > - size_t __buflen, struct sgrp **__result); > + size_t __buflen, struct sgrp **__result) > + __attr_access ((__write_only__, 2, 3)); > > extern int getsgnam_r (const char *__name, struct sgrp *__result_buf, > char *__buffer, size_t __buflen, > - struct sgrp **__result); > + struct sgrp **__result) > + __attr_access ((__write_only__, 3, 4)); > > extern int sgetsgent_r (const char *__string, struct sgrp *__result_buf, > char *__buffer, size_t __buflen, > - struct sgrp **__result); > + struct sgrp **__result) > + __attr_access ((__write_only__, 3, 4)); > > extern int fgetsgent_r (FILE *__stream, struct sgrp *__result_buf, > char *__buffer, size_t __buflen, > - struct sgrp **__result); > + struct sgrp **__result) > + __attr_access ((__write_only__, 3, 4)); > #endif /* misc */ > > __END_DECLS > diff -urp glibc-2.35.9000-111-g2bbc694df2.orig/shadow/shadow.h glibc-2.35.9000-111-g2bbc694df2/shadow/shadow.h > --- glibc-2.35.9000-111-g2bbc694df2.orig/shadow/shadow.h 2022-02-28 10:47:38.000000000 -0500 > +++ glibc-2.35.9000-111-g2bbc694df2/shadow/shadow.h 2022-03-10 11:59:17.647530571 -0500 > @@ -122,19 +122,23 @@ extern int putspent (const struct spwd * > or due to the implementation they are cancellation points and > therefore not marked with __THROW. */ > extern int getspent_r (struct spwd *__result_buf, char *__buffer, > - size_t __buflen, struct spwd **__result); > + size_t __buflen, struct spwd **__result) > + __attr_access ((__write_only__, 2, 3)); > > extern int getspnam_r (const char *__name, struct spwd *__result_buf, > char *__buffer, size_t __buflen, > - struct spwd **__result); > + struct spwd **__result) > + __attr_access ((__write_only__, 3, 4)); > > extern int sgetspent_r (const char *__string, struct spwd *__result_buf, > char *__buffer, size_t __buflen, > - struct spwd **__result); > + struct spwd **__result) > + __attr_access ((__write_only__, 3, 4)); > > extern int fgetspent_r (FILE *__stream, struct spwd *__result_buf, > char *__buffer, size_t __buflen, > - struct spwd **__result); > + struct spwd **__result) > + __attr_access ((__write_only__, 3, 4)); > #endif /* misc */ > > > > >