kernel/vm: Block non-root teams from inspecting other teams' memory properties.

This commit is contained in:
Augustin Cavalier 2025-01-15 14:54:05 -05:00
parent f3f347f90d
commit 07ed8d0df8

View File

@ -6595,6 +6595,10 @@ _user_get_memory_properties(team_id teamID, const void* address,
if (!IS_USER_ADDRESS(_protected) || !IS_USER_ADDRESS(_lock))
return B_BAD_ADDRESS;
if (teamID != B_CURRENT_TEAM && teamID != team_get_current_team_id()
&& geteuid() != 0)
return B_NOT_ALLOWED;
AddressSpaceReadLocker locker;
status_t error = locker.SetTo(teamID);
if (error != B_OK)