From: Florian Weimer <fweimer@redhat.com>
To: Siddhesh Poyarekar <siddhesh@sourceware.org>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH v2] manual: Document __wur usage under _FORTIFY_SOURCE
Date: Mon, 03 Apr 2023 15:54:22 +0200 [thread overview]
Message-ID: <87edp12hrl.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <20230324152543.30573-1-siddhesh@sourceware.org> (Siddhesh Poyarekar's message of "Fri, 24 Mar 2023 11:25:43 -0400")
* 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 <siddhesh@sourceware.org>
> ---
> 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 <fweimer@redhat.com>
Thanks,
Florian
prev parent reply other threads:[~2023-04-03 13:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-24 14:40 [PATCH] " Siddhesh Poyarekar
2023-03-24 15:15 ` Florian Weimer
2023-03-24 15:23 ` Siddhesh Poyarekar
2023-03-24 15:25 ` [PATCH v2] " Siddhesh Poyarekar
2023-04-03 13:54 ` Florian Weimer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87edp12hrl.fsf@oldenburg.str.redhat.com \
--to=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
--cc=siddhesh@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).