kernel: stop sign-extending batch-map protection and type (#405)

This commit is contained in:
Brandon Strong
2026-08-29 14:46:43 -07:00
committed by GitHub
parent ff61c1cecd
commit 1df53b169f
2 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -3804,8 +3804,8 @@ int KYTY_SYSV_ABI KernelBatchMap2(KernelBatchMapEntry* entries, int num_entries,
LOGF("\t [%d] start = %p, offset = 0x%016" PRIx64 ", length = 0x%016" PRIx64 LOGF("\t [%d] start = %p, offset = 0x%016" PRIx64 ", length = 0x%016" PRIx64
", prot = 0x%02" PRIx32 ", type = 0x%02" PRIx32 ", op = %d\n", ", prot = 0x%02" PRIx32 ", type = 0x%02" PRIx32 ", op = %d\n",
i, entry->start, entry->offset, entry->length, i, entry->start, entry->offset, entry->length,
static_cast<uint32_t>(static_cast<unsigned char>(entry->protection)), static_cast<uint32_t>(entry->protection), static_cast<uint32_t>(entry->type),
static_cast<uint32_t>(static_cast<unsigned char>(entry->type)), entry->operation); entry->operation);
if (entry->length == 0 || entry->operation < MAP_OP_MAP_DIRECT || if (entry->length == 0 || entry->operation < MAP_OP_MAP_DIRECT ||
entry->operation > MAP_OP_TYPE_PROTECT) { entry->operation > MAP_OP_TYPE_PROTECT) {
+7 -7
View File
@@ -47,13 +47,13 @@ struct VirtualQueryInfo {
static_assert(sizeof(VirtualQueryInfo) == 72, "VirtualQueryInfo struct size is incorrect"); static_assert(sizeof(VirtualQueryInfo) == 72, "VirtualQueryInfo struct size is incorrect");
struct KernelBatchMapEntry { struct KernelBatchMapEntry {
void* start; void* start;
uint64_t offset; uint64_t offset;
uint64_t length; uint64_t length;
char protection; unsigned char protection;
char type; unsigned char type;
int16_t reserved; int16_t reserved;
int32_t operation; int32_t operation;
}; };
static_assert(sizeof(KernelBatchMapEntry) == 32, "KernelBatchMapEntry struct size is incorrect"); static_assert(sizeof(KernelBatchMapEntry) == 32, "KernelBatchMapEntry struct size is incorrect");