Understanding the scope of Intel® errata №KBL095

Recently, many motherboard supporting skylake or kabylake, got a uefi update described as cpu microcode security update for a specific Intel errata, described by Intel® as :

Under complex micro-architectural conditions, short loops of less than 64 instructions that use AH, BH, CH or DH registers as well as their corresponding wider register (e.g. RAX, EAX or AX for AH) may cause unpredictable system behavior. This can only happen when both logical processors on the same physical processor are active.

Intel issues cpu frequently errata that can cause denial of service, but in that case, manufacturer don’t create a specific uefi update for each of them.

So does unpredictable system behavior may imply remote code execution (e.g. because such loops would propagate register change to the other thread running on the same core) ?

Also, what kind of loops can trigger the bug ? Does simply modifying some of the involved registers in less than 64 instructions can trigger the bug ? Does both logical cores on the same physical core needs to run the so‑called short loops ?

Continue reading Understanding the scope of Intel® errata №KBL095

Understanding the scope of Intel hyperthreading errata KBL095

Recently, many motherboards supporting skylake or kabylake, got a uefi update described as cpu microcode security update for a specific Intel errata, described by Intel as :

Short Loops Which Use AH/BH/CH/DH Registers May Cause Unpredictable System Behavior.

Under complex micro-architectural conditions, short loops of less than 64 instructions that use AH, BH, CH or DH registers as well as their corresponding wider register (e.g. RAX, EAX or AX for AH) may cause unpredictable system behavior. This can only happen when both logical processors on the same physical processor are active.

Intel issues cpu frequent errata that can cause denial of service, but in this case, manufacturer didn’t create a specific uefi update for each of them.
Of course, I tried the following code on several logical cores which doesn´t crash anything (I don’t understand if all 8 registers must be involved to trigger the bug or only one of them is enough) :

48 ba ff 00 00 00 04    movabs $0x4000000ff,%rdx
00 00 00
.L5:
48 89 d0                movq    %rdx,%rax
48 2d fe 00 00 00       subq    $0xfe,%rax
08 f4                   orb     %dh,%ah
48 89 c3                movq    %rax,%rbx
48 81 eb fe 00 00 00    subq    $0xfe,%rbx
08 e7                   orb     %ah,%bh
48 89 d9                movq    %rbx,%rcx
48 81 e9 fe 00 00 00    subb    $0xfe,%rcx
08 fd                   orb     %bh,%ch
48 89 ca                movq    %rcx,%rdx
48 81 ea fe 00 00 00    subq    $0xfe,%rdx
08 ee                   orb     %ch,%dh
48 85 cb                test   %rcx,%rbx
75 cc                   jne    .L5
movq    %rcx, %rdx
movq    %rbx, %rax
movq    %rax, %rsi
leaq    .LC0(%rip), %rdi
movl    $0, %eax
call    printf@PLT

So does unpredictable system behavior imply remote code execution (e.g. because such loops would propagate register change to the other thread running on the same core) ?

Also, what kind of loops can trigger the bug? Does simply modifying some of the involved registers in less than 64 instructions trigger the bug? Does loops needs to be different (I mean threads shouldn’t use the same code)?
At least can it be possible to have example Ocaml code that can trigger the bug?
How to know if a vulnerable microcode is used while running qemu-kvm? (qemu -cpu host hides microcode revision number)

Continue reading Understanding the scope of Intel hyperthreading errata KBL095

Relay Computer: You Can Hear It Think

Modern digital computers have complex instruction sets that runs on state-of-the-art ALUs which in turn are a consequence of miniaturized logic gates that are built with tiny transistors. These tiny transistors are essentially switches. You could imagine replacing with electromagnetic relays, and get what is called a relay computer. If you can imagine it, someone’s done it. In this case, [jhallenworld].

The Z3 was the first working programmable, fully automatic digital computer designed by Konrad Zuse. The board employs modern semiconductor devices such as memory and microcontrollers, however, the CPU is all relays. A hexadecimal keyboard allows for program entry …read more

Continue reading Relay Computer: You Can Hear It Think

Relay Computer: You Can Hear It Think

Modern digital computers have complex instruction sets that runs on state-of-the-art ALUs which in turn are a consequence of miniaturized logic gates that are built with tiny transistors. These tiny transistors are essentially switches. You could imagine replacing with electromagnetic relays, and get what is called a relay computer. If you can imagine it, someone’s done it. In this case, [jhallenworld].

The Z3 was the first working programmable, fully automatic digital computer designed by Konrad Zuse. The board employs modern semiconductor devices such as memory and microcontrollers, however, the CPU is all relays. A hexadecimal keyboard allows for program entry …read more

Continue reading Relay Computer: You Can Hear It Think

You Know You Can Do That with a 555

Hardly a week goes by that we don’t post a project where at least one commenter will lament that the hacker could have just used a 555. [Peter Monta] clearly gets that point of view. For a 555 design contest, he created both digital logic gates and an op amp, all using 555 chips. We can’t quite imagine the post apocalyptic world where the only surviving electronic components are 555 chips, but if that day were to come, [Peter] is your guy.

Using the internal structure of the 555, [Peter] formed a basic logic gate, an inverter, latches, and more. …read more

Continue reading You Know You Can Do That with a 555

Find Instructions Hidden In Your CPU

There was a time when owning computer meant you probably knew most or all of the instructions it could execute. Your modern PC, though, has a lot of instructions, many of them meant for specialized operating system, encryption, or digital signal processing features.

There are known undocumented instructions in a lot of x86-class CPUs, too. What’s more, these days your x86 CPU might really be a virtual machine running on a different processor, or your CPU could have a defect or a bug. Maybe you want to run sandsifter–a program that searches for erroneous or undocumented instructions. Who knows what …read more

Continue reading Find Instructions Hidden In Your CPU

Virtual CPU Stays on Script

Some will see it as a great thing, and others as an example of how JavaScript is being abused daily, but [Francis Stokes] decided to design his own CPU architecture and implemented a virtual version of it using JavaScript. The CPU is a 16-bit affair and has a simplified assembly language. The code is on GitHub, but the real value is [Francis’] exposition of the design in the original post.

While discussing the design, [Francis] reveals his first pass at the instruction set, discussed what he found wrong about it, and then reveals the final set composed of real instructions …read more

Continue reading Virtual CPU Stays on Script