@aall86
http://www.cs.ucr.edu/~nael/pubs/micro16.pdf
Source Process Victim Process
*
• The attacker could speculate only on *INDIRECT* branches
*
*
IMAGE_DYNAMIC_RELOCATION
typedef struct _IMAGE_DYNAMIC_RELOCATION {
ULONGLONG Symbol; // Contains the static symbol (PTR) value
DWORD BaseRelocSize;
// IMAGE_BASE_RELOCATION BaseRelocations[0];
} IMAGE_DYNAMIC_RELOCATION;
IMAGE_BASE_RELOCATION
typedef struct _IMAGE_BASE_RELOCATION {
DWORD VirtualAddress;
DWORD SizeOfBlock;
} IMAGE_BASE_RELOCATION;
IMAGE_DYNAMIC_RELOCATION
IMAGE_BASE_RELOCATION
typedef struct _IMAGE_IMPORT_CONTROL_TRANSFER_DYNAMIC_RELOCATION {
ULONG PageRelativeOffset : 12;
ULONG IndirectCall : 1; // 1 - the opcode is a CALL
// 0 – the opcode is a JMP
ULONG IATIndex : 19;
} IMAGE_IMPORT_CONTROL_TRANSFER_DYNAMIC_RELOCATION;
typedef struct _IMAGE_INDIR_CONTROL_TRANSFER_DYNAMIC_RELOCATION {
USHORT PageRelativeOffset : 12;
USHORT IndirectCall : 1;
USHORT RexWPrefix : 1;
USHORT CfgCheck : 1;
USHORT Reserved : 1;
} IMAGE_INDIR_CONTROL_TRANSFER_DYNAMIC_RELOCATION;
typedef struct _IMAGE_SWITCHTABLE_BRANCH_DYNAMIC_RELOCATION {
USHORT PageRelativeOffset : 12;
USHORT RegisterNumber : 4;
} IMAGE_SWITCHTABLE_BRANCH_DYNAMIC_RELOCATION;
• PROBLEM
• SOLUTION
• STATUS
▪ CPU hardware speculation control features
▪ Memory Manager Features Settings
Retpoline is applied
Import Optimization applied
a 64-Kbyte VA space
reserves a code page
IMPORTANT:
* Same PFN
// From SYSTEM_INFORMATION_CLASS enumeration
#define SystemSpeculationControlInformation 201
typedef struct _SYSTEM_SPECULATION_CONTROL_INFORMATION {
// ...
ULONG SpecCtrlRetpolineEnabled : 1; // [13]
ULONG SpecCtrlImportOptimizationEnabled : 1; // [14]
} SYSTEM_SPECULATION_CONTROL_INFORMATION;
NtStatus = ZwQuerySystemInformation(SystemSpeculationControlInformation, (PVOID)&SpecCtrl,
sizeof(SYSTEM_SPECULATION_CONTROL_INFORMATION), &dwBytesIo);
Thanks BlueHat
@aall86
andrea.allievi@microsoft.com
www.andrea-allievi.com
:-)

BlueHat v18 || Retpoline - the anti-spectre (type 2) mitigation in windows