mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 20:42:43 +00:00 
			
		
		
		
	Kernel: Return proper errno codes from Coredump::write_regions method
This commit is contained in:
		
							parent
							
								
									2d1719da73
								
							
						
					
					
						commit
						df72c9327b
					
				
					 1 changed files with 8 additions and 4 deletions
				
			
		|  | @ -228,11 +228,15 @@ ErrorOr<void> Coredump::write_regions() | ||||||
|         TRY(m_process->address_space().with([&](auto& space) -> ErrorOr<void> { |         TRY(m_process->address_space().with([&](auto& space) -> ErrorOr<void> { | ||||||
|             auto* real_region = space->region_tree().regions().find(region.vaddr().get()); |             auto* real_region = space->region_tree().regions().find(region.vaddr().get()); | ||||||
| 
 | 
 | ||||||
|             if (!real_region) |             if (!real_region) { | ||||||
|                 return Error::from_string_view("Failed to find matching region in the process"sv); |                 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)) |             if (!region.is_consistent_with_region(*real_region)) { | ||||||
|                 return Error::from_string_view("Found region does not match stored metadata"sv); |                 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 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()) |             if (!real_region->is_mapped()) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Liav A
						Liav A