diff options
Diffstat (limited to 'src/lib/libc/stdlib/malloc.3')
-rw-r--r-- | src/lib/libc/stdlib/malloc.3 | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/src/lib/libc/stdlib/malloc.3 b/src/lib/libc/stdlib/malloc.3 index b700add823..667baa9b7c 100644 --- a/src/lib/libc/stdlib/malloc.3 +++ b/src/lib/libc/stdlib/malloc.3 | |||
@@ -30,9 +30,9 @@ | |||
30 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 30 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
31 | .\" SUCH DAMAGE. | 31 | .\" SUCH DAMAGE. |
32 | .\" | 32 | .\" |
33 | .\" $OpenBSD: malloc.3,v 1.137 2023/07/01 18:35:14 otto Exp $ | 33 | .\" $OpenBSD: malloc.3,v 1.138 2023/10/22 12:19:26 otto Exp $ |
34 | .\" | 34 | .\" |
35 | .Dd $Mdocdate: July 1 2023 $ | 35 | .Dd $Mdocdate: October 22 2023 $ |
36 | .Dt MALLOC 3 | 36 | .Dt MALLOC 3 |
37 | .Os | 37 | .Os |
38 | .Sh NAME | 38 | .Sh NAME |
@@ -307,7 +307,7 @@ These malloc options imply | |||
307 | .Cm D . | 307 | .Cm D . |
308 | .It Cm F | 308 | .It Cm F |
309 | .Dq Freecheck . | 309 | .Dq Freecheck . |
310 | Enable more extensive double free and use after free detection. | 310 | Enable more extensive double free and write after free detection. |
311 | All chunks in the delayed free list will be checked for double frees and | 311 | All chunks in the delayed free list will be checked for double frees and |
312 | write after frees. | 312 | write after frees. |
313 | Unused pages on the freelist are read and write protected to | 313 | Unused pages on the freelist are read and write protected to |
@@ -641,18 +641,34 @@ or | |||
641 | reallocate an unallocated pointer was made. | 641 | reallocate an unallocated pointer was made. |
642 | .It Dq double free | 642 | .It Dq double free |
643 | There was an attempt to free an allocation that had already been freed. | 643 | There was an attempt to free an allocation that had already been freed. |
644 | .It Dq write after free | 644 | .It Dq write to free mem Va address Ns [ Va start Ns .. Ns Va end Ns ]@ Ns Va size |
645 | An allocation has been modified after it was freed. | 645 | An allocation has been modified after it was freed, |
646 | or a chunk that was never allocated was written to. | ||
647 | The | ||
648 | .Va range | ||
649 | at which corruption was detected is printed between [ and ]. | ||
650 | .Pp | ||
651 | Enabling option | ||
652 | .Cm D | ||
653 | allows malloc to print information about where the allocation | ||
654 | was done. | ||
646 | .It Dq modified chunk-pointer | 655 | .It Dq modified chunk-pointer |
647 | The pointer passed to | 656 | The pointer passed to |
648 | .Fn free | 657 | .Fn free |
649 | or a reallocation function has been modified. | 658 | or a reallocation function has been modified. |
650 | .It Dq canary corrupted address offset@length | 659 | .It Dq canary corrupted Va address Ns [ Va offset Ns ]@ Ns Va length Ns / Ns Va size |
651 | A byte after the requested size has been overwritten, | 660 | A byte after the requested |
661 | .Va length has been overwritten, | ||
652 | indicating a heap overflow. | 662 | indicating a heap overflow. |
653 | The offset at which corruption was detected is printed before the @, | 663 | The |
654 | and the requested length of the allocation after the @. | 664 | .Va offset |
655 | .It Dq recorded size oldsize inconsistent with size | 665 | at which corruption was detected is printed between [ and ], |
666 | the requested | ||
667 | .Va length | ||
668 | of the allocation is printed before the / and the | ||
669 | .Va size | ||
670 | of the allocation after the /. | ||
671 | .It Dq recorded size Va oldsize No inconsistent with Va size | ||
656 | .Fn recallocarray | 672 | .Fn recallocarray |
657 | or | 673 | or |
658 | .Fn freezero | 674 | .Fn freezero |
@@ -676,7 +692,7 @@ functions nor utilize any other functions which may call | |||
676 | (e.g., | 692 | (e.g., |
677 | .Xr stdio 3 | 693 | .Xr stdio 3 |
678 | routines). | 694 | routines). |
679 | .It Dq unknown char in MALLOC_OPTIONS | 695 | .It Dq unknown char in Ev MALLOC_OPTIONS |
680 | We found something we didn't understand. | 696 | We found something we didn't understand. |
681 | .It any other error | 697 | .It any other error |
682 | .Fn malloc | 698 | .Fn malloc |