mbox

[0/2] _FORTIFY_SOURCE fixes

Message ID 20220105013946.2646963-1-siddhesh@sourceware.org
Headers

Message

Siddhesh Poyarekar Jan. 5, 2022, 1:39 a.m. UTC
  The main patch is 2/2, which fixes some fortified headers to match
feature macros with their corresponding main headers, without which
functions would fail to get fortified.  Patch 1/2 is a restructuring of
the tests so that it is easier to add different configurations to
_FORTIFY_SOURCE tests at various levels.

Tested on x86_64 to confirm that there were no new regressions due to
this and that the new tests also run clean.

Siddhesh Poyarekar (2):
  debug: Refactor and expand _FORTIFY_SOURCE tests
  debug: Synchronize feature guards in fortified functions [BZ #28746]

 debug/Makefile                              |   80 +-
 debug/tst-chk0-lfs.c                        |    2 +
 debug/tst-chk0-nongnu.c                     |    3 +
 debug/tst-chk0.c                            | 1759 +++++++++++++++++++
 debug/tst-chk0cc-lfs.cc                     |    2 +
 debug/tst-chk0cc-nongnu.cc                  |    3 +
 debug/tst-chk0cc.cc                         |    1 +
 debug/{tst-lfschk1.c => tst-chk1-lfs.c}     |    0
 debug/tst-chk1-nongnu.c                     |    3 +
 debug/tst-chk1.c                            | 1728 +-----------------
 debug/{tst-lfschk4.cc => tst-chk1cc-lfs.cc} |    0
 debug/tst-chk1cc-nongnu.cc                  |    3 +
 debug/{tst-chk5.cc => tst-chk1cc.cc}        |    2 +-
 debug/{tst-lfschk2.c => tst-chk2-lfs.c}     |    0
 debug/tst-chk2-nongnu.c                     |    3 +
 debug/tst-chk2.c                            |    4 +-
 debug/{tst-lfschk5.cc => tst-chk2cc-lfs.cc} |    0
 debug/tst-chk2cc-nongnu.cc                  |    3 +
 debug/{tst-chk6.cc => tst-chk2cc.cc}        |    2 +-
 debug/{tst-lfschk3.c => tst-chk3-lfs.c}     |    0
 debug/tst-chk3-nongnu.c                     |    3 +
 debug/tst-chk3.c                            |    4 +-
 debug/{tst-lfschk6.cc => tst-chk3cc-lfs.cc} |    0
 debug/tst-chk3cc-nongnu.cc                  |    3 +
 debug/{tst-chk8.cc => tst-chk3cc.cc}        |    2 +-
 debug/tst-chk4.cc                           |    1 -
 debug/tst-chk7.c                            |    2 -
 posix/bits/unistd.h                         |    2 +-
 string/bits/string_fortified.h              |    8 +-
 support/xsignal.h                           |    2 +
 wcsmbs/bits/wchar2.h                        |    2 +-
 31 files changed, 1844 insertions(+), 1783 deletions(-)
 create mode 100644 debug/tst-chk0-lfs.c
 create mode 100644 debug/tst-chk0-nongnu.c
 create mode 100644 debug/tst-chk0.c
 create mode 100644 debug/tst-chk0cc-lfs.cc
 create mode 100644 debug/tst-chk0cc-nongnu.cc
 create mode 100644 debug/tst-chk0cc.cc
 rename debug/{tst-lfschk1.c => tst-chk1-lfs.c} (100%)
 create mode 100644 debug/tst-chk1-nongnu.c
 rename debug/{tst-lfschk4.cc => tst-chk1cc-lfs.cc} (100%)
 create mode 100644 debug/tst-chk1cc-nongnu.cc
 rename debug/{tst-chk5.cc => tst-chk1cc.cc} (54%)
 rename debug/{tst-lfschk2.c => tst-chk2-lfs.c} (100%)
 create mode 100644 debug/tst-chk2-nongnu.c
 rename debug/{tst-lfschk5.cc => tst-chk2cc-lfs.cc} (100%)
 create mode 100644 debug/tst-chk2cc-nongnu.cc
 rename debug/{tst-chk6.cc => tst-chk2cc.cc} (54%)
 rename debug/{tst-lfschk3.c => tst-chk3-lfs.c} (100%)
 create mode 100644 debug/tst-chk3-nongnu.c
 rename debug/{tst-lfschk6.cc => tst-chk3cc-lfs.cc} (100%)
 create mode 100644 debug/tst-chk3cc-nongnu.cc
 rename debug/{tst-chk8.cc => tst-chk3cc.cc} (54%)
 delete mode 100644 debug/tst-chk4.cc
 delete mode 100644 debug/tst-chk7.c