Breaking the x86 Instruction Set

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ก.ย. 2024

ความคิดเห็น • 620

  • @ppp72957
    @ppp72957 7 ปีที่แล้ว +1075

    This guy is impressively good at what he does.

    • @Reth_Hard
      @Reth_Hard 7 ปีที่แล้ว +75

      Most of us was suspecting processors to have some dirty instructions hidden inside them, but this is certainly not an easy task to search for them. Sincerely, hats off to this guy!

    • @marshalcraft
      @marshalcraft 7 ปีที่แล้ว +8

      Not really, well known intel has entire independent risc processor for the purpose of remote monitoring, even when battery is off your intel pc can access microphone and listen to you talk.

    • @FlamingPhoenix40
      @FlamingPhoenix40 7 ปีที่แล้ว +17

      marshalcraft how? If your battery is off then the microphone won’t work...

    • @nfcopier1
      @nfcopier1 7 ปีที่แล้ว +6

      The battery may not be completely off. If the motherboard was designed to provide power to the microphone in the "off" state and provide enough power to the CPU to run the necessary instructions, remote monitoring may be possible. The only way to prevent it would be to remove the battery completely.
      However, monitoring may not be feasible. I expect the process would have to dump data to a hard drive, which would require a lot of power.

    • @bryede
      @bryede 7 ปีที่แล้ว +13

      Well, we occasionally find out that "secure" products have back doors and we know that the gov't frequently approaches tech companies requesting spy features, so we shouldn't be surprised if hidden ring bypass instructions turn up one day. I'm sure Intel was well compensated for them if they exist.

  • @tspshilt
    @tspshilt 7 ปีที่แล้ว +134

    The use of No Execute on memory to find instruction length made me go "oh man" out loud. Genius.

    • @fss1704
      @fss1704 6 ปีที่แล้ว +1

      nop nop

    • @rabebonskyjoe5193
      @rabebonskyjoe5193 2 ปีที่แล้ว +5

      and then AMD's #ud before #pf "bug" to circumvent this

  • @NiKi-hl4zs
    @NiKi-hl4zs 7 ปีที่แล้ว +267

    Oh man, that page fault analysis is genius.

    • @NiKi-hl4zs
      @NiKi-hl4zs 7 ปีที่แล้ว +19

      Guy Smith Intresting, it's the first time hearing it for me though. Just thought it such an creative way to test for instructions.

    • @joshuakuehn
      @joshuakuehn ปีที่แล้ว

      ​@@NiKi-hl4zswhy do the two of you have the same pfp

  • @JDManring
    @JDManring 7 ปีที่แล้ว +283

    I am jealous. Not only is this guy much more capable of mentally processing this complex information than I am, he's also incredibly good at presenting it!

    • @UPsideDOWNworld321
      @UPsideDOWNworld321 5 ปีที่แล้ว +2

      thats why he is speaking!! dum dum dum dum duummmmmmmmmmmmmmmmmmmmmmmmm

    • @zesjerome7189
      @zesjerome7189 5 ปีที่แล้ว

      no such thing as jealoux or capabx or good or not, cepu, do, say, think any nmw anda ny be perfect

    • @tjij-mbai
      @tjij-mbai 4 ปีที่แล้ว +1

      He's a Genius.

    • @BryanChance
      @BryanChance 3 ปีที่แล้ว +1

      He makes it easy to understand that I though I was good. :-)

    • @niks660097
      @niks660097 3 ปีที่แล้ว +2

      cause of hard work and countless hours spent hacking/reverse-engineering...

  • @wildwest1832
    @wildwest1832 6 ปีที่แล้ว +75

    its kind of scary how good some of these guys are at figuring these things out

    • @lbgstzockt8493
      @lbgstzockt8493 ปีที่แล้ว +6

      And this is just "some guy". Think of what a team of people like him with an evil motive could do.

    • @vincentschumann937
      @vincentschumann937 3 หลายเดือนก่อน

      @@lbgstzockt8493 especially if given a bottomles budget

  • @axeman2638
    @axeman2638 7 ปีที่แล้ว +309

    I just keep thinking how poor Terry Davis has wasted all his time.
    He needs to make his own silicon as well as his own compiler and OS.

    • @fss1704
      @fss1704 6 ปีที่แล้ว +40

      damn i'm in, atleast we got risc v

    • @alexwolf4604
      @alexwolf4604 5 ปีที่แล้ว +21

      RIP

    • @GBGSK
      @GBGSK 4 ปีที่แล้ว +18

      May his soul find rest and find the peace he deserves.. RIP dear Terry! ☹

    • @tsnp423
      @tsnp423 4 ปีที่แล้ว +3

      And all this in his own universe :)

    • @GBGSK
      @GBGSK 4 ปีที่แล้ว +10

      @@tsnp423 no not Universe.. the correct word would be *Reality*

  • @TheOz1999
    @TheOz1999 4 ปีที่แล้ว +19

    With Intel's ZombieLoad, PlunderVolt, Meltdown and more severe vulnerabilities these days, this video is more relevant than ever

  • @wiipronhi
    @wiipronhi 7 ปีที่แล้ว +223

    they should crowdsource the undocumented instructions the same way that pass mark gets benchmarks. Everyone uploads the results and a website shows a nice breakdown of what instruction run on what.

    • @jan_h
      @jan_h 7 ปีที่แล้ว +21

      I feel like already running sandsifter to be one of the first that uploads to that site when it inevitably starts existing

    • @JoshBeach
      @JoshBeach 7 ปีที่แล้ว +20

      github.com/rigred/sandsifter-tests

    • @fss1704
      @fss1704 6 ปีที่แล้ว +8

      +Josh Beach damn cool, i'd like to run this shit on the brazilian voting machines using cyrix..

    • @baileyharrison1030
      @baileyharrison1030 4 ปีที่แล้ว +1

      wiipronhi but if they do stumble across a secret instruction there’s a good chance it will mess up the OS operation. And an emulator wouldn’t have the instructions programmed into it anyway.

  • @ShadyNetworker
    @ShadyNetworker 7 ปีที่แล้ว +65

    Goddamn, did Intel send assassins after this guy or what?

    • @morwar_
      @morwar_ 4 ปีที่แล้ว +18

      They hired him.

    • @AbhishekBM
      @AbhishekBM 3 ปีที่แล้ว +1

      @@morwar_ To expose themselves?

    • @morwar_
      @morwar_ 3 ปีที่แล้ว +9

      @@AbhishekBM No, my guess is that what he knows is valuable.

    • @KishoreG2396
      @KishoreG2396 หลายเดือนก่อน

      He works for Intel now

  • @sangamo38
    @sangamo38 5 ปีที่แล้ว +14

    My god that page fault technique is so awesome. So clever

  • @kopuz.co.uk.
    @kopuz.co.uk. 7 ปีที่แล้ว +138

    It's good to see Black Hat uploading videos unlike the other popular tech conference.

    • @meithecatte8492
      @meithecatte8492 7 ปีที่แล้ว +28

      Mp57navy it's the name of the conference...

    • @torpcoms6428
      @torpcoms6428 7 ปีที่แล้ว +18

      CCC uploads all of their videos too, as does Defcon, and FOSDEM; HOPE only keeps official audio recordings; which conference are you referring to?

    • @Gunth0r
      @Gunth0r 7 ปีที่แล้ว +3

      The secret one?

    • @y__h
      @y__h 6 ปีที่แล้ว +6

      Torpcoms Maybe he meant That-Conference-That-Do-Not-Upload-The-Video-Immediately

  • @ruthlessadmin
    @ruthlessadmin 7 ปีที่แล้ว +81

    This is why open source is so important. I would love to see a viable open CPU alternative emerge, on the scale of Linux in the software world. It's not impossible, but it would be a much different and more challenging problem to solve.

    • @jastrckl
      @jastrckl 7 ปีที่แล้ว +10

      already exists. SPARC.

    • @ruthlessadmin
      @ruthlessadmin 7 ปีที่แล้ว +6

      Thanks..I was aware of SPARC but didn't realize it was open source. I'm also aware of some other open source CPUs. Still, I don't think it quite meets the mark for a genuine competitor to x86. I mean, I can go out and buy a laptop running Linux but I don't think I can go buy a laptop with a SPARC so easily....

    • @kunou4527
      @kunou4527 7 ปีที่แล้ว +5

      Problem here is licensing. It can't be GNU. Would need to be BSD based to entice innovation and protection of intellectual property. Which means the option to not release certain intellectual property for free. Or rather, the freedom to not be compelled to do so at the cost of the innovator.

    • @y__h
      @y__h 7 ปีที่แล้ว +7

      Kunou RISC-V is BSD-licensed ISA.

    • @bertdowns8186
      @bertdowns8186 6 ปีที่แล้ว +3

      RISC V. Linus tech tips made a video on it recently...

  • @ehsnils
    @ehsnils 7 ปีที่แล้ว +18

    Really good. Having done some Z80 programming once upon a time I know that some undocumented instructions are merely side effects of the microcode and not necessarily intentional. But the point is to figure out the instructions that really are intentional and undocumented.
    Unintentional undocumented instructions could of course be fun too if you want to do some "smart" programming, but don't expect them to work in the next generation of processors.

  • @desmond-hawkins
    @desmond-hawkins 3 ปีที่แล้ว +49

    It looks like the "halt and catch fire" instruction he describes starting at 38:46 was never described publicly, at least that I could find. As he explains in this talk there was no time for vendors to address the issue under responsible disclosure so he couldn't give all the details at Black Hat 2017, but I couldn't find any reference to publications in the following months as he said would happen. There's a question about it on the Reverse Engineering StackOverflow site, but no one seems to know. I'm not particularly looking for a way to execute this instruction, but I'm curious to know if any mitigation was possible for CPUs that had already shipped. If anyone knows and has a reference this would be much appreciated.

    • @memerichment
      @memerichment 3 ปีที่แล้ว +9

      Thanks for following this up! I was extremely curious as well.

    • @javaguru7141
      @javaguru7141 2 ปีที่แล้ว +7

      Also hoping to hear more about it eventually. It's been a while.

    • @BruceDuncan
      @BruceDuncan ปีที่แล้ว +11

      Where are you, Domas? What did you learn?!

  • @tom7
    @tom7 7 ปีที่แล้ว +92

    Neat talk!

    • @alexst-laurent5272
      @alexst-laurent5272 7 ปีที่แล้ว +14

      Oh hey! It's Tom! Love your learnfun and playfun videos and programs, it's really fun editing the code and seeing if I can optimize the behavior, and it's also just plain hilarious to run them on hacked roms, especially speedhacked ones. Have you considered doing more work on them?

  • @Baigle1
    @Baigle1 7 ปีที่แล้ว +39

    Link to GitHub repositories!
    github.com/xoreaxeaxeax/sandsifter

    • @dirtbikersteve
      @dirtbikersteve 7 ปีที่แล้ว +2

      THANK YOU!

    • @JoshBeach
      @JoshBeach 7 ปีที่แล้ว +1

      Github test results repo
      github.com/rigred/sandsifter-tests

  • @rogerflores9470
    @rogerflores9470 7 ปีที่แล้ว +7

    A brilliant talk showing persistence and out of the box thinking. As pointed out, the time is well past for trusting the docs of closed hardware designs!
    I need to go now and think about working the ideas into my disasm and emulator.

  • @jemakrol
    @jemakrol 3 ปีที่แล้ว +9

    This is so well done in every aspect. There are smart people and there are people like this, that goes beyond that. Well performed presentation.
    As of 2021 I find surprisingly little follow up info on that Halt and Catch Fire instruction - dunno if that's me sucking in searching or that the disclosure still apply.

  • @reversEngiener
    @reversEngiener 7 ปีที่แล้ว +2

    Wow. This just shows me I need to brush up on my awful, awful assembly skills. Hats off to Christopher Domas.

  • @puellanivis
    @puellanivis 7 ปีที่แล้ว +5

    TL;DR: This tool is awesome, thanks for writing it, good thinking all the props.
    So, some thoughts, sometimes undocumented instructions can be implemented across multiple architectures because it is simply a logical extension of the architecture that isn’t actually documented, but putting in the logic to block those undocumented instructions is more work than it is worth. (i.e. undocumented, or “behaviour undefined” register combinations) similarly, a short-cut in implementation (pinning a behaviour-changing mux to a specific bit of the opcode, rather than actually decoding it) A good example here is the SL1 instruction on the Z80 processor. The three instructions SRA, SLL, SRL are combined in a quad-structure with a section of missing shift-left instructions. Actually executing these instructions results in a shift-left then set bottom-bit. Likely as a result of opcode bits being pinned to muxes.
    Additionally, there is still a worth in specifications. Specifications detail what is _expected_ behaviour, and what one can rely upon. As such, there’s a giant chasm of instructions that may work at the time, but are not guaranteed to work in the future, or even potentially after a microcode update.
    So, we get this horrible area, where like the 66 e9 instruction, good software should never include this instruction, because it is non-standard and “a valid implementation of undefined behaviour is to make monkeys fly out of the user’s butt”, but meanwhile, the processor still accepts these instructions, and can potentially then be malicious.
    At the same time, you can’t _really_ trust that only malicious code uses these instructions… so… poop.

  • @xoloser3
    @xoloser3 7 ปีที่แล้ว +10

    Thanks for the talk! You used such fascinating methodology to carry out this project. Definitely learned a lot, not just about hidden instructions but also software searching techniques.

  • @233kosta
    @233kosta 3 ปีที่แล้ว +9

    I should imagine a lot of these undocumented instructions would be work in progress, perhaps left there for eventual future use, perhaps used to reduce the cost of prototyping, but the coordination between x86 manufacturers does raise some serious concerns. These could be anything from hyperoptimised inverse square root calculations to deliberate holes in x86 security, put in place for "the right people"... See "idiocy of back doors"...
    It could also be as simple as Micro$oft (or Apple?) paying them a handsome sum of money to implement a custom instruction set just for them without telling anyone.

  • @edmund-osborne
    @edmund-osborne 5 ปีที่แล้ว +7

    Finally! Someone speaking at a tech event who isn't a stuttering incompetent mess onstage!

    • @Walter_
      @Walter_ 5 ปีที่แล้ว +5

      You gotta realize these sorts of people are specialized hard into 1 thing.

  • @qualityedits3083
    @qualityedits3083 2 ปีที่แล้ว +2

    what a talk! phenomenally creative, important, and useful. i understood almost all of it despite knowing next to nothing about x86, barely anything about process/OS security schemes and how their traps/exceptions are passed around, what the rings mean, and just generally being very new to OS and hardware stuff.

  • @JasonMasters
    @JasonMasters 7 ปีที่แล้ว +10

    Undocumented instructions have been around at least since the Z80 and perhaps before then. This is an 8-bit CPU which uses a separate 16-bit address bus.
    The Z80 has two 16-bit index registers, IX and IY, intended solely for indirectly accessing memory, but people noticed that the binary code for accessing these registers was just one byte to say "Use IX" or "Use IY" followed by exactly the same instructions used to access the HL register pair, which are two 8-bit registers which can be used together as a 16-bit address.
    Since the H and L registers can be used as separate 8-bit registers, people decided to try adding the "Use IX" or "Use IY" byte in front of the 8-bit H or L register instructions and discovered that they could access IXH, IXL, IYH and IYL as 8-bit registers.
    Many programmers then wrote an include file which defined these undocumented instructions as macros so they could use them directly in their programs.

    • @panteltje
      @panteltje 7 ปีที่แล้ว +3

      Nice to hear about the Z80, learned asm programming on that long time ago.
      My coding style comes from this book by professor Miller (bing will find it online);
      8080-Z80AssemblyLanguage-TechniquesForImprovedProgramming.pdf
      Appendix J mentions those instructions.

  • @bkiffter
    @bkiffter 7 ปีที่แล้ว +141

    Maybe a stupid question, but how does the cursor keep blinking if the CPU is locked up?

    • @TheHuesSciTech
      @TheHuesSciTech 7 ปีที่แล้ว +193

      The graphics card does the blinking. The cursor blinking was literally done by special circuitry back in the days of text-only computers decades ago when the CPU couldn't possible spare CPU cycles to blink a cursor. And since there's been a continuous evolution of compatible machines ever since, the graphics hardware has never been relieved of that responsibility. Of course, modern GPUs can handle that in their sleep. (If the bug was demonstrated in a Graphical UI, then it probably would freeze.)

    • @zesjerome7189
      @zesjerome7189 5 ปีที่แล้ว +25

      no such thing as stupix qor not

    • @matheusrodrigues9653
      @matheusrodrigues9653 3 ปีที่แล้ว +1

      @@TheHuesSciTech eu ia morrer sem saber disso

    • @AlexSKelly-up7lf
      @AlexSKelly-up7lf 3 ปีที่แล้ว +2

      @Brick It really is, not only because it would have been difficult to come up with, but also because it would be easy to think something else entirely. I thought it would only stop executing instructions in a specific ring or something like that.

    • @Lucas_Simoni
      @Lucas_Simoni 2 ปีที่แล้ว +1

      I had some glitch on nvidia drivers on ubuntu that would show up some previous image sprites that were on my windows after I restarted and dual booted into it, it was something related to dual monitor (it didn't work out of the box, I never bothered to fix it), I have no idea how possibly that could have happened, how some sort of buffer could have survived a system restart, but somehow some internal gpu buffer survived, and I never seen anyone talking about that online. It also seems like the cursor is accelerated by the the GPU too, and probably a lot more going on.
      Check this video out:
      [PS2 vector unit demonstration Using only 16K of working space; NONE of the ps2 main CPU was used: th-cam.com/video/qlQhJCuBYsE/w-d-xo.html]
      Also, in other video game consoles, there is a lot of GPU compute that happens independently of the main CPU, search for architectures for the gameboy advanced, nintendo ds, nes, etc.

  • @MrtinVarela
    @MrtinVarela 7 ปีที่แล้ว +255

    *"jk i'm malicious af"*

  • @justabelief5119
    @justabelief5119 6 ปีที่แล้ว +3

    When I was a kid guys like this were the rockstars and astronauts to me.

    • @MickeyMishra
      @MickeyMishra 2 หลายเดือนก่อน

      I still feel the same way today in 2024 and I never grew up.
      Toys R Us kid till the end!

  • @Donaldo
    @Donaldo 7 ปีที่แล้ว

    This talk takes a while to get interesting but it's worth it

  • @olbluelips
    @olbluelips 4 หลายเดือนก่อน +1

    Still my favourite talk

  • @tacokoneko
    @tacokoneko 7 ปีที่แล้ว +105

    32:56 *_This man is claiming that it would be possible to write a malicious program that is completely benign and undetectable on any x86_64 computer that is not using a physical Intel CPU, but when executed on a computer with an Intel CPU it could arbitrarily execute whatever otherwise deliberately avoided lines of ASM the programmer desired, and also vice versa by inverting the principle._* That's the killing blow of this video and, if his demonstration is true, means that nobody should be using x86 CPUs for cryptography of any meaningful level of security.

    • @lawrencehook
      @lawrencehook 7 ปีที่แล้ว +34

      His claim applies to all processors. Intel just happens to be the most popular, thus relevant one.

    • @tacokoneko
      @tacokoneko 7 ปีที่แล้ว +19

      actually if you click on the timestamp at the beginning of my comment he is literally saying that a difference between intel and amd (+via) is what causes the vulnerability to exist. it could be said that intel is at fault because their noncompliance with their own documentation is what causes the problem. however all cpu manufacturers are at fault for everything he finds with his method, as he goes on to reveal a pentium f00f-like CPU hardlock he purportedly discovered in an AMD CPU.

    • @feppfepp
      @feppfepp 7 ปีที่แล้ว +5

      The behavior of 0x66 with jumps is well-documented since quite some time. This is just tools not being correct visavi the spec, which is pretty common to be honest for a complex spec. The fact that AMD processors behave differently is a compounding of the problem, however. Qemu is not an instruction set reference by a long shot; it is a best-effort project - and there are likely many other similar bugs to be found. When using VT-x to run, you would get the right results.

  • @samm3417
    @samm3417 2 ปีที่แล้ว +1

    I watched this video 𝟓 𝐓𝐈𝐌𝐄𝐒!... not because I didn't understand it but because it's just wonderful and so INTERESTING. Amazing Black Hat

  • @snooks5607
    @snooks5607 7 ปีที่แล้ว +9

    holyfuck. I might be high, but tell me if that wasn't the best blackhat talk yet?

    • @unvergebeneid
      @unvergebeneid 7 ปีที่แล้ว

      Save the best for last as they say.

    • @fss1704
      @fss1704 6 ปีที่แล้ว +2

      damn yeah what kind of person doesn't get excited over ring -1 stuff....

  • @Roxor128
    @Roxor128 7 ปีที่แล้ว

    I think this was 80% nifty and 20% scary. Nifty for coming up with that approach for finding undocumented opcodes. Scary for the fact that so many were found.

    • @fss1704
      @fss1704 6 ปีที่แล้ว

      i couldn't agree more with your words, literally.

  • @JG-tk3cd
    @JG-tk3cd 7 ปีที่แล้ว +5

    This guy is a genius

  • @xDR1TeK
    @xDR1TeK ปีที่แล้ว +1

    Remarkable person with a unique mind.

  • @bit2shift
    @bit2shift 7 ปีที่แล้ว +23

    Most of those undefined opcodes could be what LAX was on 6502: opcodes without explicit microcode.

    • @bryede
      @bryede 7 ปีที่แล้ว +8

      With simple processors like the 6502, you could enable parts of more than one instruction because the opcodes weren't discretely decoded. On a modern CPU, a working instruction is most likely intentional.

    • @bit2shift
      @bit2shift 7 ปีที่แล้ว +1

      bryede the thing is: we don't know the exact internals of x86 like we do with 6502 because it's closed hardware and it's constantly changing with each new microarchitecture iteration.

    • @bryede
      @bryede 7 ปีที่แล้ว +5

      Right, but the x86 is fully microcoded and it can even be updated in the field. This means instructions point to specific internal sequences to be executed. When you find a sequence that works without throwing an exception, it probably means there's something in the table. It doesn't mean it's top secret functionality, but it might be. On the 6502, the undocumented opcodes came from enabling more than one instruction because the sequencing ROM was optimized for size and is built out of fragments that can overlap with illegal bit combinations.

    • @bit2shift
      @bit2shift 7 ปีที่แล้ว +2

      bryede several millions of undocumented instructions would require a fairly big microcode ROM, so we can speculate that there's overlap between some of the documented and some of the undocumented.

    • @bryede
      @bryede 7 ปีที่แล้ว +5

      Right. Because of how the instructions are prefixed and expanded in a byte-wise fashion, you don't need a table supporting all bit combinations, but rather you move from one 256-entry table to another. I'm just saying all unused byte entries are supposed to throw an exception. Just modifying instructions with prefix bytes won't.

  • @leberkassemmel
    @leberkassemmel 7 ปีที่แล้ว +46

    Oh my. That's why I love my RISC CPU. Those x86 CPUs are so complex!

    • @dangi12012
      @dangi12012 7 ปีที่แล้ว +8

      Well have fun writing fast software for RISC. Cisc is the way to go because you need less instructions to get more stuff done. Like sqare root in 1 op.

    • @DarklinkXXXX
      @DarklinkXXXX 7 ปีที่แล้ว +14

      HD_Picard Thanks to significant microarchitectural advances in CPU design in the last couple decades, the number of instructions executed is no longer relevant to execution speed.

    • @firefly618
      @firefly618 7 ปีที่แล้ว +36

      I have good news for you: x86 has been a RISC CPU for decades. The bad news: it's running a proprietary real-time OS known as "microcode" that emulates the CISC ISA and does all manner of shenanigans behind your back.

    • @IljaSara
      @IljaSara 7 ปีที่แล้ว

      Waiting and waiting and waiting for some company to push out some RISC-V ISA based CPU for consumers.

    • @IljaSara
      @IljaSara 7 ปีที่แล้ว

      If you completely disable the microcode, could you run code on "bare metal"?

  • @luisponce3580
    @luisponce3580 4 ปีที่แล้ว +2

    This is truly disturbing. This guy was able to do this single handed (of course we can assume that a lot of people helped him, im too lazy to watch the video again to see if he said that he was not alone in this project), imagine what a group of malicious people, that literally do this all day, can actually do? I imagined these "malicious people" have literally all the backdoors in every single [Intel, Amd] hardware (processors) . If they were to find and fix a vulnerability, the "malicious people" still have the rest. But what do i know :) im just a student, and I am sorry for my english, I hope you still be able to get my concerning point.

  • @MrHatoi
    @MrHatoi 4 ปีที่แล้ว +4

    This guy is going to mysteriously disappear one day in events which Intel can claim plausible deniability for.

    • @tienatnguyen8899
      @tienatnguyen8899 3 ปีที่แล้ว

      Decided to look him up after watching this video, his linked in, twitter and github all seem to be abandonned since 2018. Maybe they pay enough and he didn't want to keep a high profile, maybe what you said

  • @lohphat
    @lohphat 3 ปีที่แล้ว +2

    My guess is many undocumented opcodes just do nothing. My guess the number of really secret opcodes are few, they just treat the potential execution paths as NOPs.
    Complex CISC CPUs use microcode to decode instructions so just routing them to NOP is more economical.
    However I still am concerned that the OEMs have included opcodes which may only be used for debugging but are vectors for abuse. What’s worse, some of the vulnerabilities may require several undocumented opcodes to do something so just poking single opcodes isn’t enough to scope the problem set.

  • @caliniaru1673
    @caliniaru1673 2 หลายเดือนก่อน

    Extremely captivating!

  • @slookify
    @slookify 3 ปีที่แล้ว +1

    so much respect for those smart people

  • @EdPin_
    @EdPin_ 7 ปีที่แล้ว

    Information dense talk in a manner of John Carmack.
    Now i need time to digest.
    Awesome.

  • @tkothadev
    @tkothadev 3 หลายเดือนก่อน

    22:26 ok this part genuinely looks like what you would see in hollywood movies

  • @cataria3903
    @cataria3903 7 ปีที่แล้ว +1

    great stuff! hopefully resulting in some good microcode updates and more secure cpus in the future.

  • @joemama-js6hv
    @joemama-js6hv 5 ปีที่แล้ว

    ok woah.. this guy has some impressive talks here. a bright mind for sure.

  • @hoshinova9791
    @hoshinova9791 6 ปีที่แล้ว +53

    Oh boy. And now it's been revealed that Intel chips created in the past decade have a kernel memory leak "bug"/backdoor. Well, at least the Intel CEO sold as many shares as he could during Q4...

  • @georgetroulis
    @georgetroulis 7 ปีที่แล้ว

    Incredible job done presenting this critical topic. Keep up the good work :)

  • @djdeluxe76
    @djdeluxe76 3 ปีที่แล้ว

    10:25 when you make the processor roll over for you, you know you're next level

  • @kbabioch
    @kbabioch 7 ปีที่แล้ว +8

    Great talk, nice ideas!

  • @gblargg
    @gblargg 4 ปีที่แล้ว +1

    His search scheme seems to exclude some possibilities. From what he described, if say 00 xx is a two-byte instruction, he checks 00-FF for xx. Then he goes back and checks the length of 01. If it's also two bytes as before, he then doesn't search 01 xx, assuming that the last byte won't do anything special. But what if 01 00 is a three-byte instruction, or 01 23 is a three-byte instruction?
    Essentially, he seems to assume that there won't be two different types of instructions of the same length, next to each other in his search order. That is, if say 00 is a two-byte instruction, 01 is a one-byte instruction, and then 02 is a two-byte instruction, he will properly search both two byte instructions' second bytes, but if instead 00 and 01 are the two-byte instructions, he won't search the second one.
    Later he says he has the instruction at the end of a page to use a page fault to detect instruction length. I'd be wary of trusting that mechanism, especially for hidden instructions. I'm sure I've read errata for processors where instructions near or crossing a page boundary have issues.

  • @omgjingles
    @omgjingles 6 ปีที่แล้ว +1

    I understood nothing, but enjoyed it.

  • @memadmax69
    @memadmax69 7 ปีที่แล้ว +1

    I like this.
    But my approach would be more like: Ok, put the candidate processor to be scanned on it's own, isolated mainboard/breadboard/experimental board, and feed the candidate processor instructions from another machine.
    That way everything is nice n isolated during crashes and could make scanning the ENTIRE instruction set faster and more reliable.

    • @fss1704
      @fss1704 6 ปีที่แล้ว

      i saw some shit like that already... don't remember where.

  • @dtm303909
    @dtm303909 7 ปีที่แล้ว +19

    Ok thanks for this talk. Just confirmed an old acquaintance must work for an intelligence agency. He told me this in 98 but was drunk and denied saying it after.. Lol..

  • @stalinvlad
    @stalinvlad 7 ปีที่แล้ว +2

    Fantastic thinking, using PF to find the instruction length, reminds me of when I learnt how traceroute works, ping with TTL 1, ping with TTL 2 etc. And then learning the DNS of assembly is BSing you! And cross platform (Intel.AMD, VIA) GOD BLESS AMERICA

  • @sent4dc
    @sent4dc 7 ปีที่แล้ว +4

    Wow, that is amazing! Just curious though, any updates on that Ring3 DoS instruction that locked up his CPU?

  • @douro20
    @douro20 3 ปีที่แล้ว

    8086/8088 processors had an instruction prefix interrupt bug which wasn't fixed until the 80c88 was introduced. There was also a rather critical bug in early 8086/8088 processors which would cause an interrupt immediately after a MOV SS or POP SS to push data off the stack into an incorrect memory location, causing data corruption.

  • @mohammadkaif3868
    @mohammadkaif3868 5 ปีที่แล้ว

    thank yu very much yu have rightly guided me to pursue a career in reverse engineering software yu are actually a genius and open sourcing those software tools makes yu true master in your field yu can turn those software tools into million dollar startup

  • @PvblivsAelivs
    @PvblivsAelivs 3 ปีที่แล้ว +1

    A few things come to my mind:
    He talks a lot about "trusting" the processor. I don't think that anyone truly trusts the processor any more than they trust the software. We just have fewer options when it comes to the processor. We can either use a computer or not use it.
    If I were nefarious and wanted to hide a secret instruction, a couple good candidates would be an "undefined" opcode with ESI and EDI set to special values or DS: MOV AL, AL (an effective no-op that no one would ever use) again with ESI and EDI set to special values.
    The gaps in the op-code table are supposed to be values that do not correspond to an instruction. They may be filled in by later processors. This is, after all, how the processors have evolved.
    He says he is doing the entire thing in ring-3. I happen to know that accessing the CR2 register requires ring-0 access. Maybe the operating system is facilitating some of these things. But it still struck me as odd.
    Setting all the registers to zero is a good start. But some of those instructions include address offsets, which can still overwrite your "supervisor" code. (Okay, he addresses this one.)
    As for the priority error for undefined opcode vs page fault: Yes, it is an erratum. They decided it was a documentation error and fixed their documentation. First off, I can see where they might miss this. Very few people, outside of maybe myself, are going to deliberately execute an undefined instruction over a page-faulting area. Admittedly, I do a few unusual things. I have used MOV CS, AX as a processor check (runs fine on 8088, undefined opcode on 286, man I'm old.)
    I miss the days when computers would detect a processor shutdown and just reset the processor. You could use certain memory locations to tell the BIOS where to resume execution. Ah, good times, shut the processor down 20 times and return to DOS like nothing ever happened.

  • @analkarldervierte1759
    @analkarldervierte1759 7 ปีที่แล้ว +11

    26:53 **Puts on tin foil hat**
    No seriously, that shit's scary

  • @347573
    @347573 7 ปีที่แล้ว +1

    Mind blowing!! Neat and complete... bravo!! :)

  • @mrflamewars
    @mrflamewars 6 ปีที่แล้ว +12

    Well this video is certainly a great deal more relevant. Fuck.

  • @A-Milkdromeda-Laniakea-Hominid
    @A-Milkdromeda-Laniakea-Hominid 7 ปีที่แล้ว

    I am reminded of Joe and Gordon running current through every pin of an early 80s IBM, resulting in that 2 inch thick blue binder, which Cameron was subsequently legally barred from reading it while she coded the BIOS for "The Giant."

    • @fss1704
      @fss1704 6 ปีที่แล้ว

      can you send a link...?

  • @devrim-oguz
    @devrim-oguz 4 ปีที่แล้ว +5

    The only true way to know is to reverse engineer the die. There might be some secret knock codes that is outside the instruction space that could enable special functionality.

    • @maksymiliank5135
      @maksymiliank5135 2 ปีที่แล้ว

      probably not. Why would they create something like that, invest their time and money and never use it again? Idk

    • @majorfallacy5926
      @majorfallacy5926 ปีที่แล้ว

      @@maksymiliank5135 espionage backdoors. There's a reason china wants its own silicon so badly

  • @FamilienSoelberg
    @FamilienSoelberg 7 ปีที่แล้ว +2

    You are my favorit! Love your stuff.

  •  7 ปีที่แล้ว +57

    Has the hardware bug been disclosed yet?

    • @MagicBoterham
      @MagicBoterham 7 ปีที่แล้ว +5

      Not to me, at least.

    • @hjembrentkent6181
      @hjembrentkent6181 6 ปีที่แล้ว +2

      Bump.

    • @y__h
      @y__h 6 ปีที่แล้ว +1

      Dunno yet, but today some people hinted at a whole new family of Spectre-class vulnerability.

    • @devlogged7633
      @devlogged7633 5 ปีที่แล้ว +3

      @@y__h This aged quite well haha

  • @ropersonline
    @ropersonline 3 ปีที่แล้ว +2

    So did he ever post an update to the undisclosed bug he talks about at 38:43?

  • @benjaminbrady2385
    @benjaminbrady2385 4 ปีที่แล้ว +1

    This has been fascinating!

  • @_zproxy
    @_zproxy 7 ปีที่แล้ว +16

    good stuff

  • @arthurjohnson4144
    @arthurjohnson4144 3 ปีที่แล้ว +2

    I think the history of intel and the whole x86 ISA is pretty cool and everything but cpu's should definitely be open source/ FOSH

    • @qualityedits3083
      @qualityedits3083 2 ปีที่แล้ว

      100%. in the sane socialist world of the future all hardware and software is open, moddable, repairable, auditable, modular, standardised, and widely compatible - and thus safer, simpler, faster, better

  • @Lucas_Simoni
    @Lucas_Simoni 2 ปีที่แล้ว +1

    I'm afraid of running that and NOT GETTING A BLUE SCREEN/KERNEL PANIC, and the CPU just corrupting some files, or doing something crazy with the OS, etc. I'd run with my storage detached physically from the motherboard and no network cards online.

  • @kcw8886
    @kcw8886 10 หลายเดือนก่อน

    Interesting! Generally speaking, should the problem of undocumented instructions also be relevant for RISC as well? Even with an open architecture, implementation can be (and likely will be) done secretly. Manufacturers are risking their brand name to have these hidden instructions that they may lose track of.
    Agree with the concept of developing more universal tools to audit our hardware. We shouldn't only audit software.

  • @MrocznyTechnik
    @MrocznyTechnik 6 ปีที่แล้ว +39

    "You can fool all the people some of the time, and some of the people all the time, but you cannot fool all the people all the time."
    (Abraham Lincoln)

  • @AbdulelahAlJeffery
    @AbdulelahAlJeffery 7 ปีที่แล้ว +33

    you know he's really good at what he's doing when he speaks at 200 k/h

    • @tjij-mbai
      @tjij-mbai 4 ปีที่แล้ว

      It takes one to know one.

  • @niter43
    @niter43 7 ปีที่แล้ว +4

    15:40 how that is truth? I thought we don't relay on what's said in documentation and it's sounds like a good idea to hide backdoor/hiden instructions by continuously throwing exceptions.

  • @JwopDk
    @JwopDk 7 ปีที่แล้ว +1

    I don't know heaps about x86 but it seems like it could REALLY do with a "lite" version, with the same speed and set of _useful_ instructions; nothing undocumented, useless or too obscure. I bet people have thought of this before, so why doesn't it something like this exist, or if it does, why haven't I heard of it?

    • @fss1704
      @fss1704 6 ปีที่แล้ว

      a qemu processor is what you want, i know i want one too man, a shame they don't exist.

  • @DougCube
    @DougCube 7 ปีที่แล้ว

    This is awesome! This guy's very resourceful to come up with these tools. Questions tho... Why wouldn't a processor's Instruction Cache prefetch generate the page-fault much earlier than when the straddling instruction was hit?

  • @gnagyusa
    @gnagyusa 7 ปีที่แล้ว +1

    Awesome. Pretty clever tricks!

  • @damionyates1
    @damionyates1 3 ปีที่แล้ว +1

    About 6m40s in it says #40 is a single byte instruction `inc eax`. I assumed an #40 would cause a situation where if `ax` reached #ffff it would go back to #0000 and set the carry flag, but #66 #40 should increment eax to #00010000. There are several other minor factually confusing statements throughout the video. On the whole this is a great talk and seems to be presented by an absolute expert so now I'm doubting myself.

    • @qbasicmichael
      @qbasicmichael 3 หลายเดือนก่อน

      First of all, inc and dec do not affect the carry flag. An overflow will set the zero flag, but not the carry flag. As for the rest, i think it depends on whether you're executing in 16 or 32 bit mode. If you're in 16 bit mode, then 40 is inc ax, and 66 40 is inc eax, as you describe. If you're in 32 bit mode, then 40 is inc eax, and 66 40 is inc ax, as he describes.

  • @iMPRE7ed
    @iMPRE7ed 7 ปีที่แล้ว

    This is actually something amazing

  • @davivify
    @davivify 7 ปีที่แล้ว

    Couldn't help but notice the venue for your seminar. Kind of puts a different slant on things, doesn't it? What a difference a couple of months can make.

  • @JOHNSMITH-ve3rq
    @JOHNSMITH-ve3rq 3 ปีที่แล้ว

    absolutely incredible stuff.

  • @EnsignRho
    @EnsignRho 7 ปีที่แล้ว +1

    Awesome. Excellent presentation. Am unable in late October, 2017 to yet find disclosure on the new HCF bug.

  • @Antagon666
    @Antagon666 3 ปีที่แล้ว

    This is really well explained.

  • @JohnJTraston
    @JohnJTraston 4 ปีที่แล้ว +5

    One thing I don't like about this approach is that he doesn't even try to analyze what's going on processor pins, physically I mean. How do you know it's locked? Because it doesn't respond to the keyboard? Maybe there is still a lot of other activities happening on the data and/or address buses and what not. Especially with modern SoC processors that have a lot of built-in periphery on the chip.

  • @SarahC2
    @SarahC2 6 ปีที่แล้ว +4

    Hidden instructions BETWEEN chip manufacturers = NSA. 26:00

    • @ujiltromm7358
      @ujiltromm7358 3 ปีที่แล้ว

      ... Or simply one manufacturer licensing the instruction set to the other, and implementing them all for inter-compatibility reasons.

  • @stonent
    @stonent 7 ปีที่แล้ว +1

    What concerns me is let's say he executes one of these unknown instructions and it alters the way the processor executes a currently benign instruction. Perhaps changing a jump and read to a jump and execute. I'm not saying it's changing the hardware, I'm saying maybe this instruction is inside the processor for a reason that we're not supposed to know about. Such as this instruction flips a bit that diverts an execution pipeline to a part of the processor that has been idle for years that now is operating under an altered instruction set. So I suppose that when this scanning tool is run, you should probably run it numerous times to see if you find some different results during the second pass, indicating a new instruction or instruction set has been enabled. (I'm talking like NSA level stuff)

    • @stonent
      @stonent 7 ปีที่แล้ว +1

      Another thing that needs to be addressed is capturing what microcode level is being used in the processor. When you flash your bios on your computer, the motherboard vendor will frequently add microcode revisions to the bios that patch bugs in the CPU, but they could also activate or disable these things you weren't supposed to know about. The same thing with silicon revisions and steppings. Those are hardware alterations to the CPU internally.

  • @doctorweile
    @doctorweile 7 ปีที่แล้ว

    The man is a genius!

  • @Ultrajamz
    @Ultrajamz 7 ปีที่แล้ว +112

    Intel ME, AMD PSP...

    • @foobargorch
      @foobargorch 7 ปีที่แล้ว +32

      Ultrajamz technically not part of it the ISA, a whole other layer of shit... Joanna Rutowska has a very long review of the problems with the arch, x86 considered harmful. there's also a great paper on doping attacks in the fabrication process that can reduce the rng entropy, so even if the spec is good the chip itself might not be... It's all so rotten to its core, we really need open hardware and auditable fabrication

    • @RogerBarraud
      @RogerBarraud 7 ปีที่แล้ว

      Johanna *

    • @RogerBarraud
      @RogerBarraud 7 ปีที่แล้ว

      Rutkowska*

    • @torpcoms6428
      @torpcoms6428 7 ปีที่แล้ว +1

      That happens with older ME versions as well, anything past Penryn has a 30 minute reset timer. mail.coreboot.org/pipermail/coreboot/2016-September/082021.html

    • @torpcoms6428
      @torpcoms6428 7 ปีที่แล้ว +4

      Yes; also nothing except ME11 is even using x86. AMD's ASP/PSP is an ARM core, and ME versions 10 and below were ARC cores.

  • @ongunkanat
    @ongunkanat 4 ปีที่แล้ว +3

    Does anybody have a link for full disclosure?

  • @notgate2624
    @notgate2624 2 ปีที่แล้ว

    Incredible talk

  • @SupLuiKir
    @SupLuiKir 7 ปีที่แล้ว +12

    It seems like exploiting a f00f-like bug (where it stops the processor) could be a more efficient DDOS-like attack provided you can manage to run unsigned code. Just get a company's servers to execute the processor stop instruction and they'll have to reboot all their computers. If you set it to run on startup, then they'll be locked out of their OS, forcing them to solve the issue from the BIOS.

    • @meithecatte8492
      @meithecatte8492 7 ปีที่แล้ว +5

      it's DoS, not DDoS! I don't understand why your comment is here, since all of this was said in the talk. Also, your nickname... is this the stop instruction? Did you not hear about responsible disclosure ;)

    • @johnnycochicken
      @johnnycochicken 6 ปีที่แล้ว

      They carefully wrote "DDoS-like" and were talking about a specific scenario

  • @arieaharon5487
    @arieaharon5487 3 ปีที่แล้ว +9

    Many assumptions and flaws in the method for example:
    Assuming #UD means the instruction does not exist is believing the HW manual
    which is a contradiction to the base line assumption we should never trust the manual.

  • @MarioManTV
    @MarioManTV 7 ปีที่แล้ว +1

    Not super familiar with these architectures, but isn't it feasible to have certain combinations of instructions be used to cause specific, hidden behaviors? Seems like something that this tool would miss.

  •  4 ปีที่แล้ว

    6:09 if it's empty id doesn't necessary mean they didn't want to tell you it can also mean that they didn't implement it yet or it might be some random instruction that's just result of CPU architecture that wasn't meant to exist so it could just do some random stuffs...

  • @panteltje
    @panteltje 7 ปีที่แล้ว +3

    Nice presentation, i just sucked it in being an avid asm programmer....
    It is a well known problem.The only way around it for REALLY high security applications is code your own processor in FPGA,
    and not an FPGA with already an ARM core in hardware of course.
    Anyways, there is more danger lurking in the normal processors and interface chips,
    and often many interfaces are integrated, for example when when ethernet and some input device handling is also integrated
    then is quite possible it takes just a single request from some specific IP to send all you keystrokes to NSA
    or whatever have you elsewhere.
    There is no real security, I come from a hardware background and would implement that as firmware if I worked for any of those
    entities in any of those countries.
    But anyways, they know I want to take over the world by now..... ;-)

    • @fss1704
      @fss1704 6 ปีที่แล้ว +2

      ;-)

  • @athf226
    @athf226 7 ปีที่แล้ว +1

    I'm kind of curious what sort of similar tools the processor developers have. When I've made processors in uni we would generally brute force/cherrypick things we thought may break stuff.

  • @disk0__
    @disk0__ 7 ปีที่แล้ว +45

    How is Chris Domas so fuckign based holy shit

    • @XalphYT
      @XalphYT 7 ปีที่แล้ว +13

      disco__ This presentation left my jaw on the floor.

    • @JorgetePanete
      @JorgetePanete 7 ปีที่แล้ว

      disco__ fucking*

  • @christianm1533
    @christianm1533 5 ปีที่แล้ว +1

    I'm a late viewer of this video. It's some brilliant research, however not unexpected at all.
    However, CPU instruction fetchers and decoders are not static in this day an age.
    So. The theoretical malformed but working opcode space is potentially much larger.
    There is this theory called "Opcode knocking" or "Instruction knocking".
    This hidden key sequence opens instruction decoding for a class of non-disclosed instructions which have valid and probably security implicating behavior.
    This opcode space would not be visible unless the opcode key knocking sequence has been entered.
    So while this helps, there is absolutely no way of knowing backdoor instructions, even with complete pertubation of the variation of opcode space.