[Kernel/Memory] Check for required protect_bits combinations
This commit is contained in:
parent
6b45cf8447
commit
283accd876
|
@ -425,8 +425,14 @@ DECLARE_XBOXKRNL_EXPORT2(MmQueryAddressProtect, kMemory, kImplemented,
|
|||
|
||||
void MmSetAddressProtect_entry(lpvoid_t base_address, dword_t region_size,
|
||||
dword_t protect_bits) {
|
||||
if (!protect_bits) {
|
||||
XELOGE("MmSetAddressProtect: Failed due to incorrect protect_bits");
|
||||
constexpr uint32_t required_protect_bits =
|
||||
X_PAGE_NOACCESS | X_PAGE_READONLY | X_PAGE_READWRITE |
|
||||
X_PAGE_EXECUTE_READ | X_PAGE_EXECUTE_READWRITE;
|
||||
|
||||
if (xe::bit_count(protect_bits & required_protect_bits) != 1) {
|
||||
// Many titles use invalid combination with zero valid bits set.
|
||||
// We're skipping assertion for these cases to prevent unnecessary spam.
|
||||
assert_false(xe::bit_count(protect_bits & required_protect_bits) > 1);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue