
Ghidra patch-diff analysis of the IOKit IODMACommand race condition in macOS Tahoe 26.6, with a non-destructive user-space PoC reproducing the stale-state window.
IOKit
IODMACommandRace Condition Analysis and PoC
CVE-2026-43805는 Apple IOKit에서 발생하는 Race Condition 취약점이다.
Apple's official advisory states that an app may be able to cause an unexpected system termination or write to kernel memory. The patched version is macOS Tahoe 26.6, the CVSS is 9.8, and the CWE is 362.
| 구분 | 내용 |
|---|---|
| CVE | CVE-2026-43805 |
| Component | IOKit |
| 취약 버전 | macOS Tahoe 26.5 |
| 패치 버전 | macOS Tahoe 26.6 |
| 취약점 종류 | Race Condition |
| 영향 | Unexpected system termination or kernel memory write |
To state the analysis result first, the lock that was missing in IODMACommand::PerformOperation_Impl was added in the patched version.
PrepareForDMA_Impl and CompleteDMA_Impl had already been using the same lock, but only PerformOperation_Impl was not using a lock in the section where it checks and uses shared state. In Tahoe 26.6, this section was changed to be protected by a lock and to re-check the state after acquiring the lock.
Initially, I compared the Kernel Collections of Sequoia 15.7.7 and 15.7.8, but some of the core IOKit implementations are included not in individual KEXTs but in the XNU kernel itself. Also, since a published analysis mentioned changes to IODMACommand between Tahoe 26.5 and 26.6, I set the Tahoe KDK as the final analysis target.
I obtained the following two KDKs using ipsw.
| Version | Build | kernel SHA-256 |
|---|---|---|
| Tahoe 26.5 | 25F71 | f4dcaa7e59ae59f3d945c2332862772596b71e9823cc202983ba4f9d897b5bec |
| Tahoe 26.6 | 25G70 | 754db65cb15599183ccebfaa2e4909f673de5d7da42ba4293256cb1184587efd |
I extracted KernelDebugKit.pkg from the downloaded DMG, and obtained kernel and kernel.development from the internal Payload. Both files are x86_64 Mach-O, so they could be compared directly in Ghidra.
I loaded the kernel of 26.5 and 26.6 into Ghidra respectively, ran automatic analysis, and then matched the same functions using Version Tracking.
The functions finally confirmed here are the following three.
IODMACommand::PrepareForDMA_ImplIODMACommand::PerformOperation_ImplIODMACommand::CompleteDMA_ImplFirst, comparing PerformOperation_Impl, the vulnerable version checks the shared state and then performs memory-related operations, but there is no lock protecting that section.
if (*(int *)(this + 0x68) == 0) {
result = 0xe00002d8;
} else {
// 메모리 관련 작업 수행
}
In the patched version, lock acquisition and release were added as follows.
IOLockLock(lock);
if (*(int *)(this + 0x68) == 0) {
result = 0xe00002d8;
} else {
// 기존 메모리 관련 작업 수행
}
IOLockUnlock(lock);
In the actual 26.6 disassembly as well, we confirmed the flow that checks the state of this + 0x68 after the _lck_mtx_lock call, and calls _lck_mtx_unlock on the path where the work finishes.
Next, we also examined PrepareForDMA_Impl and CompleteDMA_Impl. Both functions were using the lock of the same object in both 26.5 and 26.6.
| Function | Tahoe 26.5 | Tahoe 26.6 |
|---|---|---|
PrepareForDMA_Impl | Uses lock | Uses lock |
PerformOperation_Impl | Lock missing | Lock added and state re-checked |
CompleteDMA_Impl | Uses lock | Uses lock |
What matters in a race condition is that multiple threads can access the same state and memory simultaneously.
In the vulnerable version, roughly the following flow is possible.
PerformOperation_Impl whether DMA is active.CompleteDMA_Impl and changes the DMA state or cleans up memory.In other words, CompleteDMA_Impl can interleave between the state check in PerformOperation_Impl and the actual use.
After the patch, PerformOperation_Impl also uses the same lock as PrepareForDMA_Impl and CompleteDMA_Impl. And after acquiring the lock, it re-checks the state of this + 0x68. This prevents other threads from changing the same state from the state check through to the memory use.
This part also matches the improved state handling mentioned in Apple's advisory.
Instead of an exploit that actually corrupts kernel memory, we reproduced the race condition identified in the analysis in user space.
In the PoC, Thread A plays the role of PerformOperation_Impl and Thread B plays the role of CompleteDMA_Impl. Using std::promise and std::future, we aligned the execution order so that Thread B invalidates the memory immediately after Thread A checks the state.
You can build and run it as follows.
make -C poc
./poc/race_model
The execution result is as follows.
[before] active_at_check=true memory_valid_at_use=false -> STALE STATE OBSERVED
[after ] active_at_check=true memory_valid_at_use=true -> ACCESS PROTECTED
In before, after Thread A checks the active state, Thread B can invalidate the memory. So active_at_check=true, but at the actual point of use memory_valid_at_use=false, and the situation of using stale state is reproduced.
In after, the two threads use the same mutex. Because Thread B cannot change the state while Thread A checks the state and uses the memory, ACCESS PROTECTED is printed.
As a result, it was confirmed that a Race Condition can occur if there is no synchronization between the check and use of shared state, and that protecting that section with the same lock can prevent it.
The PoC code is in poc/race_model.cpp.
This is not an exploit that actually calls IODMACommand to cause a kernel crash or kernel memory write; it is a PoC that compares a version with an added state re-check for lock/unlock, due to the absence of a lock in that section, against a version without it.