mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
Kernel: Return proper errno codes from Coredump::write_regions method
This commit is contained in:
parent
2d1719da73
commit
df72c9327b
Notes:
sideshowbarker
2024-07-17 05:41:34 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/df72c9327b Pull-request: https://github.com/SerenityOS/serenity/pull/17308 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/linusg
@ -228,11 +228,15 @@ ErrorOr<void> Coredump::write_regions()
|
||||
TRY(m_process->address_space().with([&](auto& space) -> ErrorOr<void> {
|
||||
auto* real_region = space->region_tree().regions().find(region.vaddr().get());
|
||||
|
||||
if (!real_region)
|
||||
return Error::from_string_view("Failed to find matching region in the process"sv);
|
||||
if (!real_region) {
|
||||
dmesgln("Coredump::write_regions: Failed to find matching region in the process");
|
||||
return Error::from_errno(EFAULT);
|
||||
}
|
||||
|
||||
if (!region.is_consistent_with_region(*real_region))
|
||||
return Error::from_string_view("Found region does not match stored metadata"sv);
|
||||
if (!region.is_consistent_with_region(*real_region)) {
|
||||
dmesgln("Coredump::write_regions: Found region does not match stored metadata");
|
||||
return Error::from_errno(EINVAL);
|
||||
}
|
||||
|
||||
// If we crashed in the middle of mapping in Regions, they do not have a page directory yet, and will crash on a remap() call
|
||||
if (!real_region->is_mapped())
|
||||
|
Loading…
Reference in New Issue
Block a user