[scudo] Satisfy -Wstrict-prototypesDifferential Revision: https://reviews.llvm.org/D129391
[scudo] Handle predefined M_MEMTAG_TUNING_* constants (NFC).Bionic <malloc.h> may provide the definitions of M_MEMTAG_TUNING_* constants.Do not redefine them in that case.Differential Revision:
[scudo] Handle predefined M_MEMTAG_TUNING_* constants (NFC).Bionic <malloc.h> may provide the definitions of M_MEMTAG_TUNING_* constants.Do not redefine them in that case.Differential Revision: https://reviews.llvm.org/D104758
show more ...
scudo: Add support for tracking stack traces of secondary allocations.There is no centralized store of information related to secondaryallocations. Moreover the allocations themselves become inacc
scudo: Add support for tracking stack traces of secondary allocations.There is no centralized store of information related to secondaryallocations. Moreover the allocations themselves become inaccessiblewhen the allocation is freed in order to implement UAF detection,so we can't store information there to be used in case of UAFanyway.Therefore our storage location for tracking stack traces of secondaryallocations is a ring buffer. The ring buffer is copied to the processcreating the crash dump when a fault occurs.The ring buffer is also used to store stack traces for primarydeallocations. Stack traces for primary allocations continue to bestored inline.In order to support the scenario where an access to the ring bufferis interrupted by a concurrently occurring crash, the ring buffer isaccessed in a lock-free manner.Differential Revision: https://reviews.llvm.org/D94212
scudo: Update a comment to match the Linux kernel behavior. NFCI.
scudo: Add an API for disabling memory initialization per-thread.Here "memory initialization" refers to zero- or pattern-init onnon-MTE hardware, or (where possible to avoid) memory tagging on MTE
scudo: Add an API for disabling memory initialization per-thread.Here "memory initialization" refers to zero- or pattern-init onnon-MTE hardware, or (where possible to avoid) memory tagging on MTEhardware. With shared TSD the per-thread memory initialization stateis stored in bit 0 of the TLS slot, similar to PointerIntPair in LLVM.Differential Revision: https://reviews.llvm.org/D87739
[scudo][standalone] mallopt runtime configuration optionsSummary:Partners have requested the ability to configure more parts of Scudoat runtime, notably the Secondary cache options (maximum numbe
[scudo][standalone] mallopt runtime configuration optionsSummary:Partners have requested the ability to configure more parts of Scudoat runtime, notably the Secondary cache options (maximum number ofblocks cached, maximum size) as well as the TSD registry options(the maximum number of TSDs in use).This CL adds a few more Scudo specific `mallopt` parameters that arepassed down to the various subcomponents of the Combined allocator.- `M_CACHE_COUNT_MAX`: sets the maximum number of Secondary cached items- `M_CACHE_SIZE_MAX`: sets the maximum size of a cacheable item in the Secondary- `M_TSDS_COUNT_MAX`: sets the maximum number of TSDs that can be used (Shared Registry only)Regarding the TSDs maximum count, this is a one way option, onlyallowing to increase the count.In order to allow for this, I rearranged the code to have some `setOption`member function to the relevant classes, using the `scudo::Option` classenum to determine what is to be set.This also fixes an issue where a static variable (`Ready`) was used intemplated functions without being set back to `false` every time.Reviewers: pcc, eugenis, hctim, cferrisSubscribers: jfb, llvm-commits, #sanitizersTags: #sanitizersDifferential Revision: https://reviews.llvm.org/D84667
scudo: Interleave odd and even tags for adjacent blocks.This guarantees that we will detect a buffer overflow or underflowthat overwrites an adjacent block. This spatial guarantee is similarto th
scudo: Interleave odd and even tags for adjacent blocks.This guarantees that we will detect a buffer overflow or underflowthat overwrites an adjacent block. This spatial guarantee is similarto the temporal guarantee that we provide for immediate use-after-free.Enabling odd/even tags involves a tradeoff between use-after-freedetection and buffer overflow detection. Odd/even tags make it morelikely for buffer overflows to be detected by increasing the size ofthe guaranteed "red zone" around the allocation, but on the otherhand use-after-free is less likely to be detected because the tagspace for any particular chunk is cut in half. Therefore we introducea tuning setting to control whether odd/even tags are enabled.Differential Revision: https://reviews.llvm.org/D84361
scudo: Add support for diagnosing memory errors when memory tagging is enabled.Introduce a function __scudo_get_error_info() that may be called to interpreta crash resulting from a memory error, p
scudo: Add support for diagnosing memory errors when memory tagging is enabled.Introduce a function __scudo_get_error_info() that may be called to interpreta crash resulting from a memory error, potentially in another process,given information extracted from the crashing process. The crash may beinterpreted as a use-after-free, buffer overflow or buffer underflow.Also introduce a feature to optionally record a stack trace for eachallocation and deallocation. If this feature is enabled, a stack trace forthe allocation and (if applicable) the deallocation will also be availablevia __scudo_get_error_info().Differential Revision: https://reviews.llvm.org/D77283
scudo: Create a public include directory. NFCI.For MTE error reporting we will need to expose interfaces for crash handlersto use to interpret scudo headers and metadata. The intent is that these
scudo: Create a public include directory. NFCI.For MTE error reporting we will need to expose interfaces for crash handlersto use to interpret scudo headers and metadata. The intent is that theseinterfaces will live in scudo/interface.h.Move the existing interface.h into an include/scudo directory and make itindependent of the internal headers, so that we will be able to add theinterfaces there.Differential Revision: https://reviews.llvm.org/D76648