public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] manual: Document __wur usage under _FORTIFY_SOURCE
@ 2023-04-03 14:20 Siddhesh Poyarekar
  0 siblings, 0 replies; only message in thread
From: Siddhesh Poyarekar @ 2023-04-03 14:20 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ac2a14343e81098c196cef5d67b52e440c05c230

commit ac2a14343e81098c196cef5d67b52e440c05c230
Author: Siddhesh Poyarekar <siddhesh@sourceware.org>
Date:   Mon Apr 3 10:20:04 2023 -0400

    manual: Document __wur usage under _FORTIFY_SOURCE
    
    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 <siddhesh@sourceware.org>
    Reviewed-by: Florian Weimer <fweimer@redhat.com>

Diff:
---
 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-04-03 14:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-03 14:20 [glibc] manual: Document __wur usage under _FORTIFY_SOURCE Siddhesh Poyarekar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).