2021-06-10
00:10klltkr has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
00:10klltkr has joined #asahi
00:11klltkr has quit []
00:11klltkr has joined #asahi
00:11klltkr has quit []
00:12klltkr has joined #asahi
00:12klltkr has quit []
01:25aquijoule_ has joined #asahi
01:31hspak has quit [Ping timeout: 480 seconds]
01:31aquijoule__ has quit [Ping timeout: 480 seconds]
01:31bgb_ has joined #asahi
01:32hspak has joined #asahi
01:40robinp has joined #asahi
01:46bgb_ has quit [Ping timeout: 480 seconds]
01:50bgb_ has joined #asahi
02:07yuyichao_ has joined #asahi
02:36nskl has joined #asahi
02:38nsklaus_ has quit [Ping timeout: 480 seconds]
02:50phiologe has joined #asahi
02:53PhilippvK has quit [Ping timeout: 480 seconds]
03:02bgb has joined #asahi
03:02bgb_ has quit [Ping timeout: 480 seconds]
03:07marvin24_ has joined #asahi
03:11marvin24 has quit [Ping timeout: 480 seconds]
04:36GreatGodvin has joined #asahi
05:03VinDuv has joined #asahi
05:26GreatGodvin has quit [Quit: WeeChat 3.1]
05:27GreatGodvin has joined #asahi
05:31GreatGodvin has quit []
05:33GreatGodvin has joined #asahi
06:11inglor has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
06:25VinDuv has quit [Quit: Leaving.]
07:09GreatGodvin[m] has joined #asahi
07:12GreatGod1 has joined #asahi
07:16GreatGodvin has quit [Ping timeout: 480 seconds]
07:18_jannau_has it any hardware which is not in the mac mini or laptop? ignoring details like the higher camera resolution. I assume the 2 USB3 ports are still driven by dwc3/pcie and are usb-c since usb-a ports would have protuded through the display
07:19GreatGodvin[m] has quit [Ping timeout: 480 seconds]
07:21GreatGod1 has quit []
07:22marcanplus there's a good chance once this all works it'll become one of my primary machines (though more likely by then a 27" M2 model will be out)
07:24GreatGodvin has joined #asahi
07:34_jannau_being able to test every configuration is good. I was wondering if there was anything extra to support
07:37_jannau_does adt.py print any sensitive information? if not it would be helpful to have the ADT for each model in the wiki
07:37JTLmarcan: I have the AmazonBasics wall mounted VESA arm, but I don't know how easy it is for you to get
07:37arndifixit has a nice teardown at https://www.ifixit.com/Teardown/iMac+M1+24-Inch+Teardown/142850
07:38arndI don't see anything surprising in there, but they don't have the corresponding mac mini teardown for comparison
07:39kettenis_ has joined #asahi
07:41kettenis has quit [Ping timeout: 480 seconds]
07:58bps has quit [Remote host closed the connection]
07:59bradfier has quit [Quit: Leaving...]
07:59bradfier has joined #asahi
08:01arndwhat do the other ones use? I guess the difference is that the mini has two type-A ports, while the imac has additional Type-C ports next to the two thunderbolt ports.
08:03GreatGodvin has quit [Quit: WeeChat 3.1]
08:03arndI'm confused now, I thought dwc3 was driving the type-C ports, isn't that how you get the endpoint mode on type-c?
08:08aleasto has joined #asahi
08:17marcan_jannau_: adt.py prints your wifi password/serial/etc, but we already have all the "generic" ADTs available in the recovery partition etc
08:17arndAh right, the mac mini has a Fresco Logic FL1100SX USB3.1 Gen1, using a single PCIe 2.1 lane. while ASM3142 uses two PCIe Gen3 lanes for USB3.1 Gen2 ports.
08:27_jannau_marcan: having the static information in the recovery partition for all models is good enough for me
08:50kettenis_ is now known as kettenis
09:04yuyichao_ has quit [Ping timeout: 480 seconds]
09:15GreatGodvin has joined #asahi
09:21Ariadne has joined #asahi
09:24choozy has joined #asahi
09:34arndthe only driver change I needed in the end is to include linux/dmapool.h, which is not implicitly included in all non-PCI configurations
09:34arndthe main change was rearranging parts of include/linux/pci.h so all the declarations are visible
09:35arndthe header uses an unconventional method of putting all its declarations inside of an #ifdef, and then having a small subset of them in the #else path as static inline helpers
09:36arndnormally we just make all those declarations visible in the kernel and only use the inline stubs for things that are commonly called but that can return an error code and have a working caller when the subsystem is disabled
09:42GreatGodvin has quit [Quit: WeeChat 3.1]
09:48arndI created a patch to add further inline functions, but on second thought I'm now removing the whole lot and just leave the declarations in place, with no inline stub. We'll see what breaks that way
09:57svenarnd: nice! i've been looking into how to do all the apple-specific stuff. not sure if just declaring a quirk and then patching random places like corellium did is the right way.
10:00svenit might be enough to just use a different set of blk_mq_ops with two or so functions replaced
10:05svenneeds a different nvme_submit_cmd (which is not part of any ops) and a different nvme_common_complete_rq (which is part of the queue ops) and some additional mmio pokes
10:08arndok, I see. That does seem quite invasive. We'll have to talk to the nvme maintainers anyway, to see if my approach for reworking the driver is what they want
10:09arndsven: is this on top of the other appple-specific quirks that are already in the driver, or are those just for older hardware?
10:27nskl has quit [Quit: WeeChat 3.1]
10:41nsklaus has joined #asahi
10:45marcanchoozy: curl|sh from recovery mode to install the bootloader, optionally install linux at the same time or use the bootloader to boot from an external drive
10:47marcanI probably just broke any wip trees people had making changes to proxyclient/ (or any non-pushed test scripts) so keep that in mind
10:47marcanI also cleaned up the namespaces a lot (no more a zillion unrelated things leaking into "from bla import *") so I expect I probably broke a bunch of stuff, but I tested all the basic experiments/tools to make sure they work
11:07yuyichao has joined #asahi
11:11marvin24_ is now known as marvin24
11:36bgb has quit [Ping timeout: 480 seconds]
11:37roxfan has quit [Ping timeout: 480 seconds]
11:43roxfan has joined #asahi
11:45bgb has joined #asahi
11:54bgb has quit [Ping timeout: 480 seconds]
12:02bgb has joined #asahi
12:10bgb has quit [Ping timeout: 480 seconds]
12:13bgb has joined #asahi
12:17fridtjof[m]btw, one interesting(?) thing from the imac m1 teardown: https://www.ifixit.com/Guide/iMac+M1+24-Inch+Full+Chip+ID/142907#s288718
12:18fridtjof[m]it says there's an "NXP Semiconductor SN210V NFC controller with secure element" on there
12:19fridtjof[m]now, i couldn't find much about that chip, and they didn't link anything there, so it might not be an NFC controller at all (rather just a secure element maybe)
12:20fridtjof[m]but maybe someone with that imac can find out more? There does not seem to be an NFC antenna anyway, but it's still kind of interesting
12:21aquijoule_ has quit [Ping timeout: 480 seconds]
12:28yuyichao has quit [Quit: Konversation terminated!]
12:31yuyichao has joined #asahi
12:49marcanfridtjof[m]: the iPads/etc have the same chip, and I bet all M1 macs do too (iFixit is nowhere near exhaustive/consistent with their chip IDs)
12:54fridtjof[m]ah, thanks. that makes sense then (i guess an nfc antenna would've been noticed by now anyway)
13:02yuyichao has quit [Ping timeout: 480 seconds]
13:04bps has joined #asahi
13:42marcanall the modules share the same globals namespace, and anything you define in them is also available in the shell
13:42marcanyou can also run_script(<path>) from the shell to do it dynamically (e.g. edit-test cycle)
13:48choozy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
13:49Fanfwemarcan: anti-rollback as in you can't downgrade your OS ? Why would they care putting such a thing in a Mac then ? I mean they've made sure that the bootloader is not locked and that you can run 3rd party OSes, so why would they prevent you from downgrading Mac OS then ?
13:50marcanFanfwe: anti-rollback as in you can't desolder the flash on your iPhone and take a backup, try 10 PINs, restore the backup, try 10 PINs, restore the backup, try 10 PINs, ...
13:52marcananti-downgrade *against the user's will* is another one of them - you can't downgrade Mac OS *bypassing* the normal attestation mechanisms for that reason too
13:52bgb has quit [Ping timeout: 480 seconds]
13:52marcanMacs do have hard anti-downgrade for SFR though (that's iBoot1, the NOR/first stage bootloader and 1TR) but not OS installs. You can downgrade macOS (though you might need to go to reduced security once Apple stops signing that old version)
13:55marcanthe decoupling between iBoot1 and iBoot2 is useful to us, because effectively iBoot2 (and the associated firmware/ADT blobs) define the OS interface
13:55marcanthat means we don't have to rush to support a new set of firmware interfaces/etc if Apple changes them in a way we don't support
13:56pinskia has quit [Remote host closed the connection]
13:56marcan(worst case we'll have to pull them from Apple's CDN directly though, in that case, since of course copying them from 1TR, which is my primary plan, won't work if we need an older version)
13:57FanfweYeah, as long as users have a copy of it somewhere. Since I guess you can't distribute them without Apple permission.
14:05Glanzmannmarcan: How is an anti rollback implemention to counter the fbi case you described above?
14:06brentr123[m]<Glanzmann "marcan: How is an anti rollback "> The fbi is the government lol, the government will always find a way no matter what
14:07brentr123[m]You can’t “counter the fbi”
14:09Fanfwebrentr123[m]: He didn't say "counter the fbi". He said "counter the fbi case [...] described above". Totally different.
14:10brentr123[m]Essentially the same thing I believe, trying to go around something the fbi can do either way
14:10brentr123[m]Or trying to patch out
14:14brentr123[m]Gottem
14:14marcanGlanzmann: read apple's platform security guide :-) but there's an external secure element that implements the secure rollback-protected storage
14:14FanfweYeah but the question was: "how does anti rollback allows to counter the fact that de-soldering the flash, backing it up, trying 10 pins, restoring the backup and keep trying until you find the right code is a working approach to pin cracking an iPhone (which, by the way, is something the fbi does)". The question was not "how to make it impossible for the fbi to crack a phone".
14:15marcanyou can't make it "impossible" to crack a phone, but you can make it "hard and expensive enough that the FBI will give up"
14:17marcanthe FBI tried, Apple said no, they had to give up and ask someone else; that someone else sold the FBU an exploit to open up the phone, then went on to found Corellium
14:17Glanzmannmarcan: I see. But I did not get the concept how anti rollback helps against desoldering flash.
14:17marcan(obviously this is all assuming no security flaws; security flaws happen but you can try to keep them at bay, and Apple's designs are really good these days)
14:18GlanzmannI was once in a forensic workshop where a russion company showed how many scrambling / encryptions algorithms they have implemented for hundreds of devices.
14:18GlanzmannSo they usually take the flash chip and work directly with that, without the controller.
14:18marcanthe rollback counter is stored in a secure element which you can't just read/write like a flash
14:19FanfweGlanzmann: yeah, but the flash contents is encrypted, so you can try to work offline on the encrypted data, trying to find the key to decrypt
14:19marcanyou cannot work offline on the encrypted data because the encrypted data is tied to a per-chip key
14:20GlanzmannFanfwe: I don't remember the details, but most where only scrambled, not encrypted, and sometimes the encryption key was stores on the same flash or it was the same for all devices, IIRC.
14:20hell__something needs to verify flash chip contents, and that something isn't part of the flash chip
14:20GlanzmannI see, so in apple the encryption key is stored in a secure enclave. It is only revealed wwhen the right pin is entered.
14:21marcanthe right pin is part of the key too, so you still need to figure out the right pin even if you magically get all the keys out
14:21Glanzmannmarcan: Yeah, that is what I learned, and you can't trust thunderbolt with your RAM. So best thing is to do it on the device as well as in software. :-)
14:22marcanyou can trust thunderbolt with your RAM if there is an IOMMU (and the drivers use it properly)
14:23marcanthe M1 is, as far as security/compartmentalization, miles ahead of anything x86 (except maybe the xbox one)
14:24marcanthere is no secret ME or SMM or anything like that where you can hide a backdoor to take over the system
14:24svenfwiw, there's already nice infrastructure in linux to allow darts in bypass mode. if pci->untrusted (or something like that) is set it won't allow any iommu in bypass mode unless you force it to
14:24marcanyou could theoretically backdoor the boot process on the main CPU, but the ARM design makes it very, very hard to do it undetectably (it's very hard to make a secret undetectable hypervisor or something like that)
14:29sveni think arnd mentioned it might be a good idea to find a general way to set this for all broadcom (or even all wifi) devices
14:30kettenisso if the generic of pci code in linux can handle a suitable property on that node, we should be alright
14:34Glanzmannmarcan: I see. Nice to know. Btw. does Linux use the IOMMU if it is available by default on amd64 or does a user need to enable it explicitly?
14:34_jannau_marcan: might be a good idea to (re)tweet the stream announcement with the AsahiLinux account
14:35kettenissven: the DT binding for the apple pcie controller already includes a node for the bridge corresponding to the root port
14:36arndkettenis: it should work, but it feels slightly wrong, since it's not the PCIe port that is external facing, but rather the device that is hardwired to that port
14:39kettenisbut it would be a viable stopgap measure while you guys figure out how to handle the mismatched page size issue in the IOMMU code
14:40arndGlanzmann: it depends on the iommu driver, and the CPU architectures. Most combinations support both strict and relaxed modes, but the defaults are inconsistent
14:43arndGlanzmann: on some architectures, using the iommu causes a fairly large overhead, so those would only be used if necessary to avoid bounce buffers, but fall back to bypass mode in other cases.
14:46arndGlanzmann: not sure. Usually you can find some output in dmesg, but there may be a generic interface for querying at runtime that I'm not aware of
14:50arnddrivers/iommu/iommu-sysfs.c tells me there should be something in /sys/class/iommu/, but all the x86 machines I'm looking at have nothing in there, so maybe they just have it disabled
14:52sorearWhat about Arm makes non-architectural extra hypervisors more difficult than other architectures?
14:53yrlf has quit [Quit: The Lounge - https://thelounge.chat]
14:53yrlf has joined #asahi
14:53yrlf is now known as Guest1586
14:54Guest1586 has quit []
14:55thelounge54 has joined #asahi
14:55thelounge54 is now known as yrlf
14:55yrlf has quit []
14:55yrlf has joined #asahi
14:57Glanzmannarnd: I have a AMD Ryzen which has /sys/class/iommu/ populated. https://pbot.rmdir.de/kLNmHfHnnQdUMXYLyUV-kw
15:05sorearI need to look into how nested virt works on arm, I take it it’s not just a matter of trapping and emulating EL2-only registers
15:17marcanso in order to do this you need to do stuff like patch the EL1 exception vectors (which is what my hypervisor does...)
15:33bgb has joined #asahi
15:43bgb has quit [Ping timeout: 480 seconds]
15:47bgb has joined #asahi
16:01bgb has quit [Ping timeout: 480 seconds]
16:10Andalu30 has joined #asahi
16:23sorearm68k and x86 started out with a CurrentEL mechanism but got rid of it later, a breaking change in the 68020’s case. they’re also saying about as directly as possible “popek/goldberg considered harmful”
16:45VinDuv has joined #asahi
16:55aleasto has quit [Remote host closed the connection]
17:08Andalu30 has quit [Ping timeout: 480 seconds]
17:10mazsorear: the ARM architecture isn't virtualisable. not in the Popek/Goldberg sense anyway. even with NV2, it is all a massive hack that only allows a small portion of the architecture to be approximated.
17:11aleasto has joined #asahi
18:19Andalu30 has joined #asahi
18:35Andalu30 has quit [Read error: Connection reset by peer]
18:44Gues_____ has joined #asahi
18:44Gues_____ is now known as r0ni
19:08PhilippvK has joined #asahi
19:12phiologe has quit [Ping timeout: 480 seconds]
19:29* psydroidconsiders the topic not to be harmful and notices people do try to be helpful and considerate
19:37tsida has quit [Remote host closed the connection]
20:14aleasto has quit [Remote host closed the connection]
20:37TheJollyRoger has quit [Ping timeout: 480 seconds]
21:02choozy has joined #asahi
21:03VinDuv has quit [Quit: Leaving.]
21:04tsida has joined #asahi
22:12choozy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
22:35kettenis_ has joined #asahi
22:37kettenis has quit [Ping timeout: 480 seconds]
23:34jn has quit [Remote host closed the connection]
23:35jn has joined #asahi
23:49tsida has quit [Remote host closed the connection]