mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Kernel: Remove heuristics for detecting malformed malloc memory access
I never saw these kind of messages in any debug session I had, and it helps us to remove an include to LibC/mallocdefs.h file.
This commit is contained in:
parent
9da09e4fd3
commit
5416a37fde
Notes:
sideshowbarker
2024-07-16 23:35:28 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/5416a37fde Pull-request: https://github.com/SerenityOS/serenity/pull/17634 Reviewed-by: https://github.com/ADKaster
1 changed files with 0 additions and 7 deletions
|
@ -11,7 +11,6 @@
|
|||
#include <Kernel/Arch/SafeMem.h>
|
||||
#include <Kernel/PerformanceManager.h>
|
||||
#include <Kernel/Thread.h>
|
||||
#include <LibC/mallocdefs.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
@ -82,16 +81,10 @@ void PageFault::handle(RegisterState& regs)
|
|||
is_instruction_fetch() ? "instruction fetch / " : "",
|
||||
is_write() ? "write to" : "read from",
|
||||
VirtualAddress(fault_address));
|
||||
constexpr FlatPtr malloc_scrub_pattern = explode_byte(MALLOC_SCRUB_BYTE);
|
||||
constexpr FlatPtr free_scrub_pattern = explode_byte(FREE_SCRUB_BYTE);
|
||||
constexpr FlatPtr kmalloc_scrub_pattern = explode_byte(KMALLOC_SCRUB_BYTE);
|
||||
constexpr FlatPtr kfree_scrub_pattern = explode_byte(KFREE_SCRUB_BYTE);
|
||||
if (response == PageFaultResponse::BusError) {
|
||||
dbgln("Note: Address {} is an access to an undefined memory range of an Inode-backed VMObject", VirtualAddress(fault_address));
|
||||
} else if ((fault_address & 0xffff0000) == (malloc_scrub_pattern & 0xffff0000)) {
|
||||
dbgln("Note: Address {} looks like it may be uninitialized malloc() memory", VirtualAddress(fault_address));
|
||||
} else if ((fault_address & 0xffff0000) == (free_scrub_pattern & 0xffff0000)) {
|
||||
dbgln("Note: Address {} looks like it may be recently free()'d memory", VirtualAddress(fault_address));
|
||||
} else if ((fault_address & 0xffff0000) == (kmalloc_scrub_pattern & 0xffff0000)) {
|
||||
dbgln("Note: Address {} looks like it may be uninitialized kmalloc() memory", VirtualAddress(fault_address));
|
||||
} else if ((fault_address & 0xffff0000) == (kfree_scrub_pattern & 0xffff0000)) {
|
||||
|
|
Loading…
Reference in a new issue