public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 00/21] Allow glibc to be built with _FORTIFY_SOURCE
@ 2023-06-20 18:18 Frédéric Bérat
  2023-06-20 18:18 ` [PATCH 01/21] Add --enable-fortify-source option Frédéric Bérat
                   ` (20 more replies)
  0 siblings, 21 replies; 50+ messages in thread
From: Frédéric Bérat @ 2023-06-20 18:18 UTC (permalink / raw)
  To: libc-alpha; +Cc: siddhesh, fberat

Hello,

This patch series introduces a new "--enable-fortify-source" option to glibc
build. This option may either be set to a value between 1 and 3, or left empty
to let configure select the highest value available for the build system.

The first patch adds the new configure option, the second excludes the routines
that can't be built with the option enabled.

The next patches are fixing test and compilation errors that arose with
fortification enabled.

I couldn't test the patch series in all configuration possible on all arches
possible but I ran the following:

 - build-many-glibcs was executed on x86_64, for all arches/variants. This was
   mainly done to ensure that installed headers were not broken (as some
   patches are modifying system headers)
 - The new "enable-fortify-source" variant for BMG got executed on x86_64
 - make check and benchtests were executed on x86_64, i686, ppc64le, aarch64,
   s390x, with and without fortification enabled.

Fred.

---
Frédéric Bérat (21):
  Add --enable-fortify-source option
  Configure: regenerate for autoconf 2.71
  Exclude routines from fortification
  sysdeps/{i386,x86_64}/mempcpy_chk.S: fix linknamespace for
    __mempcpy_chk
  stdio-common: tests: Incorrect maxlen parameter for swprintf
  sysdeps: Ensure ieee128*_chk routines to be properly named
  string: Ensure *_chk routines have their hidden builtin definition
    available
  stdio: Ensure *_chk routines have their hidden builtin definition
    available
  asprintf_chk: Ensure compatibility for both s390x and ppc64le
  misc/sys/cdefs.h: Create FORTIFY redirects for internal calls
  wcsmbs/bits/wchar2{,-decl}.h: Clearly separate declaration from
    definitions
  wcsmbs/bits/wchar2{,-decl}.h: Avoid PLT entries with _FORTIFY_SOURCE
  posix/bits/unistd.h: Clearly separate declaration from definitions
  posix/bits/unistd{,-decl}.h: Avoid PLT entries with _FORTIFY_SOURCE
  debug/readlink{,at}_chk.c: Harmonize declaration and definition
  misc/bits/select2.h: Clearly separate declaration from definitions
  misc/bits/syslog.h: Clearly separate declaration from definition
  rt/tst-mqueue4.c: Fix wrong number of argument for mq_open
  sysdeps/ieee754/ldbl-128ibm-compat: Fix warn unused result
  sysdeps/powerpc/fpu/tst-setcontext-fpscr.c: Fix warn unused result
  benchtests: fix warn unused result

 Makeconfig                                    |   33 +-
 aclocal.m4                                    |    2 +-
 benchtests/bench-strcoll.c                    |    6 +-
 config.make.in                                |    3 +-
 configure                                     | 4208 +++++++++++------
 configure.ac                                  |   70 +-
 debug/Makefile                                |   12 +-
 debug/asprintf_chk.c                          |   16 +-
 debug/fdelt_chk.c                             |    2 +
 debug/fgets_u_chk.c                           |    1 +
 debug/fprintf_chk.c                           |    1 +
 debug/getdomainname_chk.c                     |    1 +
 debug/memcpy_chk.c                            |    1 +
 debug/memmove_chk.c                           |    1 +
 debug/mempcpy_chk.c                           |    1 +
 debug/memset_chk.c                            |    1 +
 debug/read_chk.c                              |    1 +
 debug/readlink_chk.c                          |    3 +-
 debug/readlinkat_chk.c                        |    3 +-
 debug/sprintf_chk.c                           |    1 +
 debug/stpcpy_chk.c                            |    1 +
 debug/wcrtomb_chk.c                           |    1 +
 debug/wmemset_chk.c                           |    1 +
 elf/rtld-Rules                                |    2 +-
 include/bits/select-decl.h                    |    1 +
 include/bits/syslog-decl.h                    |    1 +
 include/bits/unistd-decl.h                    |    1 +
 include/stdio.h                               |   13 +-
 include/string.h                              |    7 +
 include/sys/cdefs.h                           |   14 +
 include/sys/select.h                          |    4 +
 include/sys/syslog.h                          |    4 +
 include/unistd.h                              |    5 +
 include/wchar.h                               |   16 +
 io/Makefile                                   |   16 +
 libio/Makefile                                |   21 +-
 login/Makefile                                |    6 +
 login/getlogin_r_chk.c                        |    1 +
 misc/Makefile                                 |    9 +
 misc/bits/select-decl.h                       |   31 +
 misc/bits/select2.h                           |    6 +-
 misc/bits/syslog-decl.h                       |   35 +
 misc/bits/syslog.h                            |   10 +-
 misc/sys/cdefs.h                              |    8 +
 misc/syslog.c                                 |    4 +-
 posix/Makefile                                |   12 +
 posix/bits/unistd-decl.h                      |  198 +
 posix/bits/unistd.h                           |  154 +-
 rt/Makefile                                   |    5 +
 rt/tst-mqueue4.c                              |    4 +-
 setjmp/Makefile                               |    5 +
 socket/Makefile                               |    6 +
 stdio-common/Makefile                         |   15 +-
 stdio-common/tst-printf-bz25691.c             |    8 +-
 stdio-common/tst-vfprintf-mbs-prec.c          |   15 +-
 stdlib/Makefile                               |    7 +
 string/Makefile                               |   17 +
 sysdeps/generic/libc-symver.h                 |    2 +-
 sysdeps/i386/i586/memcpy.S                    |    1 +
 sysdeps/i386/i586/memset.S                    |    1 +
 sysdeps/i386/i686/memcpy.S                    |    1 +
 sysdeps/i386/i686/memmove.S                   |    1 +
 sysdeps/i386/i686/mempcpy.S                   |    1 +
 sysdeps/i386/i686/memset.S                    |    1 +
 sysdeps/i386/i686/multiarch/memcpy_chk.c      |    4 +
 sysdeps/i386/i686/multiarch/memmove_chk.c     |    4 +
 sysdeps/i386/i686/multiarch/mempcpy_chk.c     |    4 +
 sysdeps/i386/i686/multiarch/memset_chk.c      |    5 +-
 sysdeps/i386/memcpy_chk.S                     |    1 +
 sysdeps/i386/memmove_chk.S                    |    1 +
 sysdeps/i386/mempcpy_chk.S                    |    3 +-
 sysdeps/i386/memset_chk.S                     |    1 +
 sysdeps/ieee754/ldbl-128ibm-compat/Makefile   |   81 +-
 .../ldbl-128ibm-compat/ieee128-asprintf_chk.c |    5 +-
 .../ldbl-128ibm-compat/ieee128-dprintf_chk.c  |    4 +-
 .../ldbl-128ibm-compat/ieee128-fprintf_chk.c  |    5 +-
 .../ldbl-128ibm-compat/ieee128-fwprintf_chk.c |    5 +-
 .../ldbl-128ibm-compat/ieee128-printf_chk.c   |    4 +-
 .../ldbl-128ibm-compat/ieee128-snprintf_chk.c |    4 +-
 .../ldbl-128ibm-compat/ieee128-sprintf_chk.c  |    5 +-
 .../ldbl-128ibm-compat/ieee128-swprintf_chk.c |    4 +-
 .../ldbl-128ibm-compat/ieee128-syslog.c       |    9 +-
 .../ieee128-vasprintf_chk.c                   |    4 +-
 .../ldbl-128ibm-compat/ieee128-vdprintf_chk.c |    4 +-
 .../ldbl-128ibm-compat/ieee128-vfprintf_chk.c |    4 +-
 .../ieee128-vfwprintf_chk.c                   |    4 +-
 .../ldbl-128ibm-compat/ieee128-vprintf_chk.c  |    4 +-
 .../ieee128-vsnprintf_chk.c                   |    4 +-
 .../ldbl-128ibm-compat/ieee128-vsprintf_chk.c |    5 +-
 .../ieee128-vswprintf_chk.c                   |    4 +-
 .../ldbl-128ibm-compat/ieee128-vwprintf_chk.c |    4 +-
 .../ldbl-128ibm-compat/ieee128-wprintf_chk.c  |    4 +-
 .../test-printf-ldbl-compat.c                 |   10 +-
 .../test-scanf-ldbl-compat-template.c         |   21 +-
 sysdeps/ieee754/ldbl-opt/Makefile             |   29 +
 sysdeps/powerpc/fpu/tst-setcontext-fpscr.c    |    4 +-
 sysdeps/pthread/Makefile                      |    4 +
 sysdeps/unix/sysv/linux/Makefile              |    3 +
 .../sysv/linux/s390/tst-ptrace-singleblock.c  |    3 +-
 sysdeps/x86_64/memcpy_chk.S                   |    1 +
 sysdeps/x86_64/memmove_chk.S                  |    1 +
 sysdeps/x86_64/mempcpy_chk.S                  |    3 +-
 sysdeps/x86_64/memset_chk.S                   |    1 +
 sysdeps/x86_64/multiarch/memcpy_chk.c         |    4 +
 sysdeps/x86_64/multiarch/memmove_chk.c        |    4 +
 sysdeps/x86_64/multiarch/mempcpy_chk.c        |    4 +
 sysdeps/x86_64/multiarch/memset_chk.c         |    4 +
 sysdeps/x86_64/multiarch/wmemset_chk.c        |    4 +
 wcsmbs/Makefile                               |   23 +-
 wcsmbs/bits/wchar2-decl.h                     |  172 +
 wcsmbs/bits/wchar2.h                          |  192 -
 111 files changed, 3765 insertions(+), 1951 deletions(-)
 create mode 100644 include/bits/select-decl.h
 create mode 100644 include/bits/syslog-decl.h
 create mode 100644 include/bits/unistd-decl.h
 create mode 100644 misc/bits/select-decl.h
 create mode 100644 misc/bits/syslog-decl.h
 create mode 100644 posix/bits/unistd-decl.h

-- 
2.41.0


^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2023-07-14  6:33 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-20 18:18 [PATCH 00/21] Allow glibc to be built with _FORTIFY_SOURCE Frédéric Bérat
2023-06-20 18:18 ` [PATCH 01/21] Add --enable-fortify-source option Frédéric Bérat
2023-06-20 20:42   ` Joseph Myers
2023-06-21 13:19     ` Frederic Berat
2023-06-21 13:18   ` Frederic Berat
2023-06-21 15:25     ` Siddhesh Poyarekar
2023-06-22 11:48       ` Frederic Berat
2023-06-22 11:54         ` Siddhesh Poyarekar
2023-06-22 12:29           ` Adhemerval Zanella Netto
2023-06-22 12:50             ` Siddhesh Poyarekar
2023-06-22 19:39               ` Adhemerval Zanella Netto
2023-06-22 21:26                 ` Siddhesh Poyarekar
2023-06-23  7:29                   ` Frederic Berat
2023-06-23  5:46       ` Sam James
2023-06-20 18:18 ` [PATCH 02/21] Configure: regenerate for autoconf 2.71 Frédéric Bérat
2023-06-20 20:47   ` Joseph Myers
2023-06-22 19:07   ` Florian Weimer
2023-06-23 11:28     ` Carlos O'Donell
2023-06-20 18:18 ` [PATCH 03/21] Exclude routines from fortification Frédéric Bérat
2023-06-20 18:18 ` [PATCH 04/21] sysdeps/{i386,x86_64}/mempcpy_chk.S: fix linknamespace for __mempcpy_chk Frédéric Bérat
2023-06-21 12:27   ` Siddhesh Poyarekar
2023-06-21 17:26     ` Noah Goldstein
2023-06-22  4:02       ` Siddhesh Poyarekar
2023-06-20 18:18 ` [PATCH 05/21] stdio-common: tests: Incorrect maxlen parameter for swprintf Frédéric Bérat
2023-06-21 12:29   ` Siddhesh Poyarekar
2023-06-20 18:18 ` [PATCH 06/21] sysdeps: Ensure ieee128*_chk routines to be properly named Frédéric Bérat
2023-06-20 18:18 ` [PATCH 07/21] string: Ensure *_chk routines have their hidden builtin definition available Frédéric Bérat
2023-06-20 18:18 ` [PATCH 08/21] stdio: " Frédéric Bérat
2023-06-20 18:18 ` [PATCH 09/21] asprintf_chk: Ensure compatibility for both s390x and ppc64le Frédéric Bérat
2023-06-20 18:18 ` [PATCH 10/21] misc/sys/cdefs.h: Create FORTIFY redirects for internal calls Frédéric Bérat
2023-06-20 18:18 ` [PATCH 11/21] wcsmbs/bits/wchar2{,-decl}.h: Clearly separate declaration from definitions Frédéric Bérat
2023-06-22  4:19   ` Siddhesh Poyarekar
2023-06-20 18:19 ` [PATCH 12/21] wcsmbs/bits/wchar2{,-decl}.h: Avoid PLT entries with _FORTIFY_SOURCE Frédéric Bérat
2023-06-20 18:19 ` [PATCH 13/21] posix/bits/unistd.h: Clearly separate declaration from definitions Frédéric Bérat
2023-06-22  4:17   ` Siddhesh Poyarekar
2023-06-20 18:19 ` [PATCH 14/21] posix/bits/unistd{,-decl}.h: Avoid PLT entries with _FORTIFY_SOURCE Frédéric Bérat
2023-06-20 18:19 ` [PATCH 15/21] debug/readlink{,at}_chk.c: Harmonize declaration and definition Frédéric Bérat
2023-06-22  4:11   ` Siddhesh Poyarekar
2023-06-20 18:19 ` [PATCH 16/21] misc/bits/select2.h: Clearly separate declaration from definitions Frédéric Bérat
2023-06-22  4:16   ` Siddhesh Poyarekar
2023-06-20 18:19 ` [PATCH 17/21] misc/bits/syslog.h: Clearly separate declaration from definition Frédéric Bérat
2023-06-22  4:24   ` Siddhesh Poyarekar
2023-06-20 18:19 ` [PATCH 18/21] rt/tst-mqueue4.c: Fix wrong number of argument for mq_open Frédéric Bérat
2023-06-21 12:26   ` Siddhesh Poyarekar
2023-06-20 18:19 ` [PATCH 19/21] sysdeps/ieee754/ldbl-128ibm-compat: Fix warn unused result Frédéric Bérat
2023-06-21 11:56   ` Siddhesh Poyarekar
2023-06-20 18:19 ` [PATCH 20/21] sysdeps/powerpc/fpu/tst-setcontext-fpscr.c: " Frédéric Bérat
2023-06-21 11:45   ` Siddhesh Poyarekar
2023-06-20 18:19 ` [PATCH 21/21] benchtests: fix " Frédéric Bérat
2023-06-21 11:42   ` 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).