From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id D0CA63858D39 for ; Mon, 3 Apr 2023 13:54:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D0CA63858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680530071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=152HsvYQhFy7bt945yY48ju2qfpYjbbU2B3mTnUxvqw=; b=Xy/MW8WviBg56Bdf5oiPP2EzUYKCzuzqYVc4trFWSxRd8nv3H5XneisDNwXjhizVD+U6y2 SsdPE4Wti1qlAYDAgKlL/+sqHZ2fTpyDlJpGGHASH16UYkfZwnwFpOoTCaNJlzqVBaNmuE D8ZDwmREfngRIcWzWimql4Ev63YdQls= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-540-5d5idEEpMN2kmdCtybA5rw-1; Mon, 03 Apr 2023 09:54:30 -0400 X-MC-Unique: 5d5idEEpMN2kmdCtybA5rw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0BC0628082AB; Mon, 3 Apr 2023 13:54:30 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.85]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 87434140EBF4; Mon, 3 Apr 2023 13:54:27 +0000 (UTC) From: Florian Weimer To: Siddhesh Poyarekar Cc: libc-alpha@sourceware.org Subject: Re: [PATCH v2] manual: Document __wur usage under _FORTIFY_SOURCE References: <20230324144005.26782-1-siddhesh@sourceware.org> <20230324152543.30573-1-siddhesh@sourceware.org> Date: Mon, 03 Apr 2023 15:54:22 +0200 In-Reply-To: <20230324152543.30573-1-siddhesh@sourceware.org> (Siddhesh Poyarekar's message of "Fri, 24 Mar 2023 11:25:43 -0400") Message-ID: <87edp12hrl.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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: * Siddhesh Poyarekar: > The __warn_unused_result__ attribute is only enabled when fortification > is enabled. Mention that in the document. The rationale for this is > essentially to mitigate against CWE-252: > > [1] https://cwe.mitre.org/data/definitions/252.html > > Signed-off-by: Siddhesh Poyarekar > --- > manual/maint.texi | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/manual/maint.texi b/manual/maint.texi > index 76d4a1a147..a8441e20b6 100644 > --- a/manual/maint.texi > +++ b/manual/maint.texi > @@ -207,6 +207,9 @@ hardened variant that does additional safety checks at runtime. Some > hardened variants need the size of the buffer to perform access > validation and this is provided by the @code{__builtin_object_size} or > the @code{__builtin_dynamic_object_size} builtin functions. > +@code{_FORTIFY_SOURCE} also enables additional compile time diagnostics, > +such as unchecked return values from some functions, to encourage > +developers to add error checking for those functions. > > At runtime, if any of those safety checks fail, the program will > terminate with a @code{SIGABRT} signal. @code{_FORTIFY_SOURCE} may be Looks good. Reviewed-by: Florian Weimer Thanks, Florian