diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-09-01 09:23:10 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-09-01 09:23:10 +0200 |
| commit | e757bb6a90c98f53995e4828d68eba26a2327540 (patch) | |
| tree | feabdd3047b67f21ee0e6f76ccd89f8458493e77 /dev/ZKA/Sources | |
| parent | 21a0081ac9d9a8abe66cc6a248b5363768de1dc9 (diff) | |
[ IMP ] Found out the issue of ring 3 switch.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/ZKA/Sources')
| -rw-r--r-- | dev/ZKA/Sources/Heap.cxx | 9 | ||||
| -rw-r--r-- | dev/ZKA/Sources/Network/IPC.cxx | 6 | ||||
| -rw-r--r-- | dev/ZKA/Sources/PageManager.cxx | 3 |
3 files changed, 13 insertions, 5 deletions
diff --git a/dev/ZKA/Sources/Heap.cxx b/dev/ZKA/Sources/Heap.cxx index a89ed584..0146bd55 100644 --- a/dev/ZKA/Sources/Heap.cxx +++ b/dev/ZKA/Sources/Heap.cxx @@ -34,6 +34,8 @@ namespace Kernel UInt32 fMagic; ///! @brief Boolean value which tells if the heap is allocated. Boolean fPresent; + /// @brief Is this valued owned by the user? + Boolean fUserOwned; ///! @brief 32-bit CRC checksum. UInt32 fCRC32; /// @brief 64-bit pointer size. @@ -108,6 +110,8 @@ namespace Kernel heap_info_ptr->fCRC32 = 0U; // dont fill it for now. heap_info_ptr->fTargetPtr = wrapper.VirtualAddress() + sizeof(Detail::HEAP_INFORMATION_BLOCK); heap_info_ptr->fPagePtr = 0UL; + heap_info_ptr->fUserOwned = user; + heap_info_ptr->fPresent = true; ++kHeapCount; @@ -176,7 +180,10 @@ namespace Kernel ke_calculate_crc32((Char*)heapInfoBlk->fTargetPtr, heapInfoBlk->fTargetPtrSize)) { - ke_stop(RUNTIME_CHECK_POINTER); + if (!heapInfoBlk->fUserOwned) + { + ke_stop(RUNTIME_CHECK_POINTER); + } } } diff --git a/dev/ZKA/Sources/Network/IPC.cxx b/dev/ZKA/Sources/Network/IPC.cxx index e5926c7f..e60742ca 100644 --- a/dev/ZKA/Sources/Network/IPC.cxx +++ b/dev/ZKA/Sources/Network/IPC.cxx @@ -41,12 +41,12 @@ Bool ipc_int_sanitize_packet(IPC_MESSAGE_STRUCT* pckt) } if (pckt->IpcFrom == pckt->IpcTo || - pckt->IpcPacketSize > cIPCEPMsgSize) + pckt->IpcPacketSize > cXPCOMMsgSize) { goto ipc_check_failed; } - return pckt->IpcPacketSize > 1 && pckt->IpcHeaderMagic == cIPCEPHeaderMagic; + return pckt->IpcPacketSize > 1 && pckt->IpcHeaderMagic == cXPCOMHeaderMagic; ipc_check_failed: ErrLocal() = kErrorIPC; @@ -92,7 +92,7 @@ namespace Kernel if (*pckt_in) { - (*pckt_in)->IpcHeaderMagic = cIPCEPHeaderMagic; + (*pckt_in)->IpcHeaderMagic = cXPCOMHeaderMagic; auto endian = DEDUCE_ENDIAN((*pckt_in), ((Char*)(*pckt_in))[0]); diff --git a/dev/ZKA/Sources/PageManager.cxx b/dev/ZKA/Sources/PageManager.cxx index 549415f3..d14130ff 100644 --- a/dev/ZKA/Sources/PageManager.cxx +++ b/dev/ZKA/Sources/PageManager.cxx @@ -82,8 +82,9 @@ namespace Kernel { if (wrapper) { - if (!Detail::page_disable(wrapper->VirtualAddress())) + if (!Kernel::HAL::hal_free_page((VoidPtr)wrapper->VirtualAddress())) return false; + return true; } |
