summaryrefslogtreecommitdiff
path: root/debug/tst-sprintf-fortify-rdonly.c
AgeCommit message (Collapse)Author
2025-10-28Fix incorrect setrlimit return value checks in testsOsama Abdelkader
The setrlimit(2) function returns 0 on success and -1 on error, but several test files were incorrectly checking for a return value of 1 to detect errors. This means the error checks would never trigger, causing tests to continue silently even when setrlimit() failed. This commit fixes the error checks in five files to correctly test for -1, matching both the documented behavior and the pattern used correctly in other parts of the codebase. Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com> Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2025-03-21debug: Improve '%n' fortify detection (BZ 30932)Adhemerval Zanella
The 7bb8045ec0 path made the '%n' fortify check ignore EMFILE errors while trying to open /proc/self/maps, and this added a security issue where EMFILE can be attacker-controlled thus making it ineffective for some cases. The EMFILE failure is reinstated but with a different error message. Also, to improve the false positive of the hardening for the cases where no new files can be opened, the _dl_readonly_area now uses _dl_find_object to check if the memory area is within a writable ELF segment. The procfs method is still used as fallback. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Arjun Shankar <arjun@redhat.com>
2025-01-01Update copyright dates with scripts/update-copyrightsPaul Eggert
2024-01-01Update copyright dates with scripts/update-copyrightsPaul Eggert
2023-10-04debug: Add regression tests for BZ 30932Adhemerval Zanella
Checked on x86_64-linux-gnu. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>