PS5: SpecterDev shares details on “In-Kernel” Hypervisor (earlier versions of the PS5 Hypervisor found in Firmwares <=2.50)
PS5/PS4 hacker SpecterDev recently updated the PS5 Dev wiki with interesting information about early iterations of the PS5 Hypervisor.
PS5 Hypervisor remains the holy grail for hopes of Jailbreak
The Hypervisor is a piece of middleware designed to protect the console’s Firmware, notably its kernel, from malicious attacks. The Hypervisor in particular enforces eXecute Only Memory (XOM) rules on the kernel, to avoid attackers from reading/writing critical parts of the system.
The hypervisor on the PS5 is one of the reasons why the PS5 isn’t considered “Jailbroken” nowadays, even though a Kernel exploit was released several months ago. We’ve talked at length about it here, and SpecterDev has shared a lot about PS5 security in a recent infosec conference here.
Although breaking the Hypervisor would definitely not be the only way we could open the PS5 further, it appears to be holding the keys to many of the console’s security. This is why getting more information about it is crucial.
Early versions of the Hypervisor were directly in the Kernel
In theory, having the Hypervisor running as a completely separate entity from the rest of the code is advisable. However, based on SpecterDev’s explanation, it appears earlier versions of the Hypervisor (on firmwares 2.50 and below) were running as part of the kernel. This is important information because it means these early versions could potentially be attacked from exploits within the kernel itself. On the surface at least, it gives hope that earlier versions of the hypervisor might be less secure than the current iteration.
Specter also notes that the PS5 Hypervisor is much smaller than e.g. the PS3 Hypervisor (in terms of amount of code) . This points to Sony wanting a very small attack surface for this critical part of the system. The smaller it is, the easier it is to guarantee a bug free mechanism. Hackers have proven countless times that they can find bugs “easily” in large codebases, so this makes sense.
From Specterdev’s update in the wiki:
On 2.50 and lower, the hypervisor is integrated as part of the kernel binary. This is the “first iteration” of the hypervisor, later versions have the hypervisor as a separately loaded component. The hypervisor’s main goals are to protect kernel code integrity and enforce
xotext
(aka. eXecute Only Memory or “XOM”) on the kernel.To accomplish this, Sony takes advantage of various features provided by AMD Secure Virtual Machine (SVM), such as; Nested Page Tables (NPT), Guest Mode Execute Trap (GMET), and intercepting reads/writes to Control Registers (CRs) as well as Machine State Registers (MSRs). Furthermore, xotext seems to be hardware-backed as a collaboration with AMD, named “nda feature”. The hypervisor also manages the I/O Memory Management Unit (IOMMU), as hinted by the fact that it exposes various hypercalls for configuring it.
It’s worth noting the hypervisor is very small, especially when compared to that of the PS3. It only supports a handful of hypercalls and mainly exists to protect the kernel. It doesn’t run multiple VMs or use nested virtualization, it only virtualizes the kernel/userspace, which Sony calls “GameOS”.
For full details on Specter’s findings, with tales of Hypervisor Page Tables, Nested Page Tables, Control Register Protection, and machine state register protection, head over to the PS5 Dev wiki (link below).
Source: PS5 Dev wiki, via Zecoxao