From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from antelope.elm.relay.mailchannels.net (antelope.elm.relay.mailchannels.net [23.83.212.4]) by sourceware.org (Postfix) with ESMTPS id B282B3858D35 for ; Fri, 24 Mar 2023 15:25:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B282B3858D35 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=sourceware.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=sourceware.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 071DD14125B; Fri, 24 Mar 2023 15:25:49 +0000 (UTC) Received: from pdx1-sub0-mail-a306.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 9616B1410C4; Fri, 24 Mar 2023 15:25:48 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1679671548; a=rsa-sha256; cv=none; b=s/TmhhnKcquyCEXSriEfk+cl2g5pajpKhHlqMlNEClNk/4RB+SKpAfbVnPJvEiKBjnLf9f ELjtYcivUNCGd6Rzv08nrhfAmxMj8ykT6DoFieBuG3Pef8IJueco9ZL1ZxVxHTANi972w8 ljwNywpGeHojyC3KKq6xV3SkyVlnBYhBWIzYkuRNbtNro5wt+ugt+BT6QAOBpP0+QmlQnF ETMI6HHda2xMJg0eZw8s9VeMvZH9qxp5FBirvTnd/tlyZHJ+oZl4NX+mDg2Fbo2CEM0DWP v0f2hnIbw6rOQ56HPfMvUGYuIvhqS1lsbnM6zu18TELBhTMNMrLr9qfNLQziOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1679671548; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=APtLaLxEA9avRAEmnCKsHfukljOgVO4qm/cVnc8jjXw=; b=rL+jmskWzdHIphE92Wbx6WLL3ebT6YG+NwhX2kUKv6Nb9MTNUGa5kVtI/SRmSmb/J/CvZr m2jAwJmU6nI1h0Gyoz4+NA8gjw0I5+P/WBF7Rzg5onIOK9qiJ751ZsLtC6Bp3qSdJd4EhG oZM2jTACX4XsTeZpY3haYNFajV3/3kcixI11S5VaiJXJgQMTVvuXk4RnIk9cx3KumeIgs1 0wsRc42zl3CXpTQjP6r9oufg1gxmmCYjH4DKRkXxRpsjaMmD8PKEhhx5OPPNlHcz3pLOjf wLOkMNNyZK06ZHF4kR+dI6NlYthz3McqH46V7kRueeSYhY+0Xv73b6m897uDiw== ARC-Authentication-Results: i=1; rspamd-9576589d-lhrtt; auth=pass smtp.auth=dreamhost smtp.mailfrom=siddhesh@sourceware.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Blushing-Cooperative: 273a39de399bbf2e_1679671548842_256805025 X-MC-Loop-Signature: 1679671548842:3153324869 X-MC-Ingress-Time: 1679671548842 Received: from pdx1-sub0-mail-a306.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.116.217.201 (trex/6.7.2); Fri, 24 Mar 2023 15:25:48 +0000 Received: from fedora.redhat.com (bras-vprn-toroon4834w-lp130-09-174-91-45-153.dsl.bell.ca [174.91.45.153]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 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-a306.dreamhost.com (Postfix) with ESMTPSA id 4PjmHv6Qw8z1Y; Fri, 24 Mar 2023 08:25:47 -0700 (PDT) From: Siddhesh Poyarekar To: libc-alpha@sourceware.org Cc: fweimer@redhat.com Subject: [PATCH v2] manual: Document __wur usage under _FORTIFY_SOURCE Date: Fri, 24 Mar 2023 11:25:43 -0400 Message-Id: <20230324152543.30573-1-siddhesh@sourceware.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230324144005.26782-1-siddhesh@sourceware.org> References: <20230324144005.26782-1-siddhesh@sourceware.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1172.8 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_NONE,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_SOFTFAIL,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: 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 -- 2.39.2