Pull to refresh
0
Send message
Есть такая теорема — “two weak make one strong”.
Её доказательство и выводы можно найти в статье
Security Amplification for the Composition of Block Ciphers:
Simpler Proofs and New Results
Не надо трогать MTRR. Достаточно отключить кэширование чтения из памяти конкретной страницы — выбрать для страницы (PTE) PCD =1, или детально разобраться в механизме PAGE ATTRIBUTE TABLE (PAT), (11.5.2 Precedence of Cache Controls).
The PAT allows any memory type to be specified in the page tables, and therefore it is possible to have a single physical page mapped to two or more different linear addresses, each with different memory types.
Рассмотрим ещё раз код атаки:
; rcx = kernel address
; rbx = probe array
retry:
mov al, byte [rcx]
shl rax, 0xc
jz retry
mov rbx, qword [rbx + rax]

Если память по адресу [rcx] кэширована, с высокой вероятностью спекулятивно будут выполнены строки до
mov rbx, qword [rbx + rax]
включительно.
Если память по адресу [rcx] некэширована, произойдёт спекулятивная подкачка кэша, вероятность выполнения указанной выше строки уменьшится.
Но если память по адресу [rcx] некэшируемая, спекулятивное выполнение прервётся на строке
mov al, byte [rcx].

IntelR 64 and IA-32 Architectures
Software Developer's Manual
Volume 3A: System Programming Guide, Part 1
Раздел 11.3 (Таблица 11-2).
Strong Uncacheable (UC) — System memory locations are not cached. All reads and writes appear on the system bus and are executed in program order without reordering. No speculative memory accesses, pagetable walks, or prefetches of speculated branch targets are made.

Храните деньги приватные данные в сберегательной кассе в некэшируемых страницах, и спите спокойно.

Information

Rating
Does not participate
Registered
Activity