mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-16 13:34:30 +00:00
um: set DONTDUMP and DONTFORK flags on KASAN shadow memory
There is no point in either dumping the KASAN shadow memory or doing copy-on-write after a fork on these memory regions. This considerably speeds up coredump generation. Signed-off-by: Benjamin Berg <benjamin.berg@intel.com> Link: https://patch.msgid.link/20241103150506.1367695-1-benjamin@sipsolutions.net Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
81e0679d85
commit
fce0128863
@ -39,6 +39,18 @@ void kasan_map_memory(void *start, size_t len)
|
||||
strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (madvise(start, len, MADV_DONTDUMP)) {
|
||||
os_info("Couldn't set MAD_DONTDUMP on shadow memory: %s\n.",
|
||||
strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (madvise(start, len, MADV_DONTFORK)) {
|
||||
os_info("Couldn't set MADV_DONTFORK on shadow memory: %s\n.",
|
||||
strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Set by make_tempfile() during early boot. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user