mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-26 20:12:44 +00:00
livedump: Silence KASAN and KMSAN when livedumping
The livedumper triggers reports from both of these sanitizers since it necessarily accesses uninitialized or freed memory. Add a flag to silence reports from both sanitizers. Reviewed by: mhorne, khng MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D47714
This commit is contained in:
parent
e9fa399180
commit
37cef00192
@ -133,8 +133,10 @@ livedump_start_vnode(struct vnode *vp, int flags, uint8_t compression)
|
||||
if (error != 0)
|
||||
goto out;
|
||||
|
||||
curthread->td_pflags2 |= TDP2_SAN_QUIET;
|
||||
dump_savectx();
|
||||
error = minidumpsys(livedi, true);
|
||||
curthread->td_pflags2 &= ~TDP2_SAN_QUIET;
|
||||
|
||||
EVENTHANDLER_INVOKE(livedumper_finish);
|
||||
out:
|
||||
|
@ -405,6 +405,9 @@ kasan_shadow_check(unsigned long addr, size_t size, bool write,
|
||||
|
||||
if (__predict_false(!kasan_enabled))
|
||||
return;
|
||||
if (__predict_false(curthread != NULL &&
|
||||
(curthread->td_pflags2 & TDP2_SAN_QUIET) != 0))
|
||||
return;
|
||||
if (__predict_false(size == 0))
|
||||
return;
|
||||
if (__predict_false(kasan_md_unsupported(addr)))
|
||||
|
@ -179,6 +179,9 @@ kmsan_report_hook(const void *addr, msan_orig_t *orig, size_t size, size_t off,
|
||||
|
||||
if (__predict_false(KERNEL_PANICKED() || kdb_active || kmsan_reporting))
|
||||
return;
|
||||
if (__predict_false(curthread != NULL &&
|
||||
(curthread->td_pflags2 & TDP2_SAN_QUIET) != 0))
|
||||
return;
|
||||
|
||||
kmsan_reporting = true;
|
||||
__compiler_membar();
|
||||
@ -232,6 +235,9 @@ kmsan_report_inline(msan_orig_t orig, unsigned long pc)
|
||||
|
||||
if (__predict_false(KERNEL_PANICKED() || kdb_active || kmsan_reporting))
|
||||
return;
|
||||
if (__predict_false(curthread != NULL &&
|
||||
(curthread->td_pflags2 & TDP2_SAN_QUIET) != 0))
|
||||
return;
|
||||
|
||||
kmsan_reporting = true;
|
||||
__compiler_membar();
|
||||
|
@ -567,6 +567,7 @@ enum {
|
||||
#define TDP2_SBPAGES 0x00000001 /* Owns sbusy on some pages */
|
||||
#define TDP2_COMPAT32RB 0x00000002 /* compat32 ABI for robust lists */
|
||||
#define TDP2_ACCT 0x00000004 /* Doing accounting */
|
||||
#define TDP2_SAN_QUIET 0x00000008 /* Disable warnings from K(A|M)SAN */
|
||||
|
||||
/*
|
||||
* Reasons that the current thread can not be run yet.
|
||||
|
Loading…
Reference in New Issue
Block a user