å··ã§ã¯Intel, AMD, ARMãå·»ãè¾¼ãã CPUã®ãã° "Meltdown", "Spectre" ã話é¡ã§ãã ãããã®åé¡ãå 容ãèªã¿é²ãã¦ããã¨ãã³ã³ãã¥ã¼ã¿ã¢ã¼ããã¯ãã£ã«ãããéè¦ãªè¦ç´ ãå¤ãå«ãã§ãããã¨ãåãã£ã¦æ¥ã¾ããã
ã¤ã¾ãããã®CPUã®ã»ãã¥ãªãã£åé¡ãèªã¿è§£ãã¦ããã¨ç¾ä»£ã®ãã¤ã¯ãããã»ããµãæã¤ãæ§è½åä¸ã®ããã®ãããªãæ©è½è¿½å ã®ä¸ç«¯ãè¦ãã¦ããã®ã§ã¯ãªããã¨æããGoogle, Intelã®æç®ãèªã¿è§£ãã¦ã¿ããã¨ã«ãã¾ããã
ããç§ã¯ã»ãã¥ãªãã£ã®å°é家ã§ã¯ããã¾ããããéå»ã«ãã¹ã¯ãããPCåãã®ãããªå¤§è¦æ¨¡ãªCPUè¨è¨ã«åå ãããã¨ãããã¾ããã ããã¾ã§ã³ã³ãã¥ã¼ã¿ã¢ã¼ããã¯ãã£ã«æ¯è¼çè¿ãå ´æã«ãã人éã¨ãã¦ããã®åé¡ã®æ¬è³ªã¯ã©ãã«ããã®ããå¯è½ãªéãèªã¿è§£ãã¦ãããç¾ä»£ã®ãã¤ã¯ãããã»ããµãæã¤é«æ§è½ãã¤é«æ©è½ãªå é¨å®è£ ã«ã¤ãã¦è§£ãæããã¦ããããã¨æãã¾ãã
ã¨åãããªãã¨ãæ¸ãã¾ããããç§èªèº«æ¬è³ªçãªã¨ããã®ç解ã¯ã¾ã åãã§ãã¾ããã 3ã¤ã®åé¡ãããã¨æ¸ãã¦ããã¾ããããããå ¨é¨æ ¹æ¬çãªåå ã¯åãã«è¦ããããæ¦å¿µçãªã¨ããã§ããç解ãåãã§ããªãã®ãæããã
åèæç®
Intel Analysis of Speculative Execution Side Channels
Reading privileged memory with a side-channel
https://googleprojectzero.blogspot.jp/2018/01/reading-privileged-memory-with-side.html
ç¨èªé
Googleã»ãã¥ãªãã£ãã¼ã ã®ããã°ã«ã¯ãç¨èªéã¨ãã¦CPUã®é常ã«éè¦ãªæè¡ã«ã¤ãã¦ã®è§£èª¬ãç°¡åã«æ¸ãã¦ããã ããããã¡ãã¨ç解ããããã«ã¯ãç¾ä»£ã®CPUãå®è£ ãã¦ããã¢ã¦ããªããªã¼ãå®è¡æè¡ã¨ä»®æ³åã»ãã£ãã·ã¥ã¡ã¢ãªã®ã¬ã¤ãã³ã·ã«ã¤ãã¦ãã¡ãã¨ç解ããå¿ è¦ãããã
- ææ©å®è¡
- ãªã¿ã¤ã¢
An instruction retires when its results, e.g. register writes and memory writes, are committed and made visible to the rest of the system. Instructions can be executed out of order, but must always retire in order. (åæãã)
ç¾ä»£ã®ã¢ã¦ããªããªã¼ãããã»ããµã¯é度ãªææ©å®è¡ãè¡ãããããã®ææ©å®è¡ãè¡ã£ãå½ä»¤ãæ¬å½ã«ãæ£ãããå½ä»¤ã§ãããã©ããã確èªããå¿ è¦ãããã
ã¢ã¦ããªããªã¼ãå®è¡ã«ããå¤é¨ã¡ã¢ãªã¢ã¯ã»ã¹ãè¨ç®ã«æéã®ãããå½ä»¤ã®ã¬ã¤ãã³ã·ãé è½ããããã«ãé·ãå½ä»¤ã¨ç¡é¢ä¿ãªå½ä»¤ã¯é åºãé転ãã¦å ã«å®è¡ãããã ç¹ã«æ¡ä»¶åå²å½ä»¤ãªã©ã¯ãæ¡ä»¶ãTrueãFalseããåãããããã«åå²å ã¢ãã¬ã¹ã決å®ãããã¾ã§ã«ãã¤ãã©ã¤ã³ä¸ãä½æ®µãééããå¿ è¦ããããåå²å½ä»¤ã®å¾ç¶ã®å½ä»¤ã¯æ¡ä»¶æ¬¡ç¬¬ã§å®è¡ãã¹ãã§ãã£ããããã§ãªãã£ããããã
å¾ã£ã¦ãã¢ã¦ããªããªã¼ãããã»ããµã§ã¯ãå½ä»¤ã®çºè¡ã¯å½ä»¤ã®é åºãå ¥ãæ¿ãã¦ãè¯ããããªãªã¼ããããã¡ãªã©ã®æ¹å¼ãç¨ãã¦æçµçã«ã¯å½ä»¤ã®é çªãããã°ã©ã ã©ããã«æ»ãã åå²å½ä»¤ãããå¾ç¶ã®å½ä»¤ããåå²å½ä»¤ãããå ã«è¨ç®ãçµäºããã¨ãã¦ãããã®çµæã¯ããã°ã©ã ã¨ãã¦ã¯ç¢ºå®ã«å¼µããªãããªãªã¼ããããã¡ã«æºãè¾¼ã¾ããåã®å½ä»¤(æ¡ä»¶åå²å½ä»¤)ã®çµæã確å®ãããã¨ããã£ã¦ãã®å½ä»¤ãæå¹ãã©ããã決å®ããããã®ã¹ãã¼ã¸ã§ãå½ä»¤ãã³ãããããããã¨ããã®å½ä»¤ãå®è¡ããããã¨ã確å®ãããªãªã¼ããããã¡ããã¬ã¸ã¹ã¿ãã¡ã¤ã«ã¸ã®ãã¼ã¿æ¸ãæ»ããªã©ã®ç¢ºå®å¦çãè¡ããããããã§ãªããã°ããã®å½ä»¤ã¯ãªãªã¼ããããã¡ãããç ´æ£ããããã
ãã®ã¨ããã³ããããããå½ä»¤ã¯å½ä»¤ã®å®è¡ã確å®ããã¨ãã¦ãæå¾ã®æ¸ãæ»ãå¦çãè¡ã£ã¦ããªã¿ã¤ã¢ããããã
ãªãªã¼ããããã¡ã«ã¤ãã¦ã¯ç§ã®ããã°ã§ãè¨åãã¦ããã
æ¡å¤§ç»å 011l | ãªãªã¼ããããã¡ã«ãããªãã¼ã æ¹å¼ | ãã¤ãããã¥ã¼ã¹ via kwout
ã¡ãªã¿ã«ä¸è¨ã®è§£èª¬è¨äºã«ãåºã¦ãããããã¼ãå½ä»¤ã¯ææ©å®è¡ãè¡ã£ã¦ãè¯ãããããã¹ãã¢å½ä»¤ã¯ãã¡ã ã ä½æ ãã¨ããã¨ããã¼ãå½ä»¤ã¯ãã¼ãå¤ãã¬ã¸ã¹ã¿ãã¡ã¤ã«ã«æ¸ãè¾¼ãåã«ãªãªã¼ããããã¡ãªã©ã«æ ¼ç´ãã¦ãç ´æ£ããããã¨ãã§ããå¯è½æ§ãæ®ãã¦ããããã¹ãã¢å½ä»¤ã¯çºè¡ãã¦ãã¾ãã¨ã¡ã¢ãªã®ç¶æ ãå¤ãã¦ãã¾ããããç ´æ£ãããã¨ãåºæ¥ãªããªããå¾ã£ã¦ããã¼ãå½ä»¤ã®ã¿ææ©å®è¡ãè¡ãããã¹ãã¢å½ä»¤ã¯ææ©å®è¡ãããªãã¨ããã®ãåºæ¬ã ã
- è«çããã»ããµã³ã¢
A logical processor core is what the operating system sees as a processor core. With hyperthreading enabled, the number of logical cores is a multiple of the number of physical cores. (åæãã)
ãããããã«ãã¹ã¬ããã£ã³ã°ããã¤ãã¼ã¹ã¬ããã£ã³ã°ã®æè¡ã§ããã ç©ççãªã³ã¢æ°ãããå¤ãã®ã³ã¢ããªãã¬ã¼ãã£ã³ã°ã·ã¹ãã ããã¯è¦ããããã«ãªã£ã¦ããããã¤ãã©ã¤ã³ä¸ã«è¤æ°ã®ããã»ã¹ãå®è¡ãããã
1ããã»ã¹ã§ã¯ãã¤ãã©ã¤ã³ãåãããã¨ãå³ãããããªããã°ã©ã ã§ããç¬ç«ããè¤æ°ã®ããã»ã¹ãåæã«ãã¤ãã©ã¤ã³ä¸ã«æåå²ã§æµããã¨ã«ããããã¤ãã©ã¤ã³ãå¹ççã«æ´»ç¨ãããã¨ãåºæ¥ãã
- ãã£ãã·ã¥ãã¼ã¿ã»ã¢ã³ãã£ãã·ã¥ãã¼ã¿
In this blogpost, "uncached" data is data that is only present in main memory, not in any of the cache levels of the CPU. Loading uncached data will typically take over 100 cycles of CPU time. (åæãã)
çµã¿è¾¼ã¿æ¥çã ãã®è©±ãã¨æã£ããããã§ããªãã
ä¸è¬çã«ãªã¢ã«ã¿ã¤ã ãã¼ã¿ãå¶å¾¡ãã¼ã¿ãªã©ã®ã¿ã¤ã ã¯ãªãã£ã«ã«ãªãã¼ã¿ã¯ããã£ãã·ã¥ã«å ¥ãã¦ãã¾ãã¨å®éã«ã³ã¢ã®å¤ã®ãã¹ã«æµããã®ããã¤ã«ãªãã®ãåãããªããããã¢ã³ãã£ãã·ã¥ãªãã¼ã¿ã¨ãã¦ã¬ã¸ã¹ã¿ã«æã£ã¦ããããã¬ã¸ã¹ã¿ããã¹ãã¢ããã
ãã®ãããªã¢ã³ãã£ãã·ã¥ãªãã¼ã¿ã¯ãã£ãã·ã¥ãæ±ããã¨ããªãã¨ããã®ã1ã¤ã®å©ç¹ã§ãããã¾ãããã«ã³ã¢å¤ã®ãã¹ã¾ã§åºã¦è¡ãã®ã§ã¿ã¤ãã³ã°ã¯ãªãã£ã«ã«ãªå¶å¾¡ä¿¡å·ãªã©ãæµãã®ã«ä½¿ãããã
- ãã¹ãã¬ãã£ã¯ã·ã§ã³ã¦ã£ã³ãã¦
The time window during which the CPU speculatively executes the wrong code and has not yet detected that mis-speculation has occurred.
ä¸è¨ã®ææ©å®è¡ã§ã¯ãåå²äºæ¸¬ãå®äºããã¾ã§ã¨ãããã次ã®å½ä»¤ããã§ãããã¦çºè¡ãç¶ããããå®éã«ã¯ãããã®å½ä»¤ã¯æ¡ä»¶åå²äºæ¸¬ãå¤ãããã¨ã«ããç ´æ£ããããããããªãã
ãã¹ãã¬ãã£ã¯ã·ã§ã³ã¦ã£ã³ãã¦ã¯ããã®æ¡ä»¶åå²å½ä»¤ã«ããã¦åå²äºæ¸¬ã«å¤±æãããã¨ã§ãã©ããããã®å¾ç¶ã®å½ä»¤ãçºè¡ããããã示ãã¦ããããã®ã¦ã£ã³ãã¦ã大ããã»ã©å¤ãã®å½ä»¤ãç ´æ£ãããã
é常ã®ã¬ã¸ã¹ã¿æ¯è¼ã®å½ä»¤ã§ã¯ã¬ã¸ã¹ã¿ãªã¼ããã¦ããæ¯è¼ããã ãã®ããããã®ã¦ã£ã³ãã¦ã¯æ¯è¼çå°ããã¨æãããããä¾ãã°ã¤ã³ãã¤ã¬ã¯ãã¸ã£ã³ãå½ä»¤(ã¬ã¸ã¹ã¿éæ¥åå²)ã®å ´åã§ãã¿ã¼ã²ããã®ã¬ã¸ã¹ã¿ãå¤é¨ã®é ãã¡ã¢ãªãããã¼ããã¦ããå ´åã¯ã¢ãã¬ã¹ç¢ºå®ã¾ã§ããªãæéããããã åå²ã®æç«ã»ä¸æç«ã ãã§ãªããæ£ããåå²ã¢ãã¬ã¹ãäºæ¸¬ã§ããã®ããéè¦ãªéµã¨ãªãã
æ¡ä»¶åå²äºæ¸¬ã£ã¦ä¸è¦åç´ãªããã ãã
- æ¡ä»¶ãæ£ããäºæ¸¬ã§ããã
- åå²å ã¢ãã¬ã¹ãæ£ããäºæ¸¬ã§ããã
ã®2ã¤ãå ¥ãæ··ãã£ã¦ãããçµæ§é¢åãããåéã§ãã£ããããã
ããªã¢ã³ã1: Bounds check bypass
ã¾ãæåã¯ãããçå±ã¨ãã¦ã¯çµæ§åãããããã
ç¾ä»£ã®ã¢ã¦ããªããªã¼ãããã»ããµã«ã¯ãææ©å®è¡ããã³ãã¼ãã¦ã§ã¢ããªãã§ããã¨ããæ©è½ãããã Intelã®ããã¥ã¢ã«ã«ããã¨ããã
Implicit caching occurs when a memory element is made potentially cacheable, although the element may never have been accessed in the normal von Neumann sequence. Implicit caching occurs on the P6 and more recent processor families due to aggressive prefetching, branch prediction, and TLB miss handling.
ã¤ã¾ãããã£ãã·ã¥å¯è½ãªé åã§ããã°ããã¼ãã¦ã§ã¢ãèªåçã«ããªãã§ãããèµ°ããããã¨ãããã°ãææ©çã«ã¡ã¢ãªãã§ãããè¡ããã¨ãããã ããããå½ä»¤é ã©ããã«å®è¡ãããããã§ã¯ãªãã¨ããæå³ã§ãvon Neumannã·ã¼ã±ã³ã¹ãã§ã¯ãªãã¨ãã¦ããã åå²äºæ¸¬ã®ããã«ãã£ã軽æ¸ããããã®æ©è½ã§ãããããTLBãã¹ãçºçããåã«ãã¼ãã¦ã§ã¢ããªãã§ãããè¡ã£ã¦ããã¨ããæ©è½ãããã®ãããããªãã
ã¤ã¾ããç¾ä»£ã®é«æ§è½ããã»ããµã¯ããã°ã©ã ã®æå³ããªãã¨ããã§åæã«ããªãã§ãããå®è¡ãããªãã¹ããã¹æã®ããã«ãã£ã軽æ¸ãããã¨ãã¦ããã
ãããéæ¥åå²äºæ¸¬ã ã¨ããã«åé¡ã¯é¢åã«ãªãã ã¬ã¤ãã³ã·ãé·ããããããL1âL2âL3ã¨å ¨ã¦ãã¹ãã¦å¤é¨ã¾ã§ãã¼ã¿ãåãã«è¡ããé çªã«ãã£ãã·ã¥ãæ±ãã¦ããå¯è½æ§ããããæå³ããªããã¼ã¿ããã£ãã·ã¥ã«æã£ã¦ãã¦ããå¯è½æ§ãããã
以ä¸ã®ä¾ãåãããããã
struct array { unsigned long length; unsigned char data[]; }; struct array *arr1 = ...; /* small array */ struct array *arr2 = ...; /* array of size 0x400 */ /* >0x400 (OUT OF BOUNDS!) */ unsigned long untrusted_offset_from_caller = ...; if (untrusted_offset_from_caller < arr1->length) { unsigned char value = arr1->data[untrusted_offset_from_caller]; unsigned long index2 = ((value&1)*0x100)+0x200; if (index2 < arr2->length) { unsigned char value2 = arr2->data[index2]; } }
æ¡ä»¶åå²(ifæ)ã«arr1->length
ã®è¦ç´ ã使ããã¦ãããããã®è¦ç´ ã¯å®éã«å¤ãåã£ã¦ããã¾ã§åãããªãã
ãããããã»ããµã¯ifæãæç«ããã¨äºæ¸¬ããå ´åãåæã«arr1->data[untrusted_offset_from_caller]
ããã¼ãã¦ã§ã¢ããã§ãããè¡ãããã®ãã¼ã¿ããã£ãã·ã¥ã¾ã§æã£ã¦ãã¦ããå¯è½æ§ãããã¨ãããã¨ã ã
ããªã¢ã³ã2: Branch target injection
ãããåå²äºæ¸¬ã«ã¤ãã¦ã®åºæ¬çãªèãæ¹ãç解ããããã®è¯ãææã ã ã£ã¦ãèªåãè¯ãåãã£ã¦ããªããã¨ãå¤ãã
KVM(Kernel VM)ã¨ããæ©æ§ã«ã¤ãã¦ã¯å°ãã ãèãããã¨ãããã®ã ãããã£ãã調ã¹ã¦ã¿ãã¨ä»¥ä¸ã®ã¦ã§ããµã¤ãã«è¡ãçããã http://www.atmarkit.co.jp/ait/articles/0903/12/news120.html ãªãã»ã©ãè¦ããã«ãã¼ãã¦ã§ã¢ã®ä»®æ³åæ¯æ´æ©è½ã使ã£ãä»®æ³åã§ããããã¼ã¹ã«ã¯Linuxãªã©ã®OSãåå¨ããã VMwareãVirtualBoxã¨éãããã¹ãOSã®ä¸ã«ä»®æ³å層ãå¿ è¦ãªããããã«ãããªã¼ãããããåæ¸ãããã¨ãã§ããã
Haswellã®åå²äºæ¸¬æ©æ§ã®æ§é
ãããããHaswellã®åå²äºæ¸¬æ©æ§ã«ã¤ãã¦ææ¶ã®è§£èª¬ãå§ã¾ãã
åå²äºæ¸¬ã¨ãã£ã¦ãããã®æ¹å¼ã¯1ã¤ã§ã¯ãªããå½ä»¤ã®ç¨®é¡ã«ãã£ã¦å¤ãã®åå²äºæ¸¬æ©æ§ãåå¨ãããã®ç¹æ§ã«ãã£ã¦ä½¿ãåããã
é常ã®åå²äºæ¸¬æ©æ§
PCç¸å¯¾ãã¬ã¸ã¹ã¿å¤ããã©ã°ãªã©ã®å¤ã«å¿ãã¦åå²ãæç«ãããã決ããããã®å ´åã¯åå²å ã¢ãã¬ã¹ã¯åºå®(PCç¸å¯¾)ã§ãããã¨ãå¤ãã
MIPSãRISC-Vå½ä»¤ã§ã¯ãBEQ, BNEãªã©ã®å½ä»¤ãããã«è©²å½ããã¬ã¸ã¹ã¿å¤ãæ¯è¼ãã¦PCç¸å¯¾ã§ã¸ã£ã³ãããã
éæ¥ã¸ã£ã³ã(éæ¥å¼ã³åºã)
é¢æ°å¼ã³åºããé¢æ°ãã¤ã³ã¿ãã¤ã¡ã¼ã¸ããã°ãããé¢æ°ã®åå¨å ´æã¯ã¡ã¢ãªä¸ã«ã¢ãã¬ã¹ãªã¹ãã¨ãã¦æ ¼ç´ããã¦ãããCPUã¯ãã®ã¢ãã¬ã¹æ å ±ããã¼ãå½ä»¤ã使ã£ã¦ã¬ã¸ã¹ã¿ã«åå¾ããã¬ã¸ã¹ã¿ç¸å¯¾ã§ã¸ã£ã³ãããã
å¾ã£ã¦ããã®å ´åã¯ã¬ã¸ã¹ã¿ç¸å¯¾ã¸ã£ã³ãã§ãããã¬ã¸ã¹ã¿ã®å¤ã決å®ããã¾ã§ã¸ã£ã³ãå ã¢ãã¬ã¹ã決ã¾ããªããã¾ããMIPSãRISC-Vçã§ããjalå½ä»¤ã®ããã«ãæ¡ä»¶åå²ã¨ãããããåå²ãããã¨ã¯æ±ºã¾ã£ã¦ããããã®åå²å ã¢ãã¬ã¹ãäºæ¸¬ãããã¨ãéè¦ã«ãªãã
é¢æ°æ»ãã¢ãã¬ã¹ãäºæ¸¬ãã
ããã¯éæ¥ã¸ã£ã³ãã¨èãæ¹ã¯è¯ãä¼¼ã¦ããããã¢ãã¬ã¹ãäºæ¸¬ããããã¿ã¤ãã§ããã é¢æ°å¼ã³åºãã¯ããã£ã½ã©ã®ãã¨ããªãéãé¢æ°ãçµäºããã¨å¼ã³åºãå ã«æ»ã£ã¦ããã å¾ã£ã¦ãé¢æ°å¼ã³åºãã®å½ä»¤(ä¾ãã°jalå½ä»¤)ãå®è¡ãããã°ãé¢æ°ããæ»ã£ã¦ããã¨ãã¯å¿ ãjalå½ä»¤ã®æ¬¡ã®ã¢ãã¬ã¹ãããã§ãããå§ã¾ãã¯ãã ã¨ãããã¨ãåããã
å¾ã£ã¦ããã®é¢æ°å¼ã³åºãã®å ´æãã¹ã¿ãã¯ã«ä¿åãã¦ãããé¢æ°ããæ»ãã¨ã(retå½ä»¤ãªã©ãå®è¡ãããå ´å)ã¯ã次ã®é¢æ°ãã§ããå ãã¹ã¿ãã¯ããåãåºãã¦å½ä»¤ãã§ããã«ä½¿ç¨ããã
ä¸è¬çãªåå²äºæ¸¬æ©æ§ã®ä»çµã¿
åå²äºæ¸¬ãå®ç¾ããããã«ã¯ããã¤ãã®æ©æ§ãå¿ è¦ã ããããã§ã¯ãåå²ã¿ã¼ã²ãããããã¡(Branch Target Buffer:BTB)ãåå²å±¥æ´ãã¼ãã«(Branch History Table:BHT)ãç´¹ä»ããã¦ããã
åå²ã¿ã¼ã²ãããããã¡ã¯ãã®åã®ã¨ãããã½ã¼ã¹ã¢ãã¬ã¹(ç¾å¨ã®PCã¢ãã¬ã¹)ããã次ã«ã©ã®å½ä»¤ããã§ããããã(åå²å ã¯ã©ãã)ãè¨æ¶ãã¦ãããããã¡ã§ããã Haswellã®åå²ã¿ã¼ã²ãããããã¡ã¯ã½ã¼ã¹ã¢ãã¬ã¹ã¨ãã¦PCã®ä¸ä½32ãããã使ãã¨ãã¦ãããä¾ãã°PCã¢ãã¬ã¹ 0x4141_0004_1000 ã§åå²ãå®è¡ãã 0x4141_0004_5123 ã«ã¸ã£ã³ãããã¨ããã¨ããã®ã¸ã£ã³ãå±¥æ´ãBTBã«è¨é²ãããã
PCã¢ãã¬ã¹ã®ãã¡32ããããããä¸ä½ã®ã¢ãã¬ã¹ã¯BTBã®æ¤ç´¢ã«ã¯å©ç¨ããªããã¨ããããä¸ä½ã®32ãããã使ã£ã¦ã½ã¼ã¹ã¢ãã¬ã¹ã®åç §ãè¡ããããã«å¾ç¶ã®ã¹ãã¼ã¸ã§åå²ã¿ã°ãããã¡ãåç §ãã¦32ããããããä¸ã®ãããããã§ãã¯ããä¸ä½ãããããããããã°åå²äºæ¸¬ããããããã¨ãã¦BTBã®ã¨ã³ããªå¤ã次ã®ãã§ããã¢ãã¬ã¹ã¨ãã¦ä½¿ç¨ãããã
ããããä¸ä½32ãããã使ãã¨ãã£ã¦ãã32ãããã®ã¢ãã¬ã¹ã¨ã³ããªãæã¤BTBãããã¡ãä½ã£ã¦ãã¾ãã¨ã232ã®ã¨ã³ããªãæã¤BTBãã¼ãã«ãä½ãå¿ è¦ãçãã¦ãã¾ããããã¯ã¨ã³ããªã¢ãã¬ã¹ãããã«çç¥ãã¦BTBã®ã¨ã³ããªæ°ãæ¸ããã
ããã§ã¢ãã¬ã¹å§ç¸®(ã¨ãããXORã«ãããããæ°æ¸ãã)ãè¡ãããã
bit A | bit B |
---|---|
0x40.0000 | 0x2000 |
0x80.0000 | 0x4000 |
0x100.0000 | 0x8000 |
0x200.0000 | 0x1.0000 |
0x400.0000 | 0x2.0000 |
0x800.0000 | 0x4.0000 |
0x2000.0000 | 0x10.0000 |
0x4000.0000 | 0x20.0000 |
ã¾ããã®è¡¨ãé常ã«åããã«ããã è¦ããã«ãã®è¡¨ã使ã£ã¦ãã¢ãã¬ã¹ã®ãã¹ã¯ãè¡ããbitAã¨bitBã®1ã«ãªã£ã¦ããé¨åã®ã¢ãã¬ã¹ããããäºãã«XORãããã®çµæãBTBã®ã¨ã³ããªã¢ãã¬ã¹ã®ä¸é¨ã¨ãã¦å©ç¨ããã
- ä¾ãã®1. ã¢ãã¬ã¹ 0x0100_0000 㨠0x0180_0000 ã¯ã23ãããç®ã¨14ãããç®ã®XORãã
0 xor 0 = 0, 1 xor 0 = 1
ãªã®ã§äºãã«ç°ãªãèå¥å¯è½ã - ä¾ãã®2. ã¢ãã¬ã¹ 0x0100_0000 㨠0x0180_8000 ã¯ã24ãããç®ã¨15ãããç®ã®XORãã
0 xor 0 = 0, 0 xor 1=1
ã ãã23ãããç®ã¨14ãããç®ã®XORãã0 xor 0 = 0, 1 xor 0 = 1
, ãªã®ã§äºãã«ç°ãªãèå¥å¯è½ã - ä¾ãã®3. ã¢ãã¬ã¹ 0x0100_0000 㨠0x0140_2000 ã¯ã26ãããç®ã¨17ãããç®ã®XORãã
0 xor 0 = 0, 1 xor 1=0
ãªã®ã§èå¥ã§ããªãã - ä¾ãã®4. ã¢ãã¬ã¹ 0x0100_0000 㨠0x0180_4000 ã¯ã27ãããç®ã¨18ãããç®ã®XORãã
0 xor 0 = 0, 1 xor 1=0
ãªã®ã§èå¥ã§ããªãã
ã¨ãªã£ã¦ãã¾ããæå¾ã®2ã¤ã®ã¢ãã¬ã¹ã¯BTBã¨ã³ããªã«ã¨ã£ã¦åºå¥ãã¤ããªããªãã
éæ¥åå²ã¸ã£ã³ãã«ãå©ç¨ãããåå²å±¥æ´ãã¼ãã«
ä¸è¨ã®ä¾ã§ã¯ãé常ã«åç´ãªBTBã®ã¢ãã¬ã¹ã¨ã³ããªçææ¹å¼ãè¦ãããå®éã«ã¯åå²å±¥æ´ãã¼ãã«(Branch History Table:BHT)ããããã¯åå²å±¥æ´ãããã¡(Branch History Buffer:BHB)ã¨ã®çµã¿åããã§å©ç¨ãããã
Haswellã«ã¯ããã®åå²å±¥æ´ãã¼ãã«ã29æ¬ããã¨ãã¦ããã åå²å±¥æ´ãã¼ãã«ãå©ç¨ãã¦éå»ã®29ååã®åå²å±¥æ´(åå²ããå ´åã®ã¿)ãæ ¼ç´ãã¦ããã
29æ¬ããã¨ãã£ã¦ãä½ã ãåãããªãã®ã§ãããå°ãåã¿ç ãã¦åå²å±¥æ´ãã¼ãã«ã解説ãã¦ã¿ããã
å±æåå²äºæ¸¬ã¨åºååå²äºæ¸¬ã®èãæ¹ã®éã
åå²äºæ¸¬ã«ã¯å¤§ããåãã¦å±æåå²äºæ¸¬ã¨åºååå²äºæ¸¬ã®2種é¡ã®èãæ¹ãããã
å±æåå²äºæ¸¬ã¨ããã®ã¯ã大å¦ã®å¦é¨ã®ææ¥ã§ãé »ç¹ã«ç»å ´ããèãæ¹ã ã
ããã®ã¢ãã¬ã¹ã®åå²å½ä»¤ã¯éå»ä½åº¦ãåå²ãæç«ãã¦ããããã次ãæç«ããã ãããã¨ããèãæ¹ã§ãããã¤ã¾ããç¾å¨ã®PCã¢ãã¬ã¹ã¨ãã®ã¢ãã¬ã¹ã®åå²å½ä»¤ã®çµæããè¦ãªãã®ã§ãå±æåå²äºæ¸¬ã¨è¨ãããã
ã¨ããããããã°ã©ã ã®ã·ã¼ã±ã³ã¹çã«ã¯ããã§ãªãå ´åãåå¨ããã
ããã®ã¢ãã¬ã¹ã®åå²å½ä»¤ãå®è¡ããåã«ã1ã¤åã¯Aã®å ´æã§åå²ãæç«ã2ã¤åã¯Bã®å ´æã§åå²å¤ä¸æç«ã ã£ãããã®ãã¿ã¼ã³ãè¦ãã¨æ¬¡ã®åå²ã¯æç«ã¨äºæ¸¬ã§ããããªãã¦ã±ã¼ã¹ãããã ããã¯Cè¨èªãªã©ã§ãifæã並ã¹ã¦æ¸ãã¦ããã¨ãã®ãããªç¶æ³ãæ®éã«èµ·ããã ã¤ã¾ããä»ç¾å¨ã®PCã¢ãã¬ã¹ã®åå²å½ä»¤ã®çµæã ãã§ãªãããã®1ã¤åã«å®è¡ãããå¥ã®PCã¢ãã¬ã¹ã®åå²äºæ¸¬ã®çµæãããã«ãéå»ã®å¥PCã¢ãã¬ã¹ã®åå²äºæ¸¬ã®çµæã¾ã§èæ ®ãã¦åå²äºæ¸¬ãå®è¡ããã ãã®ããããã大ååå²äºæ¸¬ã¨å¼ã¶ã
å®éã«ã¯ãå±æåå²äºæ¸¬ã®å ´åã«ã¯ååå²å½ä»¤æ¯ã«åå²å±¥æ´ãããã¡ãæã¡ãåºååå²äºæ¸¬ã®å ´åã¯ãå ¨ã¦ã®åå²å½ä»¤ã§å ±éã®åå²å±¥æ´ãããã¡ã使ãããé¢ç©ã¯åæ¸ã§ããã
ãã®ä»£ãããåºååå²äºæ¸¬ã®å ´åã¯åå²å±¥æ´ãããã¡ãé·ãã«ä¿æããå¿ è¦ããããå±¥æ´ãããã¡ãé·ããªãã¨ãã®ãã¿ã³ãã¢ãã¬ã¹ã¨ãã¦ç¨ãããã¿ã³å±¥æ´ãã¼ãã«ã®ã¨ã³ããªæ°ãé·ããªã£ã¦ãã¾ãã¨ããå¼±ç¹ãããã ããã¦åºååå²äºæ¸¬ã¯ãååãã¼ãã«ã大ãããã¦ãå±æåå²äºæ¸¬ãããæ績ãå°ãæªãã
ãã®BHBã®ã¢ãããã¼ãã示ããæ¬ä¼¼ã³ã¼ããã以ä¸ã ãåå²ãå®è¡ããã½ã¼ã¹ã¢ãã¬ã¹ã¨ãã®ã¨ã³å ã¢ãã¬ã¹ã次ã ã¨XORãã¦ãããã¨ãåãããããã«ãããåå²ã®ã·ã¼ã±ã³ã¹ãè¨æ¶ããã次ã®åå²äºæ¸¬ã«ä½¿ç¨ãããã
void bhb_update(uint58_t *bhb_state, unsigned long src, unsigned long dst) { *bhb_state <<= 2; *bhb_state ^= (dst & 0x3f); *bhb_state ^= (src & 0xc0) >> 6; *bhb_state ^= (src & 0xc00) >> (10 - 2); *bhb_state ^= (src & 0xc000) >> (14 - 4); *bhb_state ^= (src & 0x30) << (6 - 4); *bhb_state ^= (src & 0x300) << (8 - 8); *bhb_state ^= (src & 0x3000) >> (12 - 10); *bhb_state ^= (src & 0x30000) >> (16 - 12); *bhb_state ^= (src & 0xc0000) >> (18 - 14); }
åå²äºæ¸¬å¨ã®å é¨ããªãã¼ã¹ã¨ã³ã¸ãã¢ãªã³ã°ãã
Googleã®ãã¼ã ã§ã¯ä»¥ä¸ã®ãããªãã¹ããè¡ã£ã¦ããã 2ã¤ã®ããã°ã©ã ãã1ã¤ã®ç©çã³ã¢(ãã ã2ã¤ã®ããã»ã¹:è«çã³ã¢)ã§å®è¡ããã
ããã§ãASLRã¨ããã®ã¯ã¢ãã¬ã¹ãã©ã³ãã åããæ©æ§ã§ãããã使ã£ã¦ãã¾ãã¨2ã¤ã®ããã°ã©ã ã§ä½¿ç¨ããPCã¢ãã¬ã¹ãããã¦ãã¾ããããã®æ©è½ãç¡å¹åãã¦ããã
ããã§åç¾ãããã®ã¯ã2ã¤ã®ããã°ã©ã ã§åå²äºæ¸¬ãã¼ãã«ãå ±æããã¦ãã¾ããã¨ã«ããä»ã®ããã»ã¹ã®æ å ±ãè¦ãã¦ãã¾ããã¨ã§ããã
ãã®ããã«ãé¢æ°ãã¤ã³ã¿ã®ã³ã¼ã«ãè¡ããã¹ãå¤æ°ã¸ã®ã¢ã¯ã»ã¹ãå®è¡ãããããã«ãããã¹ãå¤æ°ã¯ãã£ãã·ã¥ã«æ ¼ç´ãããã ãã®å¾ãã®å¤ãCLFLUSH(ããã¯x86ã®ãã£ãã·ã¥ã©ã¤ã³ã®ãã©ãã·ã¥å½ä»¤ã§ãã)ã使ã£ã¦ãã©ãã·ã¥ãã¦ãã¾ãã 次ã«ããç¾å¨ã®åå²äºæ¸¬å¨ã®ç¶æ ããä½ãåºãããã«ãå¿ ãæç«ããåå²å½ä»¤ãNåå®è¡ãã(ããã§ãå¿ ãæç«ãããã¨ããã®ã¯ãä¸è¿°ããã¨ããBHBã¯æç«ããåå²ããè¨é²ããªãããã )ã
ããã¦ããããã¤ã³ã¹ã¿ã³ã¹1ã¨ã¤ã³ã¹ã¿ã³ã¹2ãå¤ããã¹ããã¦ããã¨ãã«ãåã³ãã¹ãå¤ããã£ãã·ã¥ã«èªã¿åºãããã®ã¨ããã¤ã³ã¹ã¿ã³ã¹1ã¨ã¤ã³ã¹ã¿ã³ã¹2ãåãåå²ãã¹ããªã®ãã¿ã³ã使ãã°ãã¤ã³ã¹ã¿ã³ã¹2ãåå²äºæ¸¬ã®ã¬ã¤ãã³ã·ãåããããã«ææ©çã«ãã¹ãå¤ãèªåã®ã¬ã¸ã¹ã¿ã«æã£ã¦ããã ããã
ãã®å¾ã¤ã³ã¹ã¿ã³ã¹1ã¨ã¤ã³ã¹ã¿ã³ã¹2ã§ãã¹ãå¤ãåå¾ããã¨ãããã¤ã³ã¹ã¿ã³ã¹2ã¯ã¤ã³ã¹ã¿ã³ã¹1ã®å¤ãè¦ããã¨ãåºæ¥ãã¨ãããããã
ããã§Nã®æ°ãå¢ããã¦ãããã¨ãèãããä¸è¿°ããããã«BHBã¯ããã°ã©ã ã®ã½ã¼ã¹ã¢ãã¬ã¹ã¨ã¿ã¼ã²ããã¢ãã¬ã¹ã®æ å ±ãXORã§è¨é²ãã¦ããã¯ãã ã N=25ã¨ããã¨ããã®ééãã¯çºçããªãã£ããã¤ã¾ããN=25ã¾ã§ã¯åå²äºæ¸¬å¨ã¯2ã¤ã®ã¤ã³ã¹ã¿ã³ã¹ã®éããèå¥ã§ãã¦ããã ã¨ããããN=26ã¨ããã¨é端ã«ãã®ç¾è±¡ãçºçãå§ããã å¾ã£ã¦ãHaswellã®å ´åã¯ãã®å°ãªãã¨ã26åã¾ã§ã®åå²å±¥æ´ãä¿åãã¦ããã¨ãããã¨ã«ãªãã
ããªã¢ã³ã3: Rogue data cache load
ããªã¢ã³ã3ã®è§£èª¬ã«ã¤ãã¦ææããããå°ãªãã¨ãéå»ã®è§£èª¬ã«ã¤ãã¦é大ãªèª¤ããããã¾ãããç³ã訳ããã¾ãããæç®ãããèªã¿ç´ãä¿®æ£ãã¾ãããããã®è§£èª¬ãçåãæ®ã誤ã£ã¦ããå¯è½æ§ãããã¾ããéµåã¿ã«ããªããããããããé¡ããã¾ãã
ãã¡ããææ©çå®è¡ã使ã£ããã®ã§ãã¦ã¼ã¶ã¢ã¼ãã®ããã°ã©ã ããã«ã¼ãã«ã¢ã¼ãã®é åãåç §ããããã°ã©ã ã®ææ©å®è¡ãè¡ã£ãéä¸çµæã¾ã§ãå©ç¨ãã¦ãã¼ã¿ãèªã¿åãã¨ããå·§å¦ãªãã®ã«ãªã£ã¦ããã
ã¾ãã¯ä»¥ä¸ã®è§£èª¬ãèªãã¹ãã
ææ©çå®è¡ã®ãã¼ãã¦ã§ã¢æ§é
ãã¡ãã¯åæããåç §ããã¦ããã£ã¦ãããã¢ã¦ããªããªã¼ãããã»ããµã®æ§æã ã
ãããè¦ãã¨ããã¤ãã©ã¤ã³ãæµãã¦ããå½ä»¤ã¯ããªãªã¼ããããã¡ãééããå¾ã«å½ä»¤ã®ç¨®é¡ãã¨ã«ç°ãªãã¦ãããã«çºè¡ããããã¨ãåããã ãã¼ãã¯0ãã8ã¾ã§ç¨æããã¦ãããæ´æ°å½ä»¤ã¯ãã¼ã0,1ããã¼ãã¹ãã¢ã¯2,3ã¨ãã£ãå ·åã ã
ããã¦éè¦ãªç¹ã¯ãéããã¼ãã«çºè¡ãããå½ä»¤ã¯ãããã°ã©ã ã®é çªã¨ã¯ç¬ç«ã«å®è¡ãé²ãã§ããããã¼ã¨ããéã£ã¦ããã°ãã¬ã¤ãã³ã·ã®çãå½ä»¤ã¯ã¬ã¤ãã³ã·ã®é·ãå½ä»¤ã追ãè¶ããã¨ãã§ããã ãããé常ã«éè¦ãªå½¹å²ãæã¤ã
ããä¸ã¤ã®ç¹å¾´ã¯ãããå½ä»¤ã§ä¾å¤ãçºçããã¨ãã¦ããå®éã«ä¾å¤ãçºçããã®ã¯å½ä»¤ãå®è¡ã¦ããããééããå½ä»¤ããªã¿ã¤ã¢ããã¨ãã«ã®ã¿ä¾å¤ãçºçããã¨ãããã¨ã ã
ä¾ãã°æ¥µç«¯ãªä¾ãæãã¦ã¿ãã
load dst1, mem[A] // dst2 <- mem[A] ã®ã¡ã¢ãªãã¼ã add.f dst2, dst2, 10.0 // dst2 <- dst2 + 10.0 ã®æµ®åå°æ°ç¹æ¼ç®
ããã§ã2çªç®ã®add.fã§æµ®åå°æ°ç¹ä¾å¤ãçºçãããã®ã¨ãããã ã¨ãããã¬ã¤ãã³ã·çã«loadã®ã»ããæéãããããadd.fã®æ¹ãå ã«å½ä»¤ã®å®è¡ãçµäºããä¾å¤ãæ¤åºã§ãããã®ã¨ããã
ããã1çªç®ã®loadã®å®äºãå¾ ããã«ãadd.fã®ä¾å¤ã«é£ãã§ãã¾ãã¨ãããã°ã©ã ã®æå³çã«ããããªãã¨ã«ãªã£ã¦ãã¾ãã ã½ããã¦ã§ã¢çã«ã¿ãã¨ãloadãå®äºãã¦ããªãã®ã«åæã«add.fã®ä¾å¤ãçºçããã¨ãã¦èª¤åä½ã¨ãã¦ã¨ããããã¦ãã¾ãããããé²ãããã«ãå¿ ãä¾å¤ã¯ãªãªã¼ããããã¡ã«ãã£ã¦å½ä»¤ãå®äºããã¨ãã«å®è¡ãããã
ãªãªã¼ããããã¡ãå½ä»¤ãå®äºãããã¨ãã¯ãå¿ ãå½ä»¤ã¯ããã°ã©ã ã®é çªéãã«æ»ã£ã¦ãããããadd.fã®ä¾å¤çºç(ã¤ã¾ãadd.fãå®äºããªã¿ã¤ã¢ãã)ã¨ãã¯ããããããåã«çºè¡ãããloadãå¿ ãçµäºãã¦ãããããã°ã©ã çã«æå³ãæãªããªããã¨ãã訳ã ã
ãã¦ã以ä¸ã®åæã«åºã¥ãã¦ãæåã®åæã«æ»ã£ã¦åé¡ã解æãã¦ã¿ãã
ã¢ã¦ããªããªã¼ãã«ãã£ã¦ã«ã¼ãã«ã¢ã¼ãå½ä»¤ãçµæããã¾ã使ãã¾ããä»çµã¿
ã¾ãã以ä¸ã®ããã°ã©ã ãèãã¦ã¿ãã
mov rax,[somekernelmodeaddress]
ãããã¦ã¼ã¶ã¢ã¼ãã§å®è¡ããå ´åãä½è£ã§ä¾å¤ãçºçããããã¡ã«æ±ºã¾ã£ã¦ãï¼
ããããä¾å¤ãçºçããã®ã¯ãããªãªã¼ããããã¡ã«å ¥ã£ã¦å½ä»¤ãå®äºããã¨ããã§ããã¨ãããã¨ãæãåºãã¦ã»ããã ã¤ã¾ããå®éã«ã«ã¼ãã«ã¢ã¼ãã«ã¢ã¯ã»ã¹ãè¡ãããã¼ã¿ããªãªã¼ããããã¡ä¸ããããã¯ãã£ãã·ã¥ã«æã£ã¦ãã¦ããå¯è½æ§ãããã ãããåæä¸ã§ã¯ãããã¤ã¯ãã¢ã¼ããã¯ãã£ã®ç¶æ ãå¤æ´ãã¦ããå¯è½æ§ãã¨ãã¦ããã
次ã®ããã°ã©ã ã ã
mov rax, [Somekerneladdress] mov rbx, [someusermodeaddress]
ä¸è¨ã®ã¢ã¦ããªããªã¼ãå®è¡ã®å³ãè¦ãã¨ããã¼ãã¹ãã¢ã®å½ä»¤ã¦ãããã¯2ã¤ããããã ã ãããä¸è¨ã®2å½ä»¤ã«ã¯ä¾åé¢ä¿ããªãã®ã§ããã®2ã¤ã¯åæã«å®è¡ãããã¨ãã§ããã ããã¦1çªç®ã®å½ä»¤ã¯ä¾å¤ãçºçãã¦ããã®ã ãã2çªç®ã®å½ä»¤ã¯ãã§ã«ãã¼ããè¡ã£ã¦ããããå°ãªãã¨ããã£ãã·ã¥ã«[someusermodeaddress]ã®ãã¼ã¿ããã¼ããã¦ãããããããªãã ããã¯ä¾å¤ãçºçããå¾ã«ãå½è©²ãã£ãã·ã¥ãã¢ã¯ã»ã¹ãã¦ã¿ãã¨ç¢ºèªãããã¨ãã§ããã
次ã®ããã°ã©ã ã ãããã¯ä¸è¨ã¨éã£ã¦ä¾åé¢ä¿ãæã£ã¦ããã
mov rax, [somekerneladdress] and rax, 1 mov rbx,[rax+Someusermodeaddress]
ããã§ã2çªç®ã¨3çªç®ã®å½ä»¤ãåæã«çºè¡ããã¦ãããã®ã¨ããã
éè¦ãªã®ã¯2çªç®ã®movã®å®è¡çµæã¯ãraxã¤ã¾ãsomekerneladdressã®å¤ã«ä¾åãã¦ããã¨ãããã¨ã ã ã¤ã¾ããã¢ã¦ããªããªã¼ãã§2çªç®ã®movã®éä¸çµæããã£ãã·ã¥ã«ä¿åããã¦ããã¨ããã®æ å ±ãé ¼ãã«somekerneladdressã®å¤ãç¹å®ãããã¨ãå¯è½ã«ãªãï¼
ããã§åæã®èè ãéåã¨è¦å´ãã¦ããã®ããããã1çªç®ã®å½ä»¤ãä¾å¤ãçºçãããåã«ãã©ãã«ããã¦2çªç®ã¨3çªç®ã®å½ä»¤ãå®è¡ãããªããã°ãªããªãã
ãããè¡ãããã«ãmovå½ä»¤ã§ä½¿ç¨ããLoad/Storeã¨ã¯å¥ã®ã¦ãããã使ã£ã¦å®è¡ããandå½ä»¤ãæ¿å ¥ãã¦ããã Load/Storeã¦ãããã使ãå½ä»¤ã¨ã¯å¥ã®å½ä»¤æ¿å ¥ãããã¨ã§ãCPUã¯ãããã®å½ä»¤ãææ©çã«å®è¡ãããã¨ãã§ããããã«ãªãã (çè ã®è§£é: ããã®èª¬æã¯æ£ç´ããåãããªããå¥ã®ã¦ãããã使ã£ã¦ããææ©çãªå®è¡ã確èªãããã¨ã«ã¯ãªããªãã®ã§ã¯ï¼)
æ£ããç解ã§ãã¦ãããå¾®å¦ã ãããããããããããã¨ã ã
æåã®movå½ä»¤ãã«ã¼ãã«é åã®ãã¼ã¿ãraxã«ãã¼ãããããå®éã«ã¯ãã®å½ä»¤ã¯ä¾å¤ãçºçãããã
ãã®ä¾å¤ãçºçããåã«ãææ©çå®è¡ã«ããand
å½ä»¤ã¨æ¬¡ã®mov
å½ä»¤ãå®è¡ãããã¨ãã§ããã°ããã®çè·¡ããã£ãã·ã¥ã«æ®ããã¨ãã§ããã ãããã¨ããèãæ¹ã ããã
ãã ãããã®èãæ¹ãåã£ã¦ãããã¯çåãæ®ãã ãããããæåã®movããªã¿ã¤ã¢ããã¾ã§ã«ååãªæéã確ä¿ãããå ´åãæåã®movã®åã«ããã«æéããããå¦çãæ¿å ¥ããã°ããªã¿ã¤ã¢ã¾ã§ã®æéãå¤§å¹ ã«ç¨¼ããã¨ãã§ããã®ã§ã¯ãªããï¼ ãã®éã«2çªç®ã¨3çªç®ã®å½ä»¤ãææ©å®è¡ããããã¨ã§ãã¦ã¼ã¶ã¢ã¼ãã®ãã¼ã¿é åãL1ã«ååãªä½è£ããã£ã¦æ®ããã¨ãã§ããããªã®ã ã...
// ãã®é¨åã«é常ã«ã¬ã¤ãã³ã·ã®é·ãå½ä»¤ãæ¿å ¥ããã mov rax, [somekerneladdress] // âã®å½ä»¤ã®å½±é¿ã§ãã®å½ä»¤ã¯ãªããªãä¾å¤ãåºããã¨ãã§ããªã and rax, 1 // ãã®éã«ããã®å½ä»¤ã¨ mov rbx,[rax+Someusermodeaddress] // ãã®å½ä»¤ãkerneladdressã®ãã¼ã¿ã«åºã¥ãã¦ã¦ã¼ã¶é åã®ãã¼ã¿ãåãåºãã
ã¾ããåãããã
ãã¤ã¯ãã¢ã¼ããã¯ãã£ããè¦ããããã®èå¼±æ§ã®ä¿®æ£æ¹æ³
ã¾ããIntelã®å ¬å¼å£°æã§ããããã®è§£æ±ºæ³(Mitigation:ç·©åæ³?)ã«ã¤ãã¦è¨åããã¦ããã
Bound check Bypass ã®è§£æ±ºæ¹æ³
åºæ¬çã«ã¯ã½ããã¦ã§ã¢ã«ãã解決æ³ãæã¾ãã¦ããæ§åã å®éã«ã¢ã¯ã»ã¹ãè¡ã£ã¦ã¯ãããªãã·ã¼ã±ã³ã¹ã«ã¤ãã¦ã¯ãFENSEå½ä»¤ã使ã£ã¦æ示çã«ã¡ã¢ãªã¢ã¯ã»ã¹ã®åæãè¡ãããã¼ãã¦ã§ã¢ããªãã§ãããé²ãã¨ããæ¹å¼ã
Branch Target Injection ã®è§£æ±ºæ¹æ³
ãã¡ãã¯ãã¾ãããã¨ããªãã®ã ããããã»ããµã¨ã·ã¹ãã ã½ããã¦ã§ã¢ã®éã«æ°ããã¤ã³ã¿ãã§ã¼ã¹ãä»è¾¼ãã¨ãã風ã«ãªã£ã¦ããã ãã¤ã¯ãã³ã¼ãã«ããã¢ãããã¼ãã¨ãã¦ã¯ã
- Indirect Branch Restricted Speculation (IBRS): éæ¥åå²ã®ææ©å®è¡ãå¶éããã
- Single Thread Indirect Branch Predictors(STIBP): éæ¥åå²ã®ææ©ç移è¡ã¯ã1ã¤ã®ã¹ã¬ããã®ã¿ãå®è¡ã§ããããã«å¶ç´ããã
- Indirect Branch Predictor Barrier(IBPB): åã®ããã°ã©ã ã®æåããéæ¥åå²ã®åå²äºæ¸¬ã«å½±é¿ããªãããã«ããã
Rogue Data Cache Load ã®è§£æ±ºæ¹æ³
ããã¯ã¦ã¼ã¶ã¢ã¼ãã¨ã¹ã¼ããã¤ã¶ã¢ã¼ãã®ãã¼ã¸æ§é ãåããåé¢ãããã¨ã§è§£æ±ºã§ããã¨ãã¦ããã
ã¾ãã©ã£ã¡ã«ãã¦ããã½ããã¦ã§ã¢ã«ããä¿®æ£ãå¿ è¦ã¨ãããã¨ã ãªã