diff options
| author | Frédéric Bérat <fberat@redhat.com> | 2024-11-29 14:48:43 +0100 |
|---|---|---|
| committer | Frédéric Bérat <fberat@redhat.com> | 2025-02-24 14:19:36 +0100 |
| commit | fa53723cdb6f0338558e57a2a0a6459c00a1bc5f (patch) | |
| tree | c8f9955a4da1479b6c615afaa058e686645049b7 /support/next_to_fault.h | |
| parent | 29803ed3ce420f01e7c567c97fc8945d5e5e5992 (diff) | |
| download | glibc-fa53723cdb6f0338558e57a2a0a6459c00a1bc5f.tar.xz glibc-fa53723cdb6f0338558e57a2a0a6459c00a1bc5f.zip | |
support: Add support_next_to_fault_before support function
Refactor the support_next_to_fault and add the
support_next_to_fault_before method returns a buffer with a protected
page before it, to be able to test buffer underflow accesses.
Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@redhat.com>
Diffstat (limited to 'support/next_to_fault.h')
| -rw-r--r-- | support/next_to_fault.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/support/next_to_fault.h b/support/next_to_fault.h index 7112cc4c65..cec4b97332 100644 --- a/support/next_to_fault.h +++ b/support/next_to_fault.h @@ -41,6 +41,11 @@ struct support_next_to_fault fault). */ struct support_next_to_fault support_next_to_fault_allocate (size_t size); +/* Allocate a buffer of SIZE bytes just *after* a page which is mapped + with PROT_NONE (so that under-running the buffer will cause a + fault). */ +struct support_next_to_fault support_next_to_fault_allocate_before (size_t size); + /* Deallocate the memory region allocated by next_to_fault_allocate. */ void support_next_to_fault_free (struct support_next_to_fault *); |
