From 321372e3ef2a633c565697bc31a97006537b5e3c Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Tue, 3 Apr 2018 23:44:00 +0200 Subject: [PATCH] kernel: Make size argument to create_area_etc() size_t. It was limited to a uint32 and could for example be overflown by the slab MemoryManager that uses size_t on a 64 bit system. This aligns the signature with create_area() that already uses size_t for the size argument. Note that the function is currently private, so the impact should be limited. --- headers/private/kernel/vm/vm.h | 2 +- src/system/kernel/vm/vm.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/private/kernel/vm/vm.h b/headers/private/kernel/vm/vm.h index ce85089594..9cbf9848e4 100644 --- a/headers/private/kernel/vm/vm.h +++ b/headers/private/kernel/vm/vm.h @@ -76,7 +76,7 @@ void permit_page_faults(void); void forbid_page_faults(void); // private kernel only extension (should be moved somewhere else): -area_id create_area_etc(team_id team, const char *name, uint32 size, +area_id create_area_etc(team_id team, const char *name, size_t size, uint32 lock, uint32 protection, uint32 flags, uint32 guardSize, const virtual_address_restrictions* virtualAddressRestrictions, const physical_address_restrictions* physicalAddressRestrictions, diff --git a/src/system/kernel/vm/vm.cpp b/src/system/kernel/vm/vm.cpp index c3c1fb1123..478a0e5ba7 100644 --- a/src/system/kernel/vm/vm.cpp +++ b/src/system/kernel/vm/vm.cpp @@ -6079,7 +6079,7 @@ clone_area(const char* name, void** _address, uint32 addressSpec, area_id -create_area_etc(team_id team, const char* name, uint32 size, uint32 lock, +create_area_etc(team_id team, const char* name, size_t size, uint32 lock, uint32 protection, uint32 flags, uint32 guardSize, const virtual_address_restrictions* virtualAddressRestrictions, const physical_address_restrictions* physicalAddressRestrictions,