Live data from Hacker News

Sandsifter: find undocumented instructions and bugs on x86 CPU

github.com

61–70 of 94 posts

Re: Sandsifter: find undocumented instructions and bugs on x86 CPU

#61
post #55

Earlier quoted context omitted.

Then definitely also check out the Quantum Thief trilogy, by Hannu Rajaniemi.

Amusingly, the cover of The Quantum Thief (at least on iBooks) has the following quote: > "The best first SF novel I've read in years. Hard to admit, but I think he's better at this stuff than I am." -Charles Stross

I remain completely unmoved by HR's output. But I'm most definitely in the minority.

Re: Sandsifter: find undocumented instructions and bugs on x86 CPU

#65

Earlier quoted context omitted.

Thanks. The scale is still hard to wrap my head around but I see what you're saying. Could this tool find hardware backdoors?

> Could this tool find hardware backdoors? Only very crude ones. A competently implemented hardwre backdoor would probably be data-dependent. For instance, it might trigger when REP CPUID is called with four specific 64-bit values in R8, R9, R10, and R11 -- and if that were the case, there would be absolutely no way to discover it by searching.

There's also the fascinating variant where a control line charges a capacitor over time to activate backdoor behavior. Triggering it would look like a bunch of nonsense instructions that just so happen to keep that control line energized long enough for the capacitor to cross some activation voltage.

Re: Sandsifter: find undocumented instructions and bugs on x86 CPU

#66
post #38

Related: https://www.theregister.co.uk/2013/05/20/intel_chip_customiz... "Everybody hates the golden screwdriver upgrade approach, where a feature is either hidden or activated through software, but the truth of the matter is that chip makers have been doing this sort of thing for decades – and charging extra for it." ""We are moving rapidly in the direction of realizing that people want unique things and they are go…

>> "several million" undocumented instructions.. is that right? Bear in mind that doesnt really mean that there are several million operations / opcode mnemonics which are undocumented but each distinct instructions. It is more likely they are "loose" decodings of other instructions, where changing a single bit of the opcode still causes the CPU to decode the same instruction. Toy example: If I encode my (imaginary I…

Correct me if I'm horribly misunderstanding [1], but isn't there a more general point here?

A CPU is, at root, a massive Boolean circuit wrapped in a flip-flop and some persisted state. The binary [sequence corresponding to an] opcode is just an input that determines which inputs go where.

Thus, for an n-bit opcode width, there are 2^n valid opcodes. Only m of them will correspond to intelligible, "I might want to use that some day" instructions. (Others, as you note, will be functionally equivalent versions of the m and ignorable as well.)

And so you will have 2^n - m "undocumented opcodes".

[1] based on reading NAND to Tetris

Re: Sandsifter: find undocumented instructions and bugs on x86 CPU

#67
post #36
post #27

Earlier quoted context omitted.

If anything, I'd expect such a flag to hide behind MSRs ( http://wiki.osdev.org/Model_Specific_Registers ) That's a mostly unused namespace of 2^32 64bit registers. To hide things even better, it would also be possible to change behavior based on officially unrelated registers (eg. MSR $x only acts as IME-switch if the calling address also ends in $y and esi is $z)

They could also be multiplexed (MSR $x is address/command, MSR $y is data). Or require a sequence of operations (write this magic sequence of numbers to MSR $z). Or memory-mapped/IO-mapped (with the mapping enabled/disabled by MSR or PCI registers). Or be locked by the BIOS during the boot sequence. But IMO, it probably can't be disabled at all. The "disabling" would be to change the program it runs to a program whic…

The easiest ways to access them is to rewrite that section of the BIOS directly, such as https://github.com/corna/me_cleaner/wiki/How-does-it-work%3F which literally overwrites them with nops

Re: Sandsifter: find undocumented instructions and bugs on x86 CPU

#68
post #34
post #7

tl'dr of the slides: Found on one processor... instruction Single malformed instruction in ring 3 locks Tested on 2 Windows kernels, 3 Linux kernels Kernel debugging, serial I/O, interrupt analysis seem to confirm Unfortunately, not finished with responsible disclosure No details available [yet] on chip, vendor, or instructions He's found a new f00f bug, winter 2017 is going to be interesting :)

Observation: the length of the censored "XXX hardware bug" text on the slides matches neither Intel, AMD nor Transmeta. Unlikely to be VIA too. Either it's deception or perhaps some obscure low-end embedded vendor. edit: for the curious, it's "(redacted) hardware bugs" :)

Or they were smart enough to change the size of the box so that it can't be used to easily identify the vendor (from among a very small set of candidates).

Re: Sandsifter: find undocumented instructions and bugs on x86 CPU

#69
post #49
post #7

tl'dr of the slides: Found on one processor... instruction Single malformed instruction in ring 3 locks Tested on 2 Windows kernels, 3 Linux kernels Kernel debugging, serial I/O, interrupt analysis seem to confirm Unfortunately, not finished with responsible disclosure No details available [yet] on chip, vendor, or instructions He's found a new f00f bug, winter 2017 is going to be interesting :)

If I was a betting man I would say ARM.

Isn't this fuzzing tool x86-only?

Re: Sandsifter: find undocumented instructions and bugs on x86 CPU

#70

This is great. That a program can learn about and exploit the CPU on which it is running from unprivileged userspace reminds me of the notion in Charlie Stross' Accelerando of running a timing attack against the universe to learn about the virtual machine in which we are being simulated.

I believe there was also a Rick & Morty episode about this (of course...)

You mean the first episode of the third season where Rick breaks out of the virtual reality interrogation room he was in, by simply presenting some data (i.e. equations) that turned out to be code that took control of the system?
Post reply on HN