1 00:00:00,000 --> 00:00:04,180 It's either as a boot kit or in some cases as a firmware implant as we will see later. 2 00:00:04,620 --> 00:00:09,940 What's good also is that code here is hidden from the OS and the hypervisor. 3 00:00:10,100 --> 00:00:16,040 So antivirus, EDRs, or anti-cheat engines won't see these things, right? 4 00:00:16,660 --> 00:00:21,120 Now in terms of privilege level this is just a simplification but we can think about it like this. 5 00:00:21,120 --> 00:00:25,940 We have our applications, like for instance our browser, running at the very top of ring three. 6 00:00:25,940 --> 00:00:33,280 Then we have our OS, ring zero, and if we have a hypervisor it's down the OS of course and only then we have SMM. 7 00:00:33,740 --> 00:00:35,600 Now how does this work? 8 00:00:35,600 --> 00:00:39,640 We can divide the uh the thing in two phases. 9 00:00:39,640 --> 00:00:51,780 We have boot time where the firmware BIOS UFI code will after initializing the the hardware will load the SMM code into an special area of memory called SM RAM. 10 00:00:52,160 --> 00:01:00,180 And then it will hand off the execution to the OS loader then the OS loads and as you can see SMM is just a run time concept. 11 00:01:00,180 --> 00:01:02,760 It will provide services for the for the platform. 12 00:01:02,880 --> 00:01:07,760 For instance power management, security, and the OS can invoke some services from it as well. 13 00:01:08,600 --> 00:01:09,820 So how does that happen? 14 00:01:09,820 --> 00:01:12,760 Well there's this concept of system management interrupt. 15 00:01:12,760 --> 00:01:24,660 When an SMI occurs the processor gets interrupted and then this the the current register set of the processor is saved into the SM RAM into a safety area. 16 00:01:25,120 --> 00:01:34,280 And then whatever needs to happen happens some um good feature for the system and it then comes back to the OS. 17 00:01:34,280 --> 00:01:42,080 In this case we are doing a synchronous SMI like a software SMI the OS is um invoking a service from SMM. 18 00:01:42,940 --> 00:01:46,440 Now we've been working on this area for a bit. 19 00:01:46,620 --> 00:01:49,780 Uh we published some some blogs. 20 00:01:49,780 --> 00:01:51,680 We've done some some presentations before. 21 00:01:51,680 --> 00:01:53,120 How are you on Hexagon? 22 00:01:53,120 --> 00:02:02,220 We have a couple of CVEs in 2023 and we also released some tools for um checking for misconfigurations and known issues. 23 00:02:02,400 --> 00:02:11,220 Um all of these things that we've done before are mostly related to either misconfigurations from vendors or software vulnerabilities in components. 24 00:02:11,220 --> 00:02:17,100 Now we're going to present today is an architectural flaw in the AMD processor itself. 25 00:02:17,100 --> 00:02:18,440 So that's very different. 26 00:02:18,440 --> 00:02:23,260 And so for that we're going to just see again what is what makes the security of SMM. 27 00:02:23,500 --> 00:02:32,840 So we can think on the CPU when it's an SMM mode we have the memory controller in the middle and we can just access this area with where the SMM code and data lives. 28 00:02:32,840 --> 00:02:35,280 We can execute instructions from this area. 29 00:02:35,280 --> 00:02:37,500 We can write to this area and read. 30 00:02:37,620 --> 00:02:49,400 However when the CPU is in normal mode meaning non-SMM, the memory controller just rejects um if if you read from this uh from this memory you're just going to return receive Fs. 31 00:02:49,400 --> 00:02:52,280 Writes are discarded and of course execution is disallowed. 32 00:02:52,280 --> 00:02:54,860 How does this hap- how is this happening? 33 00:02:55,780 --> 00:03:01,340 Well we have um what's called a TSEC region or top of memory segment region. 34 00:03:01,380 --> 00:03:10,480 Essentially the firmware after loads uh after it loads SMM at boot time, it will hopefully configure these two registers. 35 00:03:10,800 --> 00:03:18,140 And the idea is to overlap um have this region to overlap with all the contents of SM RAM to protect it. 36 00:03:18,400 --> 00:03:23,100 We have uh two registers we have the TSEC base and the TSEC mask which is the length. 37 00:03:23,100 --> 00:03:27,060 The TSEC mask as you can see have also uh additional fields. 38 00:03:27,560 --> 00:03:30,100 And yeah essentially this is the way. 39 00:03:30,100 --> 00:03:40,240 The memory controller will see that uh the CPU is executing in normal mode and will just reject to read the content or write the content of the SM RAM. 40 00:03:40,520 --> 00:03:42,120 Has to be enabled. 41 00:03:42,120 --> 00:03:44,480 That's why the T-valid is there. 42 00:03:44,980 --> 00:03:58,160 Now the layout of SM RAM uh basically is up to the vendor to define but most systems out there are going to follow what the EDK2 has which is TianoCore. 43 00:03:58,160 --> 00:03:59,540 This is reference code. 44 00:03:59,980 --> 00:04:06,060 And uh essentially it's going to consist at the very bottom you can see here um SMM core area. 45 00:04:06,060 --> 00:04:10,360 This is just supporting code for the rest of of what's going to be in there. 46 00:04:10,360 --> 00:04:19,300 And then for each core we're going to have an SMM base and at a specific offset 8000 from the SMM base we're going to have the entry point. 47 00:04:19,300 --> 00:04:25,220 Which is where the processor, the core is going to start executing from when the SMI happens. 48 00:04:25,620 --> 00:04:28,220 And then we have a safe state at offset FE00. 49 00:04:28,220 --> 00:04:29,780 This is TianoCore right? 50 00:04:30,260 --> 00:04:33,060 It can be laid out differently by the vendor. 51 00:04:33,280 --> 00:04:40,800 And then we have the SMI handlers at the very top which are going to be the functions that are are going to be useful for for us for the system. 52 00:04:40,800 --> 00:04:42,780 Handling power, security or whatever. 53 00:04:44,120 --> 00:04:47,040 Um so yeah just a summary of the SM RAM registers. 54 00:04:47,040 --> 00:04:50,360 We have the three that we just mentioned and we also have an SMM block. 55 00:04:50,360 --> 00:04:51,400 That's very important. 56 00:04:51,400 --> 00:05:00,540 Hopefully the firmware code is going to set this bit so that the whatever runs at run time the OS cannot tamper with these registers. 57 00:05:00,540 --> 00:05:13,960 We don't want for example at run time having the OS disabling the TSEC location because this will just um update or change the code at the SM RAM location and execute with these additional privileges right? 58 00:05:14,160 --> 00:05:16,980 Now this needs to be configured for each core. 59 00:05:17,540 --> 00:05:25,620 With that we can see a first difference between how Intel and AMD manage the access to MSRs. 60 00:05:25,780 --> 00:05:33,420 On Intel systems these MSRs that are related to SMM are only accessible while the CPU is in SMM. 61 00:05:33,800 --> 00:05:39,420 In fact obtaining the SMM base for example on Intel could be considered a leak. 62 00:05:39,780 --> 00:05:45,240 On AMD all these MSRs are accessible from ring zero, no problem. 63 00:05:45,280 --> 00:05:50,700 Again if we have the SMM block bit set then the configuration cannot be changed. 64 00:05:50,800 --> 00:05:58,180 Not even SMM can change the configuration until the next power cycle in which I mean the firmware will take over again and configure this in the same way. 65 00:05:59,000 --> 00:06:02,400 But we can now spot the bug in the documentation. 66 00:06:02,620 --> 00:06:10,080 This is the same TSEC mask register and the fields just a picture from the documentation. 67 00:06:10,180 --> 00:06:15,640 We can see how the SMM block is covering all of the fields except for two over there. 68 00:06:16,080 --> 00:06:20,960 These two fields are going to be what we're going to be talking about in this session. 69 00:06:20,960 --> 00:06:23,560 And we have T-CLOSE and A-CLOSE. 70 00:06:23,900 --> 00:06:25,700 We're just going to focus on T-CLOSE. 71 00:06:25,700 --> 00:06:32,860 A-CLOSE stands for the same feature but for a previous region called ASEC which overlaps on the video memory. 72 00:06:32,860 --> 00:06:34,800 It's not used anymore so it doesn't matter. 73 00:06:34,840 --> 00:06:47,540 But what happens is when this bit is set, the data accesses that the core that the core performs when it's running in SMM are going to be directed to MMIO instead of to SMRAM. 74 00:06:47,600 --> 00:06:57,460 And that's cool because as we said before, we can set this bit from ring zero because it's not blocked by the SMM block, right? 75 00:06:57,660 --> 00:07:10,360 It actually in the A-CLOSE description it also says hey, don't forget to unset this when you're returning from SMM because otherwise your safety are going to be erroneously read from MMIO. 76 00:07:10,360 --> 00:07:11,420 That's bad. 77 00:07:13,280 --> 00:07:25,840 The documentation says as well hey, if you have a valid T-CLOSE region and you're in SMM and the T-CLOSE is set, then instruction fetches are still going to be directed to DRAM but data accesses are going to go to MMIO instead. 78 00:07:26,000 --> 00:07:31,260 If you're not in SMM then both accesses, both type of accesses are going to go to MMIO. 79 00:07:31,780 --> 00:07:37,720 So we can say X86 behaves in a Harvard, like a Harvard architecture. 80 00:07:37,720 --> 00:07:38,880 It goes to Harvard, right? 81 00:07:38,880 --> 00:07:45,860 If we have our core zero for example running in normal mode, both data and instruction fetches just go to MMIO. 82 00:07:46,220 --> 00:07:50,860 If we have our core zero now in SMM with the T-CLOSE off, this is what happens. 83 00:07:50,860 --> 00:07:51,520 No problem. 84 00:07:51,520 --> 00:07:54,260 We read and execute from SM RAM. 85 00:07:54,260 --> 00:07:58,120 However when we set T-CLOSE on, now data fetches go like this. 86 00:07:58,120 --> 00:08:04,480 And this is a problem because this portion can be controlled by an attacker. 87 00:08:05,360 --> 00:08:07,280 So triggering the condition is super easy. 88 00:08:07,280 --> 00:08:18,160 We just need to set this bit, this T-CLOSE bit, and call into an SMI and the system will immediately freeze, hang, or you're going to spot the problem right there. 89 00:08:18,900 --> 00:08:34,900 This feature exists because, well AMD wanted to have the ability to reuse the physical address space and have SMM code access an IO device that were using the same SM RAM physical memory essentially. 90 00:08:35,460 --> 00:08:38,240 Um, we haven't seen any vendor using this feature. 91 00:08:38,380 --> 00:08:40,460 Um, but yeah, that's why. 92 00:08:40,460 --> 00:08:47,280 And it was, on what we could track is in 2006 there was this document that first mentioned the feature. 93 00:08:47,360 --> 00:08:50,520 So it means it's been around at least for 18 years. 94 00:08:51,840 --> 00:09:04,360 Now, for people familiarized with um, biosecurity they're probably going to remember this vulnerability presented by Christopher Domas in 2015 called the memory sinkhole attack. 95 00:09:04,360 --> 00:09:16,040 And what happened was that he was able to remap the APIC which is a specific device um, available and overlap it with the T-SEC area and it caused the same effect. 96 00:09:16,060 --> 00:09:18,920 Uh, data fetches will go to MMIO instead of SM RAM. 97 00:09:19,140 --> 00:09:28,160 Now the difference here of course is that that was only limited to the APIC and it only affected the 4K region where the APIC was overlapped with. 98 00:09:28,440 --> 00:09:33,180 The SYNCLOSE behavior changed uh, how the entire T-SEC works. 99 00:09:33,280 --> 00:09:36,480 Um, any device in theory could be overlapped, right? 100 00:09:36,480 --> 00:09:41,060 Because we just direct any access to the MMIO space. 101 00:09:42,340 --> 00:09:46,160 So, we can bring some attack ideas in. 102 00:09:46,320 --> 00:09:59,260 Our easy thing will be, the easiest thing will be to just grab any PCI device and hopefully we'll have a good register layout on its bar so that we can take control of the execution at the very beginning of the entry point. 103 00:09:59,420 --> 00:10:10,380 As there are multiple integrated devices that we could use, we could just try remapping one of those and based on what we read, the register should become visible at the T-SEC location from the OS. 104 00:10:11,840 --> 00:10:13,360 However this failed. 105 00:10:13,360 --> 00:10:23,440 We can see here how uh, we have an ethernet controller uh, with its original uh, bar 2 uh, D0714000. 106 00:10:23,440 --> 00:10:26,460 We have some registers right here, they're visible registers. 107 00:10:26,460 --> 00:10:34,360 And we're going to try to overlap, when we try to overlap it with the SMM entry uh, BFED0000, we can see that we're still reading F's. 108 00:10:34,360 --> 00:10:36,500 So, the remapping failed. 109 00:10:36,800 --> 00:10:38,420 Registers are not available. 110 00:10:38,860 --> 00:10:44,060 Um, we can see that the registers were moved from their original location. 111 00:10:44,060 --> 00:10:46,700 Uh, something happened. 112 00:10:47,600 --> 00:10:58,140 When we restore, we can see the the the priority of the memory probably failed, right? 113 00:10:58,260 --> 00:11:03,360 So what that that led us to try to understand okay, how that does, how how is that working? 114 00:11:03,360 --> 00:11:06,280 I have this register called top of memory or TOM. 115 00:11:06,840 --> 00:11:17,440 Um, this thing defines a limit between the usable DRAM before 4 gigabytes on the physical address space and MMIO space on top. 116 00:11:17,720 --> 00:11:21,660 Now, on Intel, this register has a lock bit. 117 00:11:21,660 --> 00:11:24,980 Once it's configured, you cannot tamper with it anymore at run time. 118 00:11:24,980 --> 00:11:31,260 But on AMD, it doesn't have such a lock so we can just, you know, modify this and maybe that's good for us. 119 00:11:31,320 --> 00:11:34,940 The idea is simple, we have this is uh, imagine this is the layout, right? 120 00:11:34,940 --> 00:11:41,200 And we'll move the MMIO space of the TOM that defines the MMIO space to match with the TSEC base. 121 00:11:41,260 --> 00:11:42,880 So we have something like that. 122 00:11:43,240 --> 00:11:48,580 Maybe then, trying the same trick that we uh, did before could work. 123 00:11:48,580 --> 00:11:54,820 Unfortunately, we could move the TSEC, no problem, but it didn't change the behavior that we saw before. 124 00:11:54,820 --> 00:11:56,440 In practice, it didn't work. 125 00:11:56,880 --> 00:12:08,580 So that led us to dig, dig, dig uh, deeper into uh, into augmentation and we found there are some actual priorities when the core access um, some portion of the physical address space. 126 00:12:08,580 --> 00:12:10,840 Essentially determines what, where it's going. 127 00:12:10,840 --> 00:12:19,440 And we can see that the TSEC and ASIC mechanisms are listed 4, which means 1, 2 and 3, whatever is listed there has less, less priority than this. 128 00:12:19,440 --> 00:12:23,320 And at the, at number 1, we can see the TOM is, is listed there. 129 00:12:23,320 --> 00:12:25,320 So we have, that's why it never worked, right? 130 00:12:25,320 --> 00:12:26,520 It would have never worked. 131 00:12:27,920 --> 00:12:32,760 What's at 5, where we have the MMIO configuration space and the APIC? 132 00:12:33,780 --> 00:12:36,360 Uh, that makes sense. 133 00:12:36,660 --> 00:12:40,240 We, the APIC was used before in the Intel attack. 134 00:12:40,360 --> 00:12:42,840 The MMIO config space we cannot use really. 135 00:12:43,000 --> 00:12:50,900 Um, and then at 6 we have this Norbridge address space uh, routing but uh, that probably stands for older architectures. 136 00:12:50,900 --> 00:12:53,100 This is not seen in modern, modern stuff. 137 00:12:53,100 --> 00:12:54,980 So we cannot use it. 138 00:12:55,320 --> 00:13:00,080 For the APIC, we cannot really use it and we're going to explain why. 139 00:13:00,080 --> 00:13:06,940 But for that, I'm going to give an analysis of, of um, how the SMM entry point code works. 140 00:13:07,020 --> 00:13:15,300 When the SMM, when the SMI occurs, the SMM core uh, that, that the core um, executing at SMM starts executing in real mode. 141 00:13:15,300 --> 00:13:16,720 In 16 bit mode, flat. 142 00:13:16,720 --> 00:13:18,160 No protection whatsoever. 143 00:13:18,660 --> 00:13:25,240 What it has to do is quickly go to protected mode 32 bit and then goes to long mode and then passes the execution to the handlers. 144 00:13:25,240 --> 00:13:26,780 This is a very simplified view. 145 00:13:27,020 --> 00:13:31,920 Now, that first step going to, from real mode to protected mode is, is key, right? 146 00:13:31,920 --> 00:13:33,640 That's the first thing that needs to happen. 147 00:13:34,100 --> 00:13:40,040 For this, um, on x86, we need, essentially are enabled segmentation. 148 00:13:40,580 --> 00:13:47,620 Uh, segmentation provides um, the ability for the, for the core to see the memory in a segmented way. 149 00:13:47,620 --> 00:13:48,980 That's, that's how it's called. 150 00:13:48,980 --> 00:13:58,280 Essentially, we can have different segments for memory and assigns uh, different permissions or like um, the ability to execute code or, or just read data and stuff like that. 151 00:13:58,300 --> 00:14:02,500 We have this key data structure called global descriptor table of GD or GDT. 152 00:14:03,180 --> 00:14:12,840 And we have a register on the processor that is called GDTR that's going to point to the base of our GDT structure and it's going to have a limit in bytes. 153 00:14:13,080 --> 00:14:15,760 And so the GDT is just really an array of descriptors. 154 00:14:15,760 --> 00:14:17,160 And we can have different types of descriptors. 155 00:14:17,160 --> 00:14:19,640 We can have, we can have code descriptors, data descriptors. 156 00:14:19,640 --> 00:14:21,180 Each one is going to have a base. 157 00:14:21,360 --> 00:14:22,700 The first one is never used. 158 00:14:22,700 --> 00:14:24,500 That's why it's called, it's called null descriptor. 159 00:14:24,500 --> 00:14:28,660 But then, when we have a jump, you can see we'll have um, a jump. 160 00:14:28,660 --> 00:14:34,400 It's not only having an offset like a target location but it's also going to have like a segment selector right here. 161 00:14:34,440 --> 00:14:38,700 That segment selector picks the descriptor we're going to use for the, for, for our, our code segment. 162 00:14:38,700 --> 00:14:44,660 And then the top, the, the offset is added to the base that is indicated by the GDT. 163 00:14:44,940 --> 00:14:46,860 Forming the final linear address. 164 00:14:47,300 --> 00:14:53,340 With that we can do uh , an analysis of um, the EDK2 SMM entry point. 165 00:14:53,340 --> 00:15:03,440 Essentially um, we can see that at the very beginning we are moving into the register BX, the entry point plus 4D. 166 00:15:03,480 --> 00:15:09,760 This is, this is a decom , like um, extracted from a, from, from a compiled um, SMM code. 167 00:15:09,760 --> 00:15:15,060 So you can see at 4D right there we have a GDT description ready to, to, to be loaded into the GDTR. 168 00:15:15,060 --> 00:15:17,980 The next instruction that matters for us is the load GDT. 169 00:15:17,980 --> 00:15:22,560 This is the instruction that is going to load the GDTR with the content that BX points to. 170 00:15:22,940 --> 00:15:30,040 And finally, we have a jump over here that's gonna perform the actual um, going into protected mode. 171 00:15:30,400 --> 00:15:34,280 And it has the selector of code as well and the offset. 172 00:15:34,500 --> 00:15:42,060 Now, with this, what, what will happen if we over, overlap a device that we control on the entry point? 173 00:15:42,060 --> 00:15:44,420 And we control offset 4D. 174 00:15:44,500 --> 00:15:48,440 What will happen is that the load GDT will be loading something that we control. 175 00:15:48,440 --> 00:15:50,760 So we can load our fake GDT right ? 176 00:15:50,900 --> 00:15:52,380 So that's what we're trying to do here. 177 00:15:52,380 --> 00:16:04,680 We're trying to get control over the offset 4D with any device that we can find so that the, the fake GDT then provides the descriptors we need and we can take control and jump down there. 178 00:16:04,680 --> 00:16:06,460 That's the whole idea of the attack. 179 00:16:07,640 --> 00:16:10,660 And that's why the APIC is a problem. 180 00:16:10,900 --> 00:16:11,600 Two things. 181 00:16:11,600 --> 00:16:14,420 First, the system becomes unstable when the APIC is moved. 182 00:16:14,420 --> 00:16:15,400 Super unstable. 183 00:16:15,440 --> 00:16:20,100 Second, the APIC racers are not useful for taking control in the way we need. 184 00:16:20,140 --> 00:16:24,480 We can see that at 4D we have this reserved regions with all zeros. 185 00:16:24,480 --> 00:16:25,800 Rights are discarded here. 186 00:16:25,800 --> 00:16:34,340 We're not able to control here and if we load a GDTR with all zeros we're essentially saying to the processor, hey, here's an empty GDT. 187 00:16:34,520 --> 00:16:36,340 So this won't work. 188 00:16:36,400 --> 00:16:44,240 And at this point we found another device not documented by the, the specification that also has priority over uh, the TSEC region. 189 00:16:44,240 --> 00:16:47,520 That's the spike controller and Christophe's going to describe it for us. 190 00:16:50,240 --> 00:16:51,280 Alright. 191 00:16:51,640 --> 00:17:00,460 So the spike controller is a very nice device for us because it's present in all the systems we've tested and it's basically used to access the spike flash on um, AMD uh, systems. 192 00:17:00,760 --> 00:17:05,520 So for example for reading, writing, erasing the spike flash, it always goes for the spike controller. 193 00:17:05,660 --> 00:17:09,380 And it has a couple of key features that are really uh, interesting to us. 194 00:17:09,440 --> 00:17:13,120 First of all, we can relocate the bar over the SMM entry point. 195 00:17:13,220 --> 00:17:17,460 Secondly, the portions which are interesting to us at offset 4D, we can control them. 196 00:17:17,600 --> 00:17:22,540 And three, it actually takes precedence over uh, SMRAM when TCLOS is enabled. 197 00:17:22,920 --> 00:17:34,440 So with that in mind, what we will do for our attack is simply take the spike bar, relocate it over the SMM entry point of core zero, and then afterwards manipulate the values at offset 4D within that bar. 198 00:17:34,720 --> 00:17:44,280 Um, the um, registers that actually correspond to that portion of memory in the bar uh, are the memory range and ROM protection zero register. 199 00:17:44,340 --> 00:17:53,100 Those were used in the past to uh, lock down access to the spike flash, but mostly these are not configured, they're not fixed, so we can fully control them. 200 00:17:53,100 --> 00:17:58,700 On some systems they are fixed, but actually they are fixed to values which are still useful for us. 201 00:17:59,660 --> 00:18:07,460 So, before I dive into the exploits, uh, I also want to uh, show you a little bit our debugging stuff because it's a little bit special. 202 00:18:07,680 --> 00:18:14,180 Um, so we were facing actually two challenges uh, when we tried to develop the exploit. 203 00:18:14,240 --> 00:18:22,920 First of all, we didn't really have a way to know whether our payload ran because the system just crashes, reboots, and memory is just all wiped. 204 00:18:23,280 --> 00:18:27,120 Uh, and secondly, we didn't really have any debugging framework for SMM. 205 00:18:27,400 --> 00:18:33,560 Um, and like for example when crashes happen, we want to be able to modify the code however we see fit. 206 00:18:33,680 --> 00:18:51,860 So to resolve the first issue, we actually took a PCI squirrel, which is typically used with PCI leach for DMA attacks, but the nice thing about it is, actually is that it has a bar buffer, as we call it, where when we write to it, it actually survives across reboots. 207 00:18:51,860 --> 00:19:00,180 So for instance, a payload can write a value to uh, the bar buffer, kind of like a checkpoint so we know it ran, and then when the system reboots, it's still going to be there. 208 00:19:00,180 --> 00:19:00,760 Right . 209 00:19:00,840 --> 00:19:14,920 And if we want to modify, for example, for the second issue, if we want to modify uh, code in SMM for some extra debugging capabilities, for that we just um, injected a firmware implant, uh, that loads a nice SMM module that allows us to do all of that. 210 00:19:15,800 --> 00:19:25,480 So the setup looks like this, we just have the PCI squirrel connected to our target device via an M2 uh, adapter, and all of this is powered externally by a power supply. 211 00:19:26,020 --> 00:19:30,960 So, it's time to get our hands dirty, so let's take a look at how uh, the exploit looks like. 212 00:19:31,160 --> 00:19:40,080 In the first attempt, uh, we remap the spy bar, just like mentioned before, over the SMM entry point of core zero, then we tweak uh, these values at offset 4D. 213 00:19:40,640 --> 00:19:49,960 We create a fake GDT in the beginning of the address space, uh, with the, with a nice base address that will allow us when the jump happens to redirect the execution to our own payload. 214 00:19:50,740 --> 00:20:04,440 And then when we uh, execute the SMM entry point code with TCLOS enabled, what's going to happen is uh, the old GDT is actually going to load the GDT register uh, with a value that points to our own fake GDT, so that's great. 215 00:20:04,620 --> 00:20:14,880 And afterwards, when the jump happens, a descriptor from the fake GDT is going to be taken that we control, um, and it's going to be used as a base uh, for the jump. 216 00:20:15,980 --> 00:20:20,500 So, and um, this is going to redirect the execution like this, at least in theory. 217 00:20:20,780 --> 00:20:34,580 So, um, an interesting detail is actually how we pick the base address in the GDT descriptor, um, and for that we have to understand how it normally executes and how it executes with TCLOS in this case. 218 00:20:34,580 --> 00:20:52,700 So, um, when the for jump happens, um, and the normal execution, what happens is the GDT register is going to point to a GDT within SMRAM where it's nicely protected, um, and the segment selector is going to index into that table, um, and the base is going to be actually fixed to zero. 219 00:20:52,700 --> 00:21:00,720 Which means with the base of zero when we add it uh, to the for jump offset, what's going to happen is the linear address is going to be the same. 220 00:21:00,800 --> 00:21:04,300 Now in our case, actually we have a bit of an issue. 221 00:21:04,300 --> 00:21:09,220 We want to read the execution, um, outside of TSEG. 222 00:21:09,260 --> 00:21:16,780 The only problem is that within the first four gigs of memory, after TSEG, there's not really any spot where we can put a payload, right? 223 00:21:16,800 --> 00:21:26,100 So, if we increase the base a little bit, sure the instruction pointer is going to go a bit more up, up, up, up, and the address space, we don't really have DRAM over there that we control. 224 00:21:26,200 --> 00:21:39,940 So we wondered, okay, what happens if we actually increase the base such that when we, uh, the base of the GDT descriptor, such that when we add it to the for jump offset, it actually overflows. 225 00:21:40,800 --> 00:21:44,280 Um, yeah, it just overflows. 226 00:21:44,280 --> 00:21:47,620 So we thought, okay, this isn't going to be possible, but actually it was. 227 00:21:47,740 --> 00:21:57,340 Uh, this is nice because, uh, if we choose the base sufficiently big and we add the offset, we can actually make it wrap around and make it jump to our own payload in the beginning of the physical address space. 228 00:21:57,340 --> 00:22:01,760 The beginning of the physical address space, we have DRAM there, great, we control all of that. 229 00:22:02,120 --> 00:22:07,540 So, uh, that was one of the key takeaways actually that we had from the research as well. 230 00:22:08,460 --> 00:22:19,040 So this worked, our payload actually ran, and we saw this because it would write a value , this nice checkpoint to our bar buffer, but the system would crash and we wondered, okay , why is this happening? 231 00:22:19,360 --> 00:22:21,440 Um, the reason was the SMM safe state. 232 00:22:21,440 --> 00:22:28,240 So like Enrique mentioned, when a CPU goes to SMM mode, it actually saves the current register state into the, uh, SMM safe state. 233 00:22:28,240 --> 00:22:29,960 When it returns, it just restores it. 234 00:22:29,960 --> 00:22:45,580 What happens is when TCLOS is enabled, actually the writes, when the core enters SMM, are going to be discarded, which means when we return with TCLOS disabled, actually it's just going to use stale values that were still there, that were stored before. 235 00:22:45,820 --> 00:22:49,100 And to resolve this, the trick is actually pretty straightforward. 236 00:22:49,100 --> 00:22:50,820 We trigger the SMM twice. 237 00:22:50,820 --> 00:22:55,100 One time, um, without TCLOS and the second time with TCLOS. 238 00:22:55,100 --> 00:23:02,480 So we first put the core zero into a known controlled state, and then trigger an SMI without TCLOS. 239 00:23:02,480 --> 00:23:14,200 This is going to prime the SMM safe state, and afterwards when we trigger the bug, with TCLOS enabled, the code is going to go for the same execution path, and it's just going to reuse the values that we stored before. 240 00:23:14,720 --> 00:23:19,320 So that worked, but unfortunately it crashed again. 241 00:23:19,320 --> 00:23:24,980 But this time around we did see actually that the, uh, the core zero was returning from SMM, so that was great. 242 00:23:24,980 --> 00:23:29,580 We had full control of core zero, OS code was running, we saw our checkpoints, great. 243 00:23:29,720 --> 00:23:33,620 But no matter what we tried, this damn thing was still crashing. 244 00:23:33,620 --> 00:23:38,020 Um, so we spent an eternity debugging this thing until we stumbled into this. 245 00:23:38,180 --> 00:23:46,140 When we enable TCLOS, what happens is, we enable it on core zero only, but actually it gets enabled on both cores. 246 00:23:46,140 --> 00:23:48,040 Core zero and core one. 247 00:23:48,760 --> 00:23:54,840 Um, and we found that the culprit for this is symmetric multi-threading, so this is AMD's implementation of Intel hyper-threading. 248 00:23:55,020 --> 00:23:59,060 Um, and what it does is it divides a physical core into two logical cores. 249 00:23:59,060 --> 00:24:03,300 And some of the resources on these logical cores are shared and some of them are not. 250 00:24:03,300 --> 00:24:08,700 So for instance the SMM base MSR is separate, so every logical core has a different base MSR. 251 00:24:09,120 --> 00:24:14,380 But the TSEC mask is actually shared, which is what we just saw, right? 252 00:24:14,780 --> 00:24:17,780 And we wondered, is this the actual issue? 253 00:24:17,780 --> 00:24:23,100 Because we assume when an SMI gets triggered, that only one core goes into SMM at the time. 254 00:24:24,040 --> 00:24:26,940 And we put this to the test and what we saw is the following. 255 00:24:26,940 --> 00:24:42,860 When we have multiple cores running in normal mode, so outside of SMM, um, when we, when one of them triggers an SMI, an interrupt gets asserted on all of the cores and all of the cores are going to go into SMM mode and going to start executing the SMM entry point codes, 256 00:24:42,860 --> 00:24:45,680 um, for each and one of them. 257 00:24:45,680 --> 00:24:49,140 So, our assumptions were actually wrong, right? 258 00:24:49,140 --> 00:24:51,880 We assumed the SMIs are local, but they're actually not. 259 00:24:51,960 --> 00:25:13,820 And we thought that this was actually the case because the IDK2 code has a so-called rendezvous routine, which will, every time you enter into SMM, this routine is going to be triggered and that core which entered into SMM will send an explicit interprocessor interrupt to all of the logical cores to explicitly pull them from whatever state they were in into SMM. 260 00:25:13,820 --> 00:25:17,820 And, well, what's the point of that if actually all the cores always go into SMM anyway, right? 261 00:25:18,280 --> 00:25:26,840 Um, and we dug a little bit deeper into the documentation and we found that the IO hub seems to be responsible for this to, uh, basically assert this interrupt on all of the cores. 262 00:25:26,880 --> 00:25:28,780 So, we're out of luck. 263 00:25:29,740 --> 00:25:39,800 So, to summarize, we had all cores always going into SMM and T-Cores being enabled on two cores at the same time and not just one as we initially thought. 264 00:25:40,180 --> 00:25:44,280 And this will actually make just core 1 go haywire, right? 265 00:25:44,280 --> 00:25:48,880 We have control of core 0 but core 1 is, uh, just going to go nuts and crash the whole system. 266 00:25:49,580 --> 00:25:54,040 So, to tackle the problem, we had to get control of core 1 some way. 267 00:25:54,360 --> 00:26:03,980 Uh, and we dug deep into our bag of tricks to really, uh, see if maybe there's a nice elegant solution to this to just take core 1 out of the running. 268 00:26:04,400 --> 00:26:11,980 Um, so we tried to, um, we tried to find another device to overlap with the entry point of core 1. 269 00:26:12,160 --> 00:26:13,220 There was none. 270 00:26:13,380 --> 00:26:15,180 Uh, we tried to disable SMT in the BIOS. 271 00:26:15,180 --> 00:26:16,440 That also didn't work. 272 00:26:16,440 --> 00:26:26,380 We tried to, uh, use the, uh, so-called init IPI and also the SKL instruction to put core 1 into a state that would actually make it ignore SMIs. 273 00:26:26,540 --> 00:26:27,860 That also didn't work. 274 00:26:28,020 --> 00:26:36,740 And finally, we also tried to send a so-called SMI IPI which, at least according to the documentation, would allow us to trigger an SMI on individual cores. 275 00:26:36,860 --> 00:26:38,100 And it also didn't work. 276 00:26:38,100 --> 00:26:43,660 So, despite the documentation indicating one thing, in practice, we didn't manage to, uh, get it to work. 277 00:26:44,320 --> 00:26:48,080 So, we're running out of options and we had to take a step back and analyze the problem. 278 00:26:48,300 --> 00:26:56,280 And we realized, okay, the LGDT has the actual problem because it's going to be load- loading the GDT register with all Fs, right? 279 00:26:56,460 --> 00:27:01,140 So, is this, is there maybe some way we can actually still take advantage of this? 280 00:27:01,620 --> 00:27:09,980 Um, so, when the supplementary point normally executes what happens with the GDT register is, it's going to be loaded with a nice value for the base. 281 00:27:09,980 --> 00:27:14,580 It's going to be pointing to the GDT within, uh, SMRAM, right? 282 00:27:14,580 --> 00:27:25,120 And afterwards, the segment selector is going to be taken, added to it, uh, and the base within that, uh, descriptor is going to be used to calculate the final linear address. 283 00:27:25,980 --> 00:27:34,820 Now, in our case, what's going to happen when TICOS is enabled, uh, the GDT register is going to be loaded with all Fs, both the limits and the base. 284 00:27:35,480 --> 00:27:41,680 And what's going to happen then is, when the for jump, the segment selector is going to be added to it. 285 00:27:41,760 --> 00:27:45,160 And once again, we have our good old friend's integer overflow. 286 00:27:45,480 --> 00:27:49,020 It's actually going to result in the physical address 7. 287 00:27:49,240 --> 00:27:53,780 And this is actually awesome because address 7 in the physical address space, once again, that's DRAM. 288 00:27:53,780 --> 00:27:54,920 We control DRAM. 289 00:27:54,920 --> 00:27:56,400 So, we can take advantage of that. 290 00:27:56,400 --> 00:28:01,940 We can put our GDT at the beginning of DRAM and we can just overflow this thing like this. 291 00:28:02,200 --> 00:28:09,980 And afterwards, uh, from the GDT we control, we set a nice base so that afterwards, uh, the code jumps wherever we want it to. 292 00:28:10,500 --> 00:28:13,420 So, to summarize, we have two types of wraparounds. 293 00:28:13,420 --> 00:28:16,320 One is between the GDT descriptor base and the for jump offset. 294 00:28:16,340 --> 00:28:21,900 And the second one between the GDT register base and the for jump segment selector. 295 00:28:22,060 --> 00:28:29,440 And the nice thing about this is, we can actually reuse the same fake GDT for both core zero and core one. 296 00:28:29,800 --> 00:28:33,340 And the added bonus is, we don't even need the spy bar anymore. 297 00:28:35,040 --> 00:28:38,180 The only thing that we really have to take care of is the SMM safe state. 298 00:28:38,180 --> 00:28:39,820 Once again, for core one. 299 00:28:39,880 --> 00:28:42,780 For core zero, we just do the same thing as before. 300 00:28:42,960 --> 00:28:46,220 But core one is going to be running in some unknown state. 301 00:28:46,220 --> 00:28:49,480 It could be running in ring three, ring zero, just in an unknown context. 302 00:28:49,480 --> 00:28:52,440 We have to bring it to the same controlled state as core zero. 303 00:28:52,620 --> 00:28:55,440 And we do so by using a kernel synchronization API. 304 00:28:55,780 --> 00:28:58,340 Which on Windows is the deferred procedure call. 305 00:28:58,360 --> 00:29:00,700 Or on Linux, symmetric multiprocessing. 306 00:29:01,660 --> 00:29:06,540 And basically once that's done, we have both cores in a known state. 307 00:29:06,540 --> 00:29:09,820 And we can use the same trick we did for core zero. 308 00:29:10,280 --> 00:29:12,020 So, all good things are three. 309 00:29:12,020 --> 00:29:13,520 So, let's try again. 310 00:29:13,700 --> 00:29:16,200 The exploit this time is greatly simplified. 311 00:29:16,540 --> 00:29:21,620 And the only thing we have to do is, we create the fake GDT in the beginning of the address space. 312 00:29:21,640 --> 00:29:25,280 We choose the base address within the descriptor accordingly. 313 00:29:26,060 --> 00:29:27,240 And that's it. 314 00:29:27,520 --> 00:29:38,520 And then when we trigger, when we enable T-Close and run the uh, SMM entry point code again, the old GDT this time around is going to point to the very end of the address space of the first four gigs. 315 00:29:38,620 --> 00:29:41,620 But then when the far jump happens, it's going to wrap around. 316 00:29:41,620 --> 00:29:47,280 It's going to fetch the GDT descriptor entry from the beginning of the address space from our fake GDT. 317 00:29:48,160 --> 00:29:53,660 And then afterwards it's going to redirect execution for both core zero and core one to our own payload. 318 00:29:54,840 --> 00:29:56,120 And it finally worked. 319 00:29:56,120 --> 00:29:59,120 We managed to control both cores, core zero and core one. 320 00:29:59,140 --> 00:30:07,460 Uh, our payload would execute with SMM privileges and uh, it would return gracefully from SMM to the operating system and nothing would crash. 321 00:30:07,460 --> 00:30:08,500 And that was great. 322 00:30:08,500 --> 00:30:12,040 There were only a couple of things that we wanted to improve uh, in our exploit. 323 00:30:12,040 --> 00:30:19,560 And that was um, to reload the GDT because the base actually is um, a bit off. 324 00:30:19,700 --> 00:30:26,000 So we just reloaded the GDT so that the base address is equal zero again so that we don't have strange misalignment issues. 325 00:30:26,060 --> 00:30:29,720 We set up long modes, so page tables, stack pointer, etc. 326 00:30:29,720 --> 00:30:32,660 so we can execute like uh, any SQL that we want. 327 00:30:32,740 --> 00:30:41,840 Uh, and then we also install an SMI hander so that we only have to exploit the bug once and then basically we have kind of semi persistence until the system resets. 328 00:30:41,840 --> 00:30:42,520 Right? 329 00:30:43,500 --> 00:30:47,780 So, for the demo, just to show you I'm not selling just some snake oil. 330 00:30:47,920 --> 00:30:56,600 Uh, we have a system over here which is a Huawei Matebook D16 from uh, 2023. 331 00:30:57,420 --> 00:31:00,960 And you can see when the system boots, it actually shows the Huawei logo. 332 00:31:00,960 --> 00:31:03,600 That logo is embedded in the firmware code. 333 00:31:03,800 --> 00:31:09,000 For that, um, so for our exploit we're actually going to modify that uh, that logo. 334 00:31:09,080 --> 00:31:14,160 So, um, we're going to run our exploit with uh, kernel privileges. 335 00:31:14,340 --> 00:31:19,680 So you'll see over here that we have to elevate privileges and it's going to be triggered via a malicious driver. 336 00:31:20,060 --> 00:31:23,880 And then our exploit is going to do uh, three things. 337 00:31:23,880 --> 00:31:28,120 At first it's going to use the synclose issue to elevate privileges to SMM. 338 00:31:28,420 --> 00:31:31,480 Then it's going to disable the spy flash protections. 339 00:31:31,560 --> 00:31:39,480 And then afterwards it's going to write to the spy flash the portion where the um, boot splash logo is actually residing. 340 00:31:39,480 --> 00:31:43,700 This takes a little while, about 15 minutes, so we just fast forward that portion. 341 00:31:43,760 --> 00:31:47,200 And you can see okay, it shows done patching, all good. 342 00:31:47,860 --> 00:31:51,540 And at this point we just reset the system and pray that it works. 343 00:31:52,900 --> 00:31:54,340 So let's see. 344 00:32:01,460 --> 00:32:03,320 Yeah, this one takes a little while. 345 00:32:06,420 --> 00:32:08,960 And... there we go. 346 00:32:09,140 --> 00:32:10,240 We're successful. 347 00:32:18,440 --> 00:32:19,900 So, I'm actually going to show you how to do this . 348 00:32:19,900 --> 00:32:23,160 So I mean this was just one example of what we can do with this kind of access into the system. 349 00:32:23,160 --> 00:32:28,680 But let's take a more systematic approach to see whether this works on all systems, just on some. 350 00:32:28,680 --> 00:32:30,140 What does this actually depend on? 351 00:32:30,200 --> 00:32:34,640 So the next attack paths depend on how the platform is actually configured. 352 00:32:35,440 --> 00:32:40,720 Um, so every vendor configures certain features that AMD provides to them. 353 00:32:40,840 --> 00:32:44,160 And specifically there are two of them which are key to this. 354 00:32:44,240 --> 00:32:48,800 One is room armor, which can be used to restrict access to the portions of the spy flash. 355 00:32:49,600 --> 00:32:57,400 And the second one is platform secure boot, which is AMD's equivalent of boot guard, which will verify the initial stages of the firmware code. 356 00:32:58,160 --> 00:33:06,000 Um, so if everything is enabled, the very least thing that we can do is we can write to a portion of the spy flash where you have your variables live. 357 00:33:06,000 --> 00:33:11,600 So for instance, in these variables you're going to have things like the secure boot keys which are used. 358 00:33:11,600 --> 00:33:13,160 So we can break secure boot. 359 00:33:13,240 --> 00:33:14,220 That's nice. 360 00:33:14,420 --> 00:33:17,720 Um, but if nothing is enabled, actually we have firmware implants. 361 00:33:17,720 --> 00:33:20,780 I'm going to explain in a moment what the difference actually is. 362 00:33:20,780 --> 00:33:27,800 So in the first configuration where everything is properly configured, we see, okay, we escalate from the operating system to SMM. 363 00:33:27,840 --> 00:33:34,260 And from there we can write the, let's say, firmware data portion of the spy flash where the configurations are. 364 00:33:34,260 --> 00:33:42,020 So we can manipulate the secure boot keys so that afterwards we can actually load our own malicious boot loader before the OS loader runs. 365 00:33:42,840 --> 00:33:47,160 On the second configuration where the PSB is not enabled, we have basically the same scenario. 366 00:33:47,780 --> 00:33:54,200 Um, Roam Armor will still restrict write access to, um, to the data portion. 367 00:33:54,660 --> 00:33:59,600 And we can, we can still just, um, uh, inject our own boot kits. 368 00:33:59,840 --> 00:34:06,220 And the third configuration we can write to even firmware code, but that's going to be still verified by platform secure boot. 369 00:34:06,860 --> 00:34:10,240 So, okay, and these three, we have the same scenario. 370 00:34:10,240 --> 00:34:13,900 We can just inject a boot kit, which is still nice because it runs before the OS loader. 371 00:34:13,900 --> 00:34:18,520 Any protections provided by the operating system would still be, um, rendered null. 372 00:34:19,880 --> 00:34:29,100 But, in the last scenario where none of these features are enabled, what we can do is we can inject our, uh, malware into the spy flash, into the firmware code portion of it. 373 00:34:29,100 --> 00:34:38,460 And when that happens, uh, is what we're going to get is we can, um, run our own malware at the very earliest stage of the boot process. 374 00:34:38,800 --> 00:34:49,080 And there's a key difference here between a firmware implant and, uh, a boot kit, is that this attack actually is resistant to, uh, to OS reinstallations. 375 00:34:49,080 --> 00:34:51,620 So even if you wipe your drive, it's still going to be around. 376 00:34:51,980 --> 00:35:00,660 Um, and even if you try to push a firmware update from the operating system, it's still going to be around because the, uh, the malware can just say, well, the update was successful. 377 00:35:01,400 --> 00:35:16,060 Um, and the only way to really get rid of it at that point is to take apart your system, take a spy programmer to read out the spy flash, inspect it, and if it's infected, um, just, uh, rewrite it. 378 00:35:16,260 --> 00:35:20,220 But typically it's not really in the repertoire of a typical IT guy, right? 379 00:35:21,460 --> 00:35:31,540 So to illustrate how prevalent actually these misconfigurations are, we did some research last year on that and we saw that the majority of the systems have none of the security features actually enabled. 380 00:35:31,540 --> 00:35:37,040 Which means all the systems which have none of the features enabled are vulnerable to firmware implants. 381 00:35:37,040 --> 00:35:38,620 Which is pretty bad. 382 00:35:39,440 --> 00:35:53,940 And to put a cherry on top, we also found that once you're infected with that kind of, uh, firmware implant, you can even disable platform secure boot forever by burning a specific fuse so that your system remains vulnerable to firmware, uh, implant reinfections forever. 383 00:35:54,480 --> 00:35:55,320 Sweet. 384 00:35:55,920 --> 00:35:58,880 So, let's wrap up the presentation. 385 00:36:01,940 --> 00:36:03,580 Thanks Christophe. 386 00:36:04,560 --> 00:36:08,320 So, yeah, in terms of affected systems, um, I think we covered most of them, right? 387 00:36:08,680 --> 00:36:10,640 Pretty much all of them. 388 00:36:10,880 --> 00:36:11,780 Uh, yeah. 389 00:36:11,780 --> 00:36:15,620 Um, our tests were on Ryzen, mostly. 390 00:36:15,760 --> 00:36:17,200 Several laptops. 391 00:36:17,340 --> 00:36:20,960 Uh, but turns out the Threat Reaper series is also affected. 392 00:36:20,960 --> 00:36:23,400 Epic series is also affected. 393 00:36:23,580 --> 00:36:25,080 Meaning servers. 394 00:36:25,500 --> 00:36:39,100 Um, and yeah, uh, due to the longevity of this, this, this thing, we can estimate the total number of affected chips are in around the hundreds of millions. 395 00:36:39,960 --> 00:36:52,720 Um, there's an advisory from AMD published now, um, where more information on the system, the affected systems and cover, uh, there's a microcode update now. 396 00:36:53,120 --> 00:36:55,760 Information is there, so you can check. 397 00:36:56,580 --> 00:36:57,700 Mitigations. 398 00:36:58,480 --> 00:37:03,640 Yeah, AMD, as I just said, provided, um, with microcode updates. 399 00:37:03,880 --> 00:37:07,140 However, it might not cover all of the affected systems. 400 00:37:07,140 --> 00:37:17,380 Of course, um, in terms of what an OEM can do, they can just modify the SMM entry point code to detect if the T-Close bit is set. 401 00:37:17,720 --> 00:37:24,460 And if it is, then just abort the execution and this, this will just render the exploitation unfeasible. 402 00:37:24,940 --> 00:37:29,680 Uh, this can even be done at the EDK 2 level for AMD systems, right? 403 00:37:29,680 --> 00:37:37,380 And we really haven't covered here core boot, but core boot is affected in the same way. 404 00:37:37,380 --> 00:37:42,480 We just, I mean, um, core boot at the very beginning of the entry point performs a low GDT. 405 00:37:42,480 --> 00:37:46,840 They have to go to protected mode as well, so it's, it's the same thing. 406 00:37:47,420 --> 00:37:55,160 Um, and actually core boot, they are checking for this, uh, for other issues as well at the entry point, so they could, they could very well do this. 407 00:37:56,200 --> 00:38:07,180 Um, and users, well, they can, you know, a hypervisor could trap the access on the TSEC mask MSR, so that's another, uh, way to stop this. 408 00:38:07,840 --> 00:38:12,880 Timeline wise, well, we reported this back in October of 2023. 409 00:38:13,020 --> 00:38:17,580 A CVE of 2023, uh, 31315 was assigned in November. 410 00:38:17,780 --> 00:38:22,200 And then we discussed mitigations and impact with AMD over the course of the next months. 411 00:38:22,240 --> 00:38:28,220 Um, and yeah, finally yesterday, um, the advisory was published and we are here at DEF CON today. 412 00:38:29,320 --> 00:38:31,780 This was the official AMD response. 413 00:38:31,780 --> 00:38:39,160 Essentially, we work with them in a process of, uh, responsible disclosure. 414 00:38:39,500 --> 00:38:41,740 And yeah, they've been great to work with. 415 00:38:43,280 --> 00:38:44,880 Conclusions and takeaways. 416 00:38:45,040 --> 00:38:48,060 Well, the vulnerability has been around for nearly two decades. 417 00:38:48,160 --> 00:38:58,620 Um, the complexity of the architecture clearly plays in favor of attackers and we see this, uh, with the flexibility of, of, of the GDT. 418 00:38:58,620 --> 00:39:07,800 Um, the two types of wraparounds, the, the, the byte level, uh, um, address, um, like granularity that there is with it, no problem. 419 00:39:08,380 --> 00:39:14,180 Um, and also with the, how the MSRs can be accessed without any restriction. 420 00:39:14,660 --> 00:39:17,440 Uh, that, that's, that's all good for attackers, right? 421 00:39:17,440 --> 00:39:24,960 Um, these things combined are what made this exploit approach possible. 422 00:39:25,440 --> 00:39:27,880 It might be on other exploit methods too. 423 00:39:28,280 --> 00:39:33,900 Um, but yeah, all of this of, of course requires an in depth understanding of the architecture. 424 00:39:34,200 --> 00:39:38,680 And in the end we managed to exploit this without requiring physical presence. 425 00:39:38,680 --> 00:39:39,980 So that's very good. 426 00:39:40,060 --> 00:39:43,340 And yeah, exploit code will be released soon. 427 00:39:43,340 --> 00:39:45,000 So stay tuned for that. 428 00:39:46,780 --> 00:39:47,900 Questions? 429 00:39:55,690 --> 00:39:59,510 Is there a microphone? 430 00:40:05,470 --> 00:40:06,790 Hello. 431 00:40:08,950 --> 00:40:18,810 Um, it wasn't entirely clear to me, is the spy flash chip you're referring to on the, uh, CPU die or is it external? 432 00:40:19,170 --> 00:40:20,270 External. 433 00:40:20,310 --> 00:40:21,030 Okay. 434 00:40:21,030 --> 00:40:21,170 Yeah. 435 00:40:21,170 --> 00:40:21,170 Um, 436 00:40:39,570 --> 00:40:51,130 so I'm sorry if I understood your question correctly was about bypassing uh, anti-cheat systems uh, using this method? 437 00:40:51,130 --> 00:40:51,430 Nope. 438 00:40:51,430 --> 00:40:58,010 Installing something to bypass uh, the anti-cheat systems and uh, uh. 439 00:40:58,010 --> 00:41:12,610 Once you achieve arbitrary code execution in SMM, uh, yeah, pretty much uh, like modern anti-cheat systems running uh, either kernel or even maybe a hypervisor level could, could, could run. 440 00:41:12,610 --> 00:41:15,670 And this, this runs even below that. 441 00:41:15,670 --> 00:41:16,670 Does that make sense? 442 00:41:16,670 --> 00:41:27,830 Yeah, but uh, since uh, MAD has disclosed the processors that are vulnerable to this attack, it is the, it is not disclosed in PlayStation 5 which has MAD. 443 00:41:27,830 --> 00:41:31,710 So that's what I was asking if maybe it's also, yeah. 444 00:41:35,030 --> 00:41:36,190 Ah, okay. 445 00:41:37,710 --> 00:41:43,110 But, but yeah, I'm sorry, I, I don't know, uh, I, I don't understand your question correctly. 446 00:41:43,930 --> 00:41:47,910 The, the PlayStation 5 hypervisor blocks the MSR. 447 00:41:47,910 --> 00:41:49,850 If it's for that, yes. 448 00:41:49,850 --> 00:41:51,050 The, the, yes. 449 00:41:51,050 --> 00:41:52,450 We, we check that. 450 00:41:52,770 --> 00:41:55,910 And it is being trapped by the hypervisor layer on the PlayStation. 451 00:41:55,910 --> 00:41:57,130 Yes, sorry. 452 00:41:58,330 --> 00:41:59,430 Hey, thank you. 453 00:41:59,430 --> 00:42:00,610 Um, quick question. 454 00:42:00,610 --> 00:42:06,150 Um, why didn't disabling SMT prevent the system from becoming unstable? 455 00:42:06,890 --> 00:42:08,310 Uh, yes. 456 00:42:08,310 --> 00:42:22,110 So the SMT, when we try to disable it, um, essentially what happens is the other logical core will just not run, but it'll still be there and it will be, all the entry points will be already configured by the firmware, if that makes sense. 457 00:42:22,110 --> 00:42:37,710 So when the SMI happens, it was a level underneath, I mean, it won't, you won't see the processor available at the OS level, but all, all the layout and, and, and, and, at the, at, yeah, at the deeper level, the, the logical core is still there, if that makes sense. 458 00:42:37,710 --> 00:42:38,190 Yes, it does. 459 00:42:38,190 --> 00:42:40,050 So we have to deal with that regardless. 460 00:42:40,050 --> 00:42:40,970 Yes, we tried. 461 00:42:40,970 --> 00:42:41,790 Thank you. 462 00:42:43,910 --> 00:42:44,770 Hello. 463 00:42:44,770 --> 00:42:48,170 Do you know what, uh, changes AMD microcode update made? 464 00:42:48,170 --> 00:42:50,750 Um, I'm sorry, could you, could you speak up louder? 465 00:42:50,750 --> 00:42:51,330 I'll say. 466 00:42:51,330 --> 00:42:56,330 Do you know what changes AMD microcode update made to mitigate this issue? 467 00:42:56,330 --> 00:42:57,830 Oh, interesting question. 468 00:42:57,830 --> 00:42:58,690 Uh, yes. 469 00:42:58,690 --> 00:43:01,310 Uh, no, I mean, officially we don't. 470 00:43:01,890 --> 00:43:10,530 Uh, um, what, uh, what, what, what, what, what, what, what, what, what, what, what, what. 471 00:43:10,530 --> 00:43:11,750 Uh, we don't. 472 00:43:12,870 --> 00:43:14,750 That's a little bit short of it. 473 00:43:15,210 --> 00:43:16,910 Uh, yes. 474 00:43:22,030 --> 00:43:23,830 I think we're good. 475 00:43:24,070 --> 00:43:24,770 Okay. 476 00:43:24,770 --> 00:43:29,470 Well, if no more questions, thank you so much for joining us today.