#
…

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.]
06:36marcanM1 iMac acquired :-)
06:36marcanneed to figure out a VESA arm for it though
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:21marcanwe'll see I guess
07:21GreatGod1 has quit []
07:21marcanif nothing else the display will be one more variant to test
07:21j_eyand who can turn down another m1?
07:22marcanI mean I'm making a point of being able to test all the major HW configs
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:38JTLif the VESA mount for the iMac is 100x100, it *should* work, weight permitting
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:51_jannau_USB3 ports are using ASM3142 and a cypress usb-pd controller
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:02_jannau_the mac mini uses dwc3 for the usb-a 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:05svenyeah, dwc3 is usb-c and pcie/xhci is usb-a
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:17marcanI'm not sure the wiki is the place for that though
08:17marcanway too big
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
08:53kettenisthe cheapest iMac doesn't have the ASM3142 chip I suppose?
09:04yuyichao_ has quit [Ping timeout: 480 seconds]
09:15GreatGodvin has joined #asahi
09:21Ariadne has joined #asahi
09:24choozy has joined #asahi
09:33arndsven: I figured out the build failures with my nvme series
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:56choozyWhat is planned as an installer if the M1 machines can not boot from external drives?
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:00svennot sure yet :)
10:01arndsven: what kind of quirks are those?
10:02kettenisthese apple "nvme" devices use some funky inear command queue instead of a ring
10:03ketteniss/inear/linear/
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:08ketteniswonder if the queing mechanism matches the "NVMe-over-Fabrics" standard
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:11svenit needs NVME_QUIRK_SINGLE_VECTOR and NVME_QUIRK_SHARED_TAGS
10:11sven(and possibly another one to not try nvme_scan_ns_list which always seems to fail)
10:12svenand yeah, it's quite invasive changes on top of the platform split :/
10:27nskl has quit [Quit: WeeChat 3.1]
10:41nsklaus has joined #asahi
10:44marcanjust pushed a big reorg of proxyclient/ to clean up the hierarchy
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:28kettenisstill works for me
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:15choozyAh, yes, marcan
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:49marcanApple do have external secure storage for anti-rollback; it might just be that
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:37marcanjust pushed a thing for running hypervisor setup scripts from run_guest.py
13:37marcanso we can move away from hacking directly on hv.py
13:38marcane.g. tools/run_guest.py -m hv/trace_agx.py <...>
13:42marcanall the modules share the same globals namespace, and anything you define in them is also available in the shell
13:42marcanalso stuff persists across shell runs now
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:50marcan(this is how the FBI cracks iPhones)
13:51marcanthere are many security reasons to have rollback-protected storage
13:51FanfweYup ok, that makes sense then
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:53marcannot sure how that's done though, it might be fuses and not the SE, no idea
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:55marcanwe can continue to use the version of those components that we 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:57marcan(nothing that can't be done in an installer though)
13:57FanfweYeah, as long as users have a copy of it somewhere. Since I guess you can't distribute them without Apple permission.
13:57FanfweYep, as long as Apple leaves them available on their CDNs, indeed
13:58marcanI think they usually leave these things forever on their CDN
13:59marcaneither way we do intend to support newer versions (which probably have bugfixes etc)
13:59marcanit just means we don't need to panic when incompatible updates happen
14:03Fanfweyup. Allright thanks for all those details !
14:05Glanzmannmarcan: How is an anti rollback implemention to counter the fbi case you described above?
14:05Glanzmannimplemented?
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:14marcanbrentr123[m]: the government are not magical, they cannot bypass math and physics
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:15marcanwhich is what Apple aims for
14:16FanfweThey won't give up, they'll ask a court to force you to help. And you can't either :D
14:16marcanhasn't worked in the past
14:16Fanfwethanks god
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:17FanfweYou can desolder the flash, but it won't help as it is encrypted
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:18marcanGlanzmann: if you try to rollback the flash contents the phone will reject it
14:18GlanzmannSo they usually take the flash chip and work directly with that, without the controller.
14:18Glanzmannmarcan: I see, now I got it.
14:18marcanthe rollback counter is stored in a secure element which you can't just read/write like a flash
14:18GlanzmannGot the idea, thanks.
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:19Fanfweor you can try to bruteforce a rather simple pincode
14:19marcanthe phone will self destruct the data after a certain number of attempts
14:19marcanyou cannot work offline on the encrypted data because the encrypted data is tied to a per-chip key
14:20Fanfwethe latter sounds much easier, but only if you have unlimited pin attempts
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:20marcanso you can't bruteforce the pincodes except on the device itself
14:20marcanand the anti-rollback ensures the hard limit on attempts
14:20marcanGlanzmann: most storage encryption (the "self-encryption" kind) is garbage and insecure
14:20marcanyou cannot trust SSD/HDD vendors on any of this
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:20hell__AFAIK roots of trust start inside the SoC nowadays
14:21GlanzmannIf the pin is x times wrong it burns the secret key, end of storry.
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:21marcanbut otherwise yes
14:21FanfweI think it even wipes the data on the flash, in fact
14:21Fanfwenot just the key
14:21marcanit should just wipe the keys
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:22marcanthey call it "effaceable storage"
14:22marcanyou can trust thunderbolt with your RAM if there is an IOMMU (and the drivers use it properly)
14:22GlanzmannFanfwe: WOuld make sense.
14:22marcanwhich is why I refuse to allow DART bypass for the TB ports in linux
14:22marcan(at least not without some scary sounding explicit parameters)
14:22Glanzmannmarcan: I know, but often there is not or it is misconfigured.
14:22marcanyes and I'm going to make sure ours is there and properly configured :)
14:23GlanzmannI also heard storries of people hotplugging PCI devices in order to dump the RAM.
14:23marcanthe internal PCIe port also has an IOMMU
14:23GlanzmannI see. Cool.
14:23marcanthe M1 is, as far as security/compartmentalization, miles ahead of anything x86 (except maybe the xbox one)
14:23marcanall the coprocessors have IOMMUs
14:24marcanthere is no secret ME or SMM or anything like that where you can hide a backdoor to take over the system
14:24Fanfweyup, saw your thread about this on twitter few days ago
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:24sven*disallow darts
14:27marcansven: good :)
14:27svenall we need to figure out is a sane way to set that untrusted thing for the wifi chip :)
14:28kettenissven: my plan is to add a node in the device tree for the wifi chip
14:29ketteniswe need to have a place to store its mac-address
14:29marcanso we should be able to set the untrusted thing there (add a binding if there isn't one)
14:29svenyou can just set the pci bridge to external-facing, but that's ugly
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:35kettenisso using "external-facing" there should already work
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:40marcan_jannau_: good point, done :)
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:44Glanzmannarnd: I see, how can I check if my system currently uses the iommu?
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
14:58sorearor was this about malware not being able to use the architectural EL2
14:58marcanarnd: /sys/class/iommu should be there if it's enabled
14:59marcanit is on my systems
14:59marcansorear: right, if you're in EL1 you'd notice
14:59marcanand there is no nesting support
14:59marcanfaking it would be a ton of work
14:59marcanit's not really intended to be possible
15:00marcanI explicitly boot with intel_iommu=igfx_off though
15:01svenyou want to look for /sys/kernel/iommu_groups/0/type
15:01svenif that file contains identity the iommu is in bypass mode
15:02sven(and there might be multiple groups)
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:06marcanthe problem is you can't do that
15:17marcanARM does not let you trap arbitrary registers
15:17marcanEL2-only registers trap to *EL1*
15:17marcan(as they are considered undefined instructions)
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:18marcanbut then how are you going to trap stuff like CurrentEL?
15:18marcanso yeah, hardware NV support adds a whole pile of stuff to make this all possible
15:18marcanincluding things like redirecting sysregs to RAM
15:33bgb has joined #asahi
15:35mazyou could emulate NV my running everything at EL0. good luck with that.
15:37maz(and even by doing that, CurrentEL would still return the wrong thing).
15:38sorearCurrentEL is readable at EL0? ew
15:38mazyup, and it will always say EL0.
15:43sorearthat had to have been very contentious
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:18mazsorear: contentious? why?
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
17:58krbtgtiirc x86 never got rid of currentel
17:58krbtgtit just never was virtualizable according to P&G rules
17:58krbtgtit just pissed all over them
17:58krbtgti.e yuou can load the MSW unprivleged
17:59krbtgtwhereas 680*1*0 changed the ISA to make that privileged and thus comply to P&G
18:02krbtgtanyways the considered hamrufl is pretty interesting. i wonder why
18:03krbtgti prob guess "it's bad for a guest to not know it's being virtualized"
18:19Andalu30 has joined #asahi
18:26bloomconsidered harmful considered harmful
18:28bloomconsidered harmful considered harmful considered harmful
18:29j_eyad infinitum
18:30hell__.* considered harmful
18:30bloomconsidered helpful considered harmful
18:35Andalu30 has quit [Read error: Connection reset by peer]
18:36jnconsiderations considered considerate
18:44Gues_____ has joined #asahi
18:44Gues_____ is now known as r0ni
18:54bfredl[m]harm is considered helpful
18:54bloomsadistic much?
18:55* hell__would go on, but notices /topic talking about keeping things on topic
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]
…