#
…

2022-02-04

00:03yuyichao has quit [Ping timeout: 480 seconds]
00:25yuyichao has joined #asahi-re
01:27chadmed has joined #asahi-re
02:40jbowen has quit [Ping timeout: 480 seconds]
02:54balrog has quit [Ping timeout: 480 seconds]
03:01balrog has joined #asahi-re
04:01PhilippvK has joined #asahi-re
04:04phiologe has quit [Ping timeout: 480 seconds]
04:32jbowen has joined #asahi-re
04:40latko[m] has joined #asahi-re
04:41jbowen has quit [Ping timeout: 480 seconds]
04:49_jannau_ has joined #asahi-re
05:45Rhys[m] has joined #asahi-re
05:54mini has joined #asahi-re
06:25riker77 has joined #asahi-re
06:30deathdisco[m] has joined #asahi-re
06:33ogimgd[m] has joined #asahi-re
06:33jbowen has joined #asahi-re
06:41jbowen has quit [Ping timeout: 480 seconds]
08:26IsfarSifat[m] has quit [Server closed connection]
08:26IsfarSifat[m] has joined #asahi-re
08:27wollymilkcap[m] has quit [Server closed connection]
08:27wollymilkcap[m] has joined #asahi-re
08:33jbowen has joined #asahi-re
08:34sppdqd[m] has quit [Server closed connection]
08:35sppdqd[m] has joined #asahi-re
08:35josipknezovic[m] has quit [Server closed connection]
08:35josipknezovic[m] has joined #asahi-re
08:41jbowen has quit [Ping timeout: 480 seconds]
08:55Major_Biscuit has joined #asahi-re
09:54NotHere[m] has quit [Server closed connection]
09:54NotHere[m] has joined #asahi-re
10:04long[m] has quit [Server closed connection]
10:04long[m] has joined #asahi-re
10:04matthewayers[m] has quit [Server closed connection]
10:04matthewayers[m] has joined #asahi-re
10:07ryanhrob[m] has quit [Server closed connection]
10:07ryanhrob[m] has joined #asahi-re
10:22why2[m] has quit [Server closed connection]
10:22why2[m] has joined #asahi-re
10:22sproede[m] has quit [Server closed connection]
10:22sproede[m] has joined #asahi-re
10:25Rhys[m] is now known as Rhys[m]1
10:25Rhys[m]1 is now known as Rhys[m]12
10:25Rhys[m]12 has quit [Quit: Reconnecting]
10:25Rhys[m]12 has joined #asahi-re
10:33jbowen has joined #asahi-re
10:41jbowen has quit [Ping timeout: 480 seconds]
10:52yrlf has quit [Server closed connection]
10:52yrlf has joined #asahi-re
11:05suricato has quit [Server closed connection]
11:06suricato has joined #asahi-re
12:18Retr0id has joined #asahi-re
12:33jbowen has joined #asahi-re
12:41jbowen has quit [Ping timeout: 480 seconds]
13:54svenphire: given that we're talking about strings let's move it here because some people want to be absolutely not exposed to any direct reverse engineering talk
13:54svenwhich strings make you think that the firmware is responsible for setting up GART?
13:54phirewell the strings include: "AGXSecureGart::unmap Timed out waiting for FW to process secure unmap after %llu ns" @%s:%d
13:55phirewhich susgest the firmware is somewhat involved in the process of mapping
13:55svenhm, weird
13:55phirethough I'm with alyssa. I'm expecting registers controlled by the cpu
13:56sventhere's also stuff like "kernel_gart_tables" @%s:%d which make it sounds it's the kernel itself
13:56svenif I were to speculate even more: AGXSecureSharedGartTableBacking maybe it's both actually? :D
13:56phireIt could require interaction on both sides?
13:56svencould be
13:57svenstill a bit weird, but who knows
13:57phireSo, assuming it is registers, they seem to be missing from ADT
13:58svenonly sort of
13:58sventhe registers are part of the agx node
13:58sventhe gart node just loads this gart kext which is very very small and only calls back into the main kext
13:58phirethe sgx node?
13:58svenlet me check again, it's been a while
13:59phireI've never seen those registers written to. only read
13:59svenyeah, i assumed they were in the sgx node
14:00phire0x4000-0x401c seem to be id/version registers
14:01phire0x11008-0x11014 seem to be some perf counters
14:01phirea few of the registers seem to count up when work is executed
14:02phireThen there are a few shared memory regions, gpu-region-base, gfx-handoff-base and gfx-shared-region-base
14:02phireI suspect work is being passed in via gfx-handoff
14:03phirebut it's passing in these pointers that we are assuming are GART pointers
14:03svendid you also check the second register range given in the adt?
14:04phiredepends on if trace_device("/arm-io/sgx", True) automatically picks them up
14:04svenhm... i think it does
14:04phireyeah, I think it does
14:31phiremaybe it's on the agx-asc node's registers
14:33jbowen has joined #asahi-re
14:36yuyichao has quit [Ping timeout: 480 seconds]
14:40phireno, that only has the expected asc traffic
14:42jbowen has quit [Ping timeout: 480 seconds]
14:42alyssa has joined #asahi-re
14:42alyssaphire: are u tracing the *-region/handoff-base memory?
14:42alyssaor how does that work
14:44phireThat's where I'm getting these "pointers" that I don't know where they point to
14:46Glanzmann has joined #asahi-re
14:46Glanzmann has left #asahi-re [#asahi-re]
14:51phireThere is very little data sent via the ASC interface. It basically looks like little more than a keepalive
14:56phireoh hang on, the pointers witten to gfx-shared-region-base actually point at real physical memory
14:59phirethey are also all unaligned
15:07jbowen has joined #asahi-re
15:09blassphemy[m] has joined #asahi-re
15:15alyssaunaligned pointers can sometimes be aligned pointers with extra data shoved in the bottom (and sometimes top) bits
15:15alyssai don't remember if apple does that, i think they do
15:15alyssaarm definitely does
15:15phireyeah, it's always 0x3
15:17svencould be kind of valid bit(s)
15:18svenin the DART PTEs the lowest two bits are used for that
15:18alyssaand what's pointed to at that address & ~0x3
15:20phirestuff that doesn't seem to be that interesting at a first glance
15:20phirefirst pointer points to nulls
15:21alyssawomp womp
15:23phiresecond points to a table with data like: 0x00600004061e0447, 0x00600004061e4447, 0x00600004061e8447...
15:23phirefew hundred 64bit values with slight increments between them
15:24phireit's only bits 16-23 that change
15:29alyssano chance any of those are tagged pointers?
15:30alyssa(0x4061e4440 or something)
15:30alyssaIncidentally, strings implies that AVE uses a GART too
15:32phireit's outside of physical memory
15:32phireand doesn't look virtual
15:32alyssamaybe it's time to pop open ghidra/ida
15:33alyssagive getGartPhysicalBaseAddress a looksies
15:34phirenot sure I want to go much beyond looking at strings RE wise
15:35phirethe fact that I'm seeing physical pointers in this gfx-shared-region is interesting
15:36phireimplies something has direct access to physical memory
15:39phireum, let me just check this isn't just stale data from iboot
15:39alyssapossible
15:40phirenope, it's clear at boot
15:41phirehowever... the cpu didn't write into it
15:42phireI think it's data belonging to the firmware
15:43alyssaCould be, yeah
15:46phireI think the cpu only ever writes into gfx-handoff
15:55phireI see it following a pattern of writing what looks like a pointer (like 0x1506f90000), then a size (0x14000), then setting a flag (to signal work is ready)
15:56phiremy theory is that these are command buffer pointers
15:57phireor pointers to some kind of task structure that has all the deatils
15:58alyssawhat's at the pointer?
15:58phireits' not valid
15:59phirereading it actually crashes m1n1
15:59alyssaso it's a GART VA maybe
16:00phireyes, that's the leading theory
16:02phireso I need to work out where GART is. though I probally should sleep at some point
16:03phiremight need to RE the kext
16:56yuyichao has joined #asahi-re
17:54Major_Biscuit has quit [Ping timeout: 480 seconds]
19:24m6wiq has joined #asahi-re
22:10Deewiant has joined #asahi-re
22:35j`ey has joined #asahi-re
23:44m6wiq has quit []
23:54yuyichao has quit [Ping timeout: 480 seconds]
…