ASELSANMicrokernel
GELİŞTİRME GÜNLÜĞÜ

M6 — Gerçek IPC

M6 audit · 10/10
End-to-end EL0 IPC — Call/Reply/Recv tam çalışıyor
3 kritik silent bug + 3 security gap + 3 cleanup + 1 race-not'u. Hepsi kapatıldı.
M6.1 · M6.3 · M6.4 ✅
🔴 Silent bug (3)
  • SYS_IPC_RECV/REPLY const tanımlı değildi → Rust match arm bare ident = variable binding (catch-all); SYS_IPC_REPLY unreachable, her syscall RECV'e düşüyordu
  • is_receive_on_own sadece registry-id kontrol ediyordu → Client'ın Server'a CALL'u kendi endpoint'imde RECV path'ine düşüp pending olmadığı için block
  • deliver_message_and_wake register layout SYS_IPC_RECV ile uyumsuzdu (x0=label, status değil); Server "recv HATA" deyip exit ediyordu
🟡 Security gap (3)
  • #4 RECV ownership — registry fallback'i artık owner=0 (shared) veya owner=current_id şartına bağlı; aksi RECV REJECTED
  • #6 CALL ownership — aynı kural CALL'a uygulandı; başka task'in private endpoint'ine CALL artık InvalidCapability
  • #8 REPLY validation — reply_cap'in is_reply_cap=true olduğunu doğrular; normal endpoint'i reply olarak kullanmak engellendi
🟢 Cleanup + API (3)
  • #5 explicit APImint_reply_endpoint(owner); magic badge inference (0xCAFE/0xC0DE/0xCAFE_BABE) kaldırıldı, Endpoint::owner field eklendi
  • #7 revoke drain — endpoint revoke'ta pending_messages drain + bloke task'ler uyandırılıyor (memory leak kapatıldı)
  • #9 race not'u — SVC trap DAIF.{I,F}=1 otomatik mask + single-core → şu an race yok; multi-core için per-CPU lock notu
QEMU çıktısı — tam round-trip kanıtı
[M6.4] IPC Server + Client EL0 user task'leri spawn edildi (ep arg=8) [IPC-Server] recv loop basliyor [M6.4] SYS_IPC_RECV task=7 ep=8 [M6.4] RECV pending yok → task block (is_call=false) [IPC-Client] CALL gonderiliyor [M7] SYS_IPC_CALL task=8 → target=8, label=0xabcd [M7] CALL: Client reply_cap=12 üzerinde bloke oluyor [IPC-Server] mesaj alindi, echo+1 ile reply gonderiliyor [M6.4] SYS_IPC_REPLY task=7 reply_cap=12 label=0xabcd [M6.4] REPLY delivered=true reply_cap revoke edildi (one-shot) [IPC-Client] reply DOGRU (echo+1) - hedef ile esleshme PASS    ← 1/3 [IPC-Client] reply DOGRU (echo+1) - hedef ile esleshme PASS    ← 2/3 [IPC-Client] reply DOGRU (echo+1) - hedef ile esleshme PASS    ← 3/3 [IPC-Client] 3 cagri tamam, exit [M4.3-DEBUG] task_exit() called → name='IPC-Server' id=7 is_user=true state=Dead [M4.3-DEBUG] task_exit() called → name='IPC-Client' id=8 is_user=true state=Dead
Niye bu büyük
EL0 ↔ EL0 IPC tam aktif
İki ayrı user task kernel'ın aracılığıyla mesajlaşıyor: CALL → block → RECV pickup → REPLY → wake → verify. seL4-tarzı senkron Call/Reply semantiği.
Cap hijack kapatıldı
Önce başka task'in private endpoint'ine CALL/RECV yapılabiliyordu (registry fallback silent backdoor). Owner kontrolüyle gerçek capability semantiği.
Match arm tuzağı
Rust'ta SYS_IPC_RECV => { ... } const yoksa her şeyi yakalayan binding olur. Compiler "unreachable pattern" warning'i veriyordu ama davranış sessiz bozuk. Klasik audit kazancı.