#
✕ nick:marcan
#asahi-gpu · 2022-02-14 15:14
marcanphire: probably jumping to a 0 function pointer
#asahi-gpu · 2022-02-14 15:13
marcansven: it's data
#asahi-gpu · 2022-02-14 13:36
marcanbut yeah, without protecting PPL data, this is a bit pointless isn't it
#asahi-gpu · 2022-02-14 13:36
marcanthe page tables are indeed readonly though, AFAICT
#asahi-gpu · 2022-02-14 13:33
marcanunless I'm confused about the MMU maps
#asahi-gpu · 2022-02-14 13:31
marcanso you can just redirect TTBR0 to any page table you want by changing the GPTBAT base
#asahi-gpu · 2022-02-14 13:30
marcanand then reads the TTBR0 from that for context switches
#asahi-gpu · 2022-02-14 13:30
marcanas far as I can tell it reads the GPTBAT base from a random global that is not in a PPL-only write protected page?
#asahi-gpu · 2022-02-14 13:30
marcanhmm... I don't think this MiniPPL is very well done
#asahi-gpu · 2022-02-14 12:00
marcanI think that's good enough for the "no, really, Apple don't have a backdoor here" argument
#asahi-gpu · 2022-02-14 12:00
marcanand by the nature of it, if it can guarantee those PTs never point to crazyland, then all we need to do is audit the GXF code (which is one page) to convince ourselves that there is no backdoor
#asahi-gpu · 2022-02-14 11:59
marcanthe cool thing is the GXF stuff somehow has symbols here
#asahi-gpu · 2022-02-14 11:59
marcanphire: it does have a function to switch TTBR0 around to different contexts
#asahi-gpu · 2022-02-14 11:43
marcanyeah
#asahi-gpu · 2022-02-14 11:36
marcannot from gpu-region-base; those are patch args to the firmware
#asahi-gpu · 2022-02-14 11:35
marcanthe firmware calls gpu-region-base "UAT GPTBAT" fwiw
#asahi-gpu · 2022-02-14 11:34
marcanthe ARM does not have that PT level, TTBRs are sysregs
#asahi-gpu · 2022-02-14 11:34
marcangpu-region-base is the TTBRs, right?
#asahi-gpu · 2022-02-14 11:25
marcanso these should be ARM format page tables
#asahi-gpu · 2022-02-14 11:25
marcanlooking at the firmware init a bit
#asahi-gpu · 2022-02-14 11:25
marcanphire: yeah, the ARM's TTBR gets pointed straight at gfx-shared-region-base
#asahi-gpu · 2022-02-14 10:46
marcanyou sign extend at some bit
#asahi-gpu · 2022-02-14 10:46
marcanand yes, that's how the PAC truncation works
#asahi-gpu · 2022-02-14 10:46
marcanalso I see it going to f8..fa
#asahi-gpu · 2022-02-14 10:46
marcanthat could be PAC?
#asahi-gpu · 2022-02-14 10:45
marcan0xffffff8000000000
#asahi-gpu · 2022-02-14 10:45
marcanmore Fs
#asahi-gpu · 2022-02-14 10:44
marcanwe have rtkit-private-vm-region-base which points to what very much looks like a typical ARM top half VM address space base
#asahi-gpu · 2022-02-14 10:44
marcanand then it's possible the ARM never actually has to R/W data in the lower half of the address space directly
#asahi-gpu · 2022-02-14 10:43
marcanyeah, like maybe the ARM's actual sysreg TTBR1 gets pointed to the same L1[0] and that all uses the standard VMSA lockdown stuff
#asahi-gpu · 2022-02-14 10:43
marcanmaybe they run in parallel?
#asahi-gpu · 2022-02-14 10:42
marcani.e. does this sit entirely outside of the ARM's own MMU?
#asahi-gpu · 2022-02-14 10:42
marcanalso I wonder how this works together with the ARM's actual page tables
#asahi-gpu · 2022-02-14 10:41
marcanmakes sense
#asahi-gpu · 2022-02-14 10:41
marcanyeah
#asahi-gpu · 2022-02-14 10:40
marcanI'm guessing UAT is the current generation of GART or so
#asahi-gpu · 2022-02-14 10:40
marcanbtw, stringsing the kexts, they seem to call the PTs UAT and GART somewhat interchangeably
#asahi-gpu · 2022-02-14 10:40
marcanthat would be awesome
#asahi-gpu · 2022-02-14 10:40
marcanin python right?
#asahi-gpu · 2022-02-14 10:35
marcanah, right
#asahi-gpu · 2022-02-14 10:35
marcanand doing it that way is quite Apple-like
#asahi-gpu · 2022-02-14 10:35
marcanbut yeah, if the AGX firmware maps its own PTs read-only, and then VMSA locks itself, early in init, that's all the code we need to audit to say "no backdoor here"
#asahi-gpu · 2022-02-14 10:34
marcanthat would make sense
#asahi-gpu · 2022-02-14 10:34
marcanpossibly a per-context VA prefix is involved?
#asahi-gpu · 2022-02-14 10:32
marcantheir cores already have the ability to lock translation on
#asahi-gpu · 2022-02-14 10:32
marcanthere's also the existing VMSA lockdown stuff
#asahi-gpu · 2022-02-14 10:30
marcanso only the initial mechanism to populate the PTs would have to be locked off
#asahi-gpu · 2022-02-14 10:30
marcanor rather, the PTs themselves are mapped with flags that might mean "RO from ASC"
#asahi-gpu · 2022-02-14 10:29
marcanhm, yeah, I don't see how that would work based on VA ranges, but it could still be what you say about the PTs getting locked
#asahi-gpu · 2022-02-14 10:11
marcanso that's in L0[1]?

plus ›