1
0
mirror of https://sourceware.org/git/glibc.git synced 2026-10-24 01:33:52 +03:00

support: add check_mem_access function

Add check_mem_access(addr) function to check if memory at addr can
be written or read returning false if memory is not accessible.

This function changes signal handler for SIGSEGV and SIGBUS signals
when it is called first, and it is not thread-safe.

Co-authored-by: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
This commit is contained in:
Yury Khrustalev
2025-09-09 15:15:29 +01:00
parent 041151f439
commit 9be489d778
5 changed files with 102 additions and 48 deletions

View File

@@ -12,7 +12,7 @@ extern void ____longjmp_chk (__jmp_buf __env, int __val)
__attribute__ ((__noreturn__)) attribute_hidden;
extern void __longjmp_chk (sigjmp_buf env, int val)
__attribute__ ((noreturn)) attribute_hidden;
__attribute__ ((noreturn));
/* The redirection in the installed header does not work with
libc_hidden_proto. */
#define longjmp __longjmp_chk