#asahi · 2021-05-05 17:49
marcanlet me upgrade to 11.3.1...#asahi · 2021-05-05 17:48
marcanjust did it with my installed kernelcache, 11.2.3, 20D91, still yields valid code#asahi · 2021-05-05 17:44
marcanhttps://mrcn.st/p/XqCa9hs7 is how you do it#asahi · 2021-05-05 17:42
marcanunless something changed since january, which is when this is from#asahi · 2021-05-05 17:41
marcanjust plain feeding it all brute force through objdump produces obvious code#asahi · 2021-05-05 17:41
marcan d6d95c: d53de248 mrs x8, cntp_cval_el02#asahi · 2021-05-05 17:41
marcan d520dc: d51be228 msr cntp_ctl_el0, x8#asahi · 2021-05-05 17:41
marcan d51fb4: d51be228 msr cntp_ctl_el0, x8#asahi · 2021-05-05 17:41
marcan d514e4: d51be228 msr cntp_ctl_el0, x8#asahi · 2021-05-05 17:41
marcan$ aarch64-linux-gnu-objdump -D -b binary -m aarch64 kernelcache.macho | grep cntp#asahi · 2021-05-05 17:40
marcanif you mean the kernelcache file, that would be an img4 wrapper built by kmutil; you need to extract the mach-o from it first before feeding it back to it#asahi · 2021-05-05 17:40
marcanwhat are you calling the "kernel cache"?#asahi · 2021-05-05 17:20
marcannot planning on ever looking at it again :)#asahi · 2021-05-05 17:20
marcanthe only thing I ended up doing in the early days was objdumping the xnu init section to figure out exactly what chicken bits Corellium got from there (and that told me they didn't know what they were doing and had copied useless stuff and added some of their own, so it was a good thing I did it :P)#asahi · 2021-05-05 17:19
marcansven: ghidra sadly barfs on current kernelcaches, but I'm trying to avoid disassembling anything at this point so I don't care#asahi · 2021-05-05 17:18
marcan(single core initially, multicore will come a bit later, but that's good enough for a lot of work)#asahi · 2021-05-05 17:18
marcanwill do more dev in the next 1-2 days; chances are good I'll have serial over a secondary CDC-ACM brought up really soon and that will mean anyone can load Linux kernels and debug m1n1 and Linux (and u-boot or whatever) bring-up with zero special hardware or cables or fuss, which is a big win#asahi · 2021-05-05 17:16
marcanI chose the hypervisor approach because I liked it initially, and it is proving to have been an *excellent* idea because it also becomes a magical debugger for m1n1 and Linux themselves that anyone will be able to use, without a serial cable. built in USB to serial.#asahi · 2021-05-05 17:16
marcanand yes, what I want to do could be accomplished with kexts, or with a patched FOSS XNU build, or any other number of ways#asahi · 2021-05-05 17:15
marcanand objdump absolutely disassembles it fine, so you must be doing something weird ;)#asahi · 2021-05-05 17:14
marcan(and this also means my hypervisor stuff *will* work, modulo a as-yet unconfirmed level of fuckery to deal with corner cases due to macos running in EL1 not EL2, but by definition nothing insurmountable)#asahi · 2021-05-05 17:13
marcanI assume the only thing that wouldn't work is SEP-mediated DRM#asahi · 2021-05-05 17:13
marcanthis is retail darwin, not a xnu source dump build, so everything enabled#asahi · 2021-05-05 17:13
marcanworked fine (and that also kills any conspiracy theories about apple "blocking" anything for custom kernels)#asahi · 2021-05-05 17:12
marcanthe very first test I did to convince myself kmutil worked was patch the darwin version string to say "Linux" and boot it#asahi · 2021-05-05 17:12
marcanthat is the entire point#asahi · 2021-05-05 17:12
marcanpipcet[m]: the macos macho absolutely boots as a custom kernel#asahi · 2021-05-04 18:55
marcanI wrote kexec for freebsd -> linux instead, on x86 :p#asahi · 2021-05-01 12:07
marcanit would never work in the VHE way of doing things though...#asahi · 2021-05-01 12:06
marcanbut really, if the kernel goes in that direction it might as well be an EL2/EL1 thing and not try to use any of this guarded exec stuff#asahi · 2021-05-01 12:05
marcanmjg59_: it might make sense as an extension of something like nVHE KVM mode, except, whoops, that doesn't work on the M1#asahi · 2021-05-01 04:36
marcanand that's probably too intrusive#asahi · 2021-05-01 04:36
marcanbut by definition to make use of it you need to move page table management in there too#asahi · 2021-05-01 04:35
marcane.g. for dm-crypt#asahi · 2021-05-01 04:35
marcanthat said, it might make sense to put crypt code and keys in there#asahi · 2021-05-01 04:34
marcanit's not a terribly useful concept for linux, at least not used that way#asahi · 2021-05-01 04:34
marcan"put your page management code in a box and make it enforce codesigning"#asahi · 2021-05-01 04:34
marcanI like to think of it as the xbox 360 hypervisor#asahi · 2021-05-01 04:34
marcanit's just the PPL hack but with hardware support#asahi · 2021-04-30 08:14
marcanheh#asahi · 2021-04-30 08:04
marcanhttps://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=aefcf2f4b58155d27340ba5f9ddbe9513da8286d#asahi · 2021-04-30 08:04
marcanmjg59_: wait, didn't kernel lockdown show up in like 2019?#asahi · 2021-04-30 08:01
marcan(and I need to reverse engineer the user db stuff to make it work...)#asahi · 2021-04-30 08:01
marcanthat is a blocker for macos-free installs#asahi · 2021-04-30 08:01
marcanI should grab the latest macos beta and see if apple have improved any of the OS adoption stuff#asahi · 2021-04-30 07:58
marcanmight as well reduce dependencies on their stuff#asahi · 2021-04-30 07:58
marcanI mean, I don't really see a point in trying to use any apple infra for this, when we can just swap out the bootloader#asahi · 2021-04-30 07:58
marcanyeah#asahi · 2021-04-30 07:58
marcanif we really want to abuse those flags for secureboot, we could#asahi · 2021-04-30 07:58
marcanthere is also the whole csrutil/SIP thing