public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Siddhesh Poyarekar <siddhesh@sourceware.org>, libc-alpha@sourceware.org
Cc: fweimer@redhat.com, jakub@redhat.com, Paul Eggert <eggert@cs.ucla.edu>
Subject: Re: [PATCH v7 1/4] Warn on unsupported fortification levels
Date: Thu, 31 Dec 2020 07:45:52 -0300	[thread overview]
Message-ID: <df5a7689-ad16-5d30-9e61-ef5bfa3088f9@linaro.org> (raw)
In-Reply-To: <20201230064348.376092-2-siddhesh@sourceware.org>



On 30/12/2020 03:43, Siddhesh Poyarekar wrote:
> Make the _FORTIFY_SOURCE macro soup in features.h warn about
> unsupported fortification levels.  For example, it will warn about
> _FORTIFY_SOURCE=3 and over with an indication of which level has been
> selected.
> 
> Co-authored-by: Paul Eggert <eggert@cs.ucla.edu>

LGTM, although I think the NEWS entry should move to the second patch.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  NEWS                 | 6 ++++++
>  include/features.h   | 3 +++
>  manual/creature.texi | 3 ++-
>  3 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/NEWS b/NEWS
> index 86e05fb023..8e02dbd0f7 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -28,6 +28,12 @@ Major new features:
>    The 32-bit RISC-V port requires at least Linux 5.4, GCC 7.1 and binutils
>    2.28.
>  
> +* A new fortification level _FORTIFY_SOURCE=3 is available.  At this level,
> +  glibc may use additional checks that may have an additional performance
> +  overhead.  At present these checks are available only on LLVM 9 and later.
> +  The latest GCC available at this time (10.2) does not support this level of
> +  fortification.
> +
>  Deprecated and removed features, and other changes affecting compatibility:
>  
>  * The mallinfo function is marked deprecated.  Callers should call

Maybe move this NEWS entry to second patch, where this is actually enabled?

> diff --git a/include/features.h b/include/features.h
> index f3e62d3362..540230b90b 100644
> --- a/include/features.h
> +++ b/include/features.h
> @@ -398,6 +398,9 @@
>  # elif !__GNUC_PREREQ (4, 1)
>  #  warning _FORTIFY_SOURCE requires GCC 4.1 or later
>  # elif _FORTIFY_SOURCE > 1
> +#  if _FORTIFY_SOURCE > 2
> +#   warning _FORTIFY_SOURCE > 2 is treated like 2 on this platform
> +#  endif
>  #  define __USE_FORTIFY_LEVEL 2
>  # else
>  #  define __USE_FORTIFY_LEVEL 1
> diff --git a/manual/creature.texi b/manual/creature.texi
> index be5050468b..31208ccb2b 100644
> --- a/manual/creature.texi
> +++ b/manual/creature.texi
> @@ -254,7 +254,8 @@ included.
>  @standards{GNU, (none)}
>  If this macro is defined to @math{1}, security hardening is added to
>  various library functions.  If defined to @math{2}, even stricter
> -checks are applied.
> +checks are applied. If defined to @math{3}, @theglibc{} may also use
> +checks that may have an additional performance overhead.
>  @end defvr
>  
>  @defvr Macro _REENTRANT
> 

  reply	other threads:[~2020-12-31 10:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-30  6:43 [PATCH v7 0/4] _FORTIFY_SOURCE=3 Siddhesh Poyarekar
2020-12-30  6:43 ` [PATCH v7 1/4] Warn on unsupported fortification levels Siddhesh Poyarekar
2020-12-31 10:45   ` Adhemerval Zanella [this message]
2020-12-31 11:28     ` Siddhesh Poyarekar
2020-12-30  6:43 ` [PATCH v7 2/4] Introduce _FORTIFY_SOURCE=3 Siddhesh Poyarekar
2020-12-31 10:47   ` Adhemerval Zanella
2020-12-30  6:43 ` [PATCH v7 3/4] string: Enable __FORTIFY_LEVEL=3 Siddhesh Poyarekar
2020-12-31 10:48   ` Adhemerval Zanella
2020-12-30  6:43 ` [PATCH v7 4/4] nonstring: " Siddhesh Poyarekar
2020-12-31 10:50   ` Adhemerval Zanella

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=df5a7689-ad16-5d30-9e61-ef5bfa3088f9@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=eggert@cs.ucla.edu \
    --cc=fweimer@redhat.com \
    --cc=jakub@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).