The definition for the fortified version of stpcpy and a few other functions are incorrectly under __USE_GNU when they should be under __USE_XOPEN2K8 because of which, they don't get fortified when _GNU_SOURCE is not defined. See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89748
The master branch has been updated by Siddhesh Poyarekar <siddhesh@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=fcfc9086815bf0d277ad47a90ee3fda4c37acca8 commit fcfc9086815bf0d277ad47a90ee3fda4c37acca8 Author: Siddhesh Poyarekar <siddhesh@sourceware.org> Date: Wed Jan 12 23:34:48 2022 +0530 debug: Synchronize feature guards in fortified functions [BZ #28746] Some functions (e.g. stpcpy, pread64, etc.) had moved to POSIX in the main headers as they got incorporated into the standard, but their fortified variants remained under __USE_GNU. As a result, these functions did not get fortified when _GNU_SOURCE was not defined. Add test wrappers that check all functions tested in tst-chk0 at all levels with _GNU_SOURCE undefined and then use the failures to (1) exclude checks for _GNU_SOURCE functions in these tests and (2) Fix feature macro guards in the fortified function headers so that they're the same as the ones in the main headers. This fixes BZ #28746. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Fixed.
The release/2.34/master branch has been updated by Siddhesh Poyarekar <siddhesh@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=224d8c1890b6c57c7e4e8ddbb792dd9552086704 commit 224d8c1890b6c57c7e4e8ddbb792dd9552086704 Author: Siddhesh Poyarekar <siddhesh@sourceware.org> Date: Wed Jan 12 23:34:48 2022 +0530 debug: Synchronize feature guards in fortified functions [BZ #28746] Some functions (e.g. stpcpy, pread64, etc.) had moved to POSIX in the main headers as they got incorporated into the standard, but their fortified variants remained under __USE_GNU. As a result, these functions did not get fortified when _GNU_SOURCE was not defined. Add test wrappers that check all functions tested in tst-chk0 at all levels with _GNU_SOURCE undefined and then use the failures to (1) exclude checks for _GNU_SOURCE functions in these tests and (2) Fix feature macro guards in the fortified function headers so that they're the same as the ones in the main headers. This fixes BZ #28746. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> (cherry picked from commit fcfc9086815bf0d277ad47a90ee3fda4c37acca8)