mcheck implementation for U-Boot
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest9 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | mcheck: prepare +1 tier for mcheck-wrappers, in dl-*alloc commandscommon/ | +41 | 0 replies | |
| 2/9 | mcheck: Use memset/memcpy instead of MALLOC_ZERO/MALLOC_COPY for mcheck.common/ | +4 | 0 replies | |
| 3/9 | mcheck: introduce essentials of mcheckcommon/ include/ | +262 | 0 replies | |
| 4/9 | mcheck: integrate mcheck into dlmalloc.ccommon/ | +67 | 0 replies | |
| 5/9 | mcheck: support memaligncommon/ common/ | +24 | 0 replies | |
| 6/9 | mcheck: add pedantic mode supportcommon/ common/ include/ | +62 | 0 replies | |
| 7/9 | mcheck: introduce mcheck_on_ramrelocation(.)common/ common/ | +15 | 0 replies | |
| 8/9 | mcheck: add stats, add a comment with test resultscommon/ | +17 | 0 replies | |
| 9/9 | mcheck: let mcheck_abortfunc_t print the pointercommon/ include/ | +9 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/9] mcheck implementation for U-Boot
There was no "mcheck" for U-Boot before.
Since U-Boot has only 1 thread, and normally makes 4000+ - 6000+ mallocs, it's better to use havier canaries to protect heap-chunks. My variant uses 2x8 = 16byte-long protector. And
the multiplier could be changed to tune speed/protection tradeoff. This protects not only against memset()-s, but against "near" wild pointers too, and makes more probable to catch "distant" ones.
The core file of the set is included into the C-file, not complied separately in order to enable (potential) coexisting of mcheck-protectors, e.g. malloc_simple(.) and dlmalloc simultaneously.
My tests were for ARM SoC, 64bit, so the patch is
aware of alignment.
Primary this patch is for using by developers: to verify, if a change doesn't break the heap integrity.
By default the mcheck is disabled and wouldn't affect the boot.
I used pedantic mode, canary=16byte, registry-size=6608. For my system the overhead was 230ms.
I assume, the merge window coming. So I send it now.
Eugene Uriev (9):
mcheck: prepare +1 tier for mcheck-wrappers, in dl-*alloc commands
mcheck: Use memset/memcpy instead of MALLOC_ZERO/MALLOC_COPY for
mcheck.
mcheck: introduce essentials of mcheck
mcheck: integrate mcheck into dlmalloc.c
mcheck: support memalign
mcheck: add pedantic mode support
mcheck: introduce mcheck_on_ramrelocation(.)
mcheck: add stats, add a comment with test results
mcheck: let mcheck_abortfunc_t print the pointer
common/board_f.c | 4 + common/dlmalloc.c | 154 ++++++++++++++++---- common/mcheck_core.inc.h | 304 +++++++++++++++++++++++++++++++++++++++ include/mcheck.h | 51 +++++++ 4 files changed, 488 insertions(+), 25 deletions(-) create mode 100644 common/mcheck_core.inc.h create mode 100644 include/mcheck.h
Signature · 1 line
2.25.1