Meltdown-BND¶
Meltdown-BR'ın MPX
bnd-instruction (bndcl/bndcu) yaprağı: bir hardware bounds check #BR yükselttikten sonra ama exception handle edilmeden önceki window'da out-of-bounds data'yı transient olarak sızdırır — branch prediction'ın devreye girmediği Meltdown-type bir bounds-check bypass.
Mechanism¶
Neden çalışır
Intel Memory Protection eXtensions (MPX), bndcl (check lower) ve
bndcu/bndcn (check upper) instruction'ları aracılığıyla hardware array
bounds-checking sağlar. Bir index aralık dışındayken, bu instruction'lar
architectural olarak bir bound-range-exceeded exception (#BR) yükseltir.
Meltdown-BND, Canella et al. taxonomy'sinde Meltdown-BR'ın
MPX'e özgü örneklenmesidir (bnd yaprağı). Invariant'ı her Meltdown-type
etkiyle aynıdır: #BR exception lazy biçimde handle edilir. bndcl/bndcu
ihlali tespit ettikten sonra CPU, fault retire olup onları squash etmeden önce
out-of-bounds data'yı okuyup encode eden dependent instruction'ları yine de
transient olarak çalıştırır.
Kritik olarak bu bir Spectre saldırısı değildir. Yazarlar, Oleksenko et
al.'a göre "ne bndcl ne de bndcu branch predictor üzerinde baskı uygular,
bu da hiçbir prediction olmadığına işaret eder" diye belirtir. Mistrain edilmiş
bir predictor yoktur — leak tamamen gecikmeli exception handling'ten gelir, bu
yüzden Spectre-PHT yerine Meltdown-type olarak sınıflandırılır.
Walkthrough¶
Out-of-bounds element'in transient olarak okunup bir Flush+Reload oracle'ına encode edildiği, bounds-checked bir array access:
// Conceptual Meltdown-BND (MPX). Real PoCs: https://transient.fail/
// 'index' is out of bounds for 'data'; MPX bndcl/bndcu will raise #BR.
__builtin_ia32_bndcl(data, &data[index]); // lower-bound check -> #BR if OOB
__builtin_ia32_bndcu(data, &data[index]); // upper-bound check -> #BR if OOB
// transiently, before #BR retires:
uint8_t secret = data[index]; // out-of-bounds read
(void)probe[secret * 4096]; // encode into cache state
// decode: time probe[i*4096]; fastest line index == leaked secret byte
- Bound check'i tetikle:
bndcl/bndcuile out-of-bounds bir index üzerinde. - Transient olarak oku + encode et: out-of-bounds byte'ı, pre-#BR window sırasında 256-entry'lik bir probe array'e (herhangi bir Meltdown saldırısındaki gibi exception'ı handle et/bastır).
- Flush+Reload ile decode et — cache'lenmiş probe line, sızdırılan byte'ı ortaya çıkarır.
Test edilen CPU'lar (Canella et al.'dan)
Meltdown-BND (bnd / MPX) confirmed even on fully patched systems:
- Intel i5-6200U (Skylake, MPX)
- Intel i7-8700K (Coffee Lake)
- Intel i7-8565U (Whiskey Lake)
Authors' result: current Meltdown mitigations only block attacks that cross
the current privilege level — Meltdown-BND (same privilege) still worked.
Warning
Meltdown-BND mevcut privilege level içinde kaldığı için, cross-privilege Meltdown-US'i hedefleyen KPTI/KAISER bunu durdurmaz. Paper, açıkça tamamen yamalı makinelerde hâlâ çalıştığını raporlar.
Detection¶
Güvenilir bir victim tarafı sinyali yok; read hiçbir architectural iz bırakmaz.
Static analysis, bir serializing barrier olmadan attacker'ın etkilediği
out-of-bounds access'lerin izlediği MPX bndcl/bndcu noktalarını işaretleyebilir.
Mitigation¶
- Bound check'ten sonra serializing barrier. Dong et al., MPX bounds-check
instruction'larından sonra bir
lfenceönerir; Canella et al., bir bounds check'ten sonra serializing instruction'larla bile, TLB üzerinden tek bir memory access aracılığıyla Intel ve ARM'da hâlâ sızdırabildiklerini belirtir, yani barrier'lar yalnızca kısmi bir fix'tir. - Güvenlik izolasyonu için MPX'e güvenmekten kaçın. Intel MPX o zamandan beri
deprecate edildi;
bndcl/bndcu'yu transient-execution-safe bir sınır olarak görmeyin.
References¶
- A Systematic Evaluation of Transient Execution Attacks and Defenses (Canella et al., USENIX Security 2019)
- arXiv:1811.05441 — A Systematic Evaluation of Transient Execution Attacks and Defenses
- Intel MPX Explained: A Cross-layer Analysis of the Intel MPX System Stack (Oleksenko et al., ACM POMACS 2018)
- transient.fail — classification tree and proofs-of-concept