mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-13 03:29:49 +00:00
Kernel: Unbreak ASLR in the new RegionTree world
Functions that allocate and/or place a Region now take a parameter that tells it whether to randomize unspecified addresses.
This commit is contained in:
parent
e89c9ed2ca
commit
858b196c59
Notes:
sideshowbarker
2024-07-17 14:33:07 +09:00
Author: https://github.com/awesomekling
Commit: 858b196c59
9 changed files with 33 additions and 27 deletions
|
@ -15,6 +15,11 @@
|
|||
|
||||
namespace Kernel::Memory {
|
||||
|
||||
enum class RandomizeVirtualAddress {
|
||||
No,
|
||||
Yes,
|
||||
};
|
||||
|
||||
class RegionTree {
|
||||
AK_MAKE_NONCOPYABLE(RegionTree);
|
||||
AK_MAKE_NONMOVABLE(RegionTree);
|
||||
|
@ -34,7 +39,7 @@ public:
|
|||
|
||||
ErrorOr<NonnullOwnPtr<Region>> allocate_unbacked_anywhere(size_t size, size_t alignment = PAGE_SIZE);
|
||||
|
||||
ErrorOr<void> place_anywhere(Region&, size_t size, size_t alignment = PAGE_SIZE);
|
||||
ErrorOr<void> place_anywhere(Region&, RandomizeVirtualAddress, size_t size, size_t alignment = PAGE_SIZE);
|
||||
ErrorOr<void> place_specifically(Region&, VirtualRange const&);
|
||||
|
||||
ErrorOr<NonnullOwnPtr<Memory::Region>> create_identity_mapped_region(PhysicalAddress, size_t);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue