2022-01-31
00:38roxfan has joined #asahi-dev
00:47chadmed has quit [Ping timeout: 480 seconds]
01:28chadmed has joined #asahi-dev
03:06phiologe has joined #asahi-dev
03:10PhilippvK has quit [Ping timeout: 480 seconds]
03:55kov has quit [Quit: Coyote finally caught me]
03:55kov has joined #asahi-dev
06:24the_lanetly_052___ has joined #asahi-dev
06:44kloenkmarcan: I have my boring lecture tomorrow again. Should I try to covert adt to rust, or build some fat support (if fat, where to hook it?)
06:45marcanif you want something to investigate, I'm curious whether we can bypass cargo and just git submodule in the things we need, to make the whole system more self contained (one recursive clone like we already do, no extra network access or anything for builds)
06:46marcanand for sigs, https://github.com/dalek-cryptography/ed25519-dalek (with all the optional stuff turned off)
06:49marcanalso, since this code is only for chainloads, it means we can support the use case of people installing "official" m1n1 in non-chainload mode (from a binary) and then doing local m1n1 builds for development, without depending on rust at all
06:50marcanwhich I think is worth it; as cool as rust is, it's worth keeping m1n1 builds as friction free as possible for folks, and the big part that benefits from it is not something needed for most use cases
06:52kloenkWould you be willing to change to meson for that? I saw how to call rustc from kbuild. I’m damaged for life xP
06:54kloenkThe submodule stuff is actually why I can’t currently build it with one command on my Linux machine. My builder does not copy the submodule
06:55marcanI've been meaning to learn meson, but I don't know if doing that on top of the rust stuff is really called for right now :p
06:57marcanif we can get cargo to use pre-downloaded assets for all the deps and never talk to the network, then using cargo to build the rust chunk is fine
06:58marcan(this is partially driven by me having had, er, bad experiences with language-native package manager stuff when doing things like building distro packages... the tool is fine, going out to the internet to download stuff isn't)
06:58kloenkmarcan: Yes, that’s possible. But not that good with submodules. What about a dist make target, which creates a tarball?
07:01marcanright, so ideally we'd build that vendor dir out of submodules; alternatively we could just vendor in the deps in the main git tree, which we already do for tinf/lzma/vsprintf/dlmalloc/chunks of pdlibc anyway
07:01kloenkYes rustc is basically a compile, but cargo handles all the cross compile stuff. That’s why I would prefer it
07:02marcan(fwiw: I know cargo makes life easier for more complex projects, especially around dependency updates... but I'm not too worried about that because the scope of this part of the code is so simple, I don't see us ever really needing to upgrade the deps, unless there is some catastrophic security fail in the ed25519 package or something)
07:02marcananyway poke around and see if you can show me how things would look; I'll do that myself too and decide at some point, but first I've got more pressing things on my plate :)
07:18kloenkThe ed25519 lib is not completely no_std. The batch feature needs alloc. So probably will create a globalAlloc next, and then try to add the crates as a dependency for testing
07:30jeffmiw has quit [Ping timeout: 480 seconds]
07:33the_lanetly_052___ has quit [Ping timeout: 480 seconds]
07:45arnd_ has quit []
07:46arnd has joined #asahi-dev
08:00svenwe'll also need a GPT crate, but i'm sure there's something with no_std for that one as well
08:00MajorBiscuit has joined #asahi-dev
08:02kloenkI think alloc still has an advantag, for strings and CStrings for ffi and so. It should be fairly simple to implement
08:33nsklaus has joined #asahi-dev
08:36manawyrm has quit [Ping timeout: 480 seconds]
08:36V_ has joined #asahi-dev
08:36mixi has quit [Ping timeout: 480 seconds]
08:36leah1 has joined #asahi-dev
08:36kloenk has quit [Ping timeout: 480 seconds]
08:37Major_Biscuit has joined #asahi-dev
08:37psykose has quit [Ping timeout: 480 seconds]
08:37Dragoon has joined #asahi-dev
08:37jn_ has joined #asahi-dev
08:37Dragoon is now known as Guest1237
08:38psykose has joined #asahi-dev
08:38null-nop[m] has quit [Ping timeout: 480 seconds]
08:38DiscoPenguin[m] has quit [Ping timeout: 480 seconds]
08:38cde[m] has quit [Ping timeout: 480 seconds]
08:38MajorBiscuit has quit [Ping timeout: 480 seconds]
08:38IbrahimMAkrab[m] has quit [Ping timeout: 480 seconds]
08:38leah has quit [Ping timeout: 480 seconds]
08:38nsklaus_ has quit [Ping timeout: 480 seconds]
08:38Shiz has quit [Ping timeout: 480 seconds]
08:38DragoonAethis has quit [Ping timeout: 480 seconds]
08:39GraysonGuarino[m] has quit [Ping timeout: 480 seconds]
08:39IsfarSifat[m] has quit [Ping timeout: 480 seconds]
08:39josipknezovic[m] has quit [Ping timeout: 480 seconds]
08:39MatthewLeach[m] has quit [Ping timeout: 480 seconds]
08:39sppdqd[m] has quit [Ping timeout: 480 seconds]
08:39legarts[m] has quit [Ping timeout: 480 seconds]
08:39xorly[m] has quit [Ping timeout: 480 seconds]
08:39svenpeter[m] has quit [Ping timeout: 480 seconds]
08:39Dementor[m] has quit [Ping timeout: 480 seconds]
08:39ryanhrob[m] has quit [Ping timeout: 480 seconds]
08:39samfromspace[m] has quit [Ping timeout: 480 seconds]
08:39rethematrix[m] has quit [Ping timeout: 480 seconds]
08:39RowanGoemans[m] has quit [Ping timeout: 480 seconds]
08:39matthewayers[m] has quit [Ping timeout: 480 seconds]
08:39NotHere[m] has quit [Ping timeout: 480 seconds]
08:39long[m] has quit [Ping timeout: 480 seconds]
08:39landscape15[m] has quit [Ping timeout: 480 seconds]
08:39citruscitrus[m] has quit [Ping timeout: 480 seconds]
08:39ybk[m] has quit [Ping timeout: 480 seconds]
08:39wollymilkcap[m] has quit [Ping timeout: 480 seconds]
08:39casperes1996[m] has quit [Ping timeout: 480 seconds]
08:39roxiun[m] has quit [Ping timeout: 480 seconds]
08:39_andy_t_ has quit [Ping timeout: 480 seconds]
08:39djk121[m] has quit [Ping timeout: 480 seconds]
08:39timokrgr has quit [Ping timeout: 480 seconds]
08:39nirusu[m] has quit [Ping timeout: 480 seconds]
08:39abbas_faiz[m] has quit [Ping timeout: 480 seconds]
08:39jn has quit [Ping timeout: 480 seconds]
08:39V has quit [Ping timeout: 480 seconds]
08:39ryanhrob1[m] has quit [Ping timeout: 480 seconds]
08:39mariogrip[m] has quit [Ping timeout: 480 seconds]
08:39sproede[m] has quit [Ping timeout: 480 seconds]
08:39lockna has quit [Ping timeout: 480 seconds]
08:39houlton[m] has quit [Ping timeout: 480 seconds]
08:39kjm99[m] has quit [Ping timeout: 480 seconds]
08:39ghantaz[m] has quit [Ping timeout: 480 seconds]
08:39kloenk has joined #asahi-dev
08:43sveni'm not gonna enable that chainload from fat for my machines anyway. i'm very happy with the 1TR roundtrip fwiw
08:50Shiz has joined #asahi-dev
08:51marcanit's mostly for distros that want to ship m1n1 and do end to end upgrades, which will need that for DT updates
08:52svensure, i can see why it's useful. i just don't want to manage my own signatures if I can just use the 1TR thing to take care of it
08:53marcankloenk: alloc has interactions with C malloc; either we build it on top of that (expands the attack surface to some extent) or we have them fight for heapblock (which is doable but not optimal)
08:55kloenkkettenis: Totally agree not to pull the world. But I also see no advantage in reinventing the wheel, and writing an own fat driver, if there is somtihg good usable available
08:58akemin_dayo has joined #asahi-dev
09:01eragon has joined #asahi-dev
09:03marcanit wouldn't be that bad to reinvent FAT, but yeah in this case I think reasonable implementations exist so there isn't much point
09:04marcanthe main point of this exercise is to just use Rust to get memory correctness guarantees which basically makes the whole thing close to provably secure (if not formally, then very easy to informally convince yourself it's secure)
09:06marcanif rust guarantees malloc/free correctness at the interface that *could* be done, but since it looks like we can get away without it, that's better
09:06kettenisI see too many open source software projects that end up with insane build-dependencies
09:06marcanrust should be "read block, write block" on one end and "give me a verified m1n1 blob" on the other, no more
09:07marcanas I said, my intention at this point is to make this entire thing both self-contained without a build system going off to the internet, and optional (and in fact disabled by default)
09:08marcanin fact even distros won't have to build any of this, unless they want to ship their own installer
09:08marcanand in the installer I can provide a 1st stage with the verification, which will be triggered by a payload command/var thing inclunding the distro public key
09:08marcanthen the installer just needs to let you pick what distro you want to install to select a known pubkey (or pick for you if you choose an embedded install)
09:09marcanit will of course also have a mode to load a 2nd stage without any verification, for those who don't care
09:15kloenkNixos already uses a ed25519 key for binary signing. I wonder if it would be possible to reuse that. But that's for the far far future :)
09:23manawyrm has joined #asahi-dev
09:23timokrgr has joined #asahi-dev
09:29robher has quit [Ping timeout: 480 seconds]
09:31manawyrm has quit [Ping timeout: 480 seconds]
09:32robher has joined #asahi-dev
09:33timokrgr8 has joined #asahi-dev
09:33timokrgr has quit [Ping timeout: 480 seconds]
09:33timokrgr8 is now known as timokrgr
09:34manawyrm has joined #asahi-dev
10:04ChaosPrincesseven as a rust enthusiast, being 'written in rust' does not equal the software being secure, to actually claim that, someone would need to audit fatfs crate code and probably pin the version.
10:13_andy_t_ has joined #asahi-dev
10:16marcanChaosPrincess: if the interface to C is guarded to ensure no invariant violations, and Rust itself memory safety, then modulo DoS bugs (which aren't really relevant), there is no real need to audit the fatfs code since its job is just to pull bits from disk that will then be signature-verified
10:17marcanit's kind of rare to be in this position; we can say this because of how simple the problem we're trying to solve is
10:17marcanmain thing I can think of is I should make sure stack overflows aren't exploitable; I think I got rid of guard pages during a refactor recently, I should reintroduce those
10:19marcanand we will pin the version of everything; as I said I have no intention of letting cargo go out to the internet during the build process
10:19ChaosPrincessi guess we are not guarding from hostile nvme controller so that rules out toctou, and fatfs is just an inert blob of bits that way
10:20marcandoesn't really matter how it does that; either it passes verification after that or it doesn't
10:21sveni'm also not sure what threat model would include a hostile nvme controller (which has signed firmware loaded by iBoot) at that point
10:21marcanyeah, even though I do want to audit the rtkit code a bit to plug any obvious vulns, this is a fairly far fetched threat model
10:21marcanin principle you could exploit the ANS codebase via the PCIe links to the NAND somehow, and then try to escalate from there
10:21marcanbut I somehow doubt iBoot itself is fully hardened against this, being written in C itself...
10:23marcanthere's no way the language itself is helping you with the buffer munging happening there
10:32povik22:50 <povik> marcan: hey this needs to be cleared in GUARD_SILENT: https://github.com/AsahiLinux/m1n1/blob/main/src/exception.c#L191
10:45the_lanetly_052___ has joined #asahi-dev
11:37null-nop[m] has joined #asahi-dev
11:38cde[m] has joined #asahi-dev
11:43DiscoPenguin[m] has joined #asahi-dev
11:51IbrahimMAkrab[m] has joined #asahi-dev
12:44XeR has quit []
12:48XeR has joined #asahi-dev
13:07jn_ has left #asahi-dev [https://quassel-irc.org - Chat comfortably. Anywhere.]
13:13jn has joined #asahi-dev
13:34Major_Biscuit has quit []
13:35MajorBiscuit has joined #asahi-dev
14:09landscape15[m] has joined #asahi-dev
14:15MajorBiscuit has quit [Quit: WeeChat 3.4]
14:15MajorBiscuit has joined #asahi-dev
14:19ybk[m] has joined #asahi-dev
14:22MajorBiscuit has quit [Quit: WeeChat 3.4]
14:22MajorBiscuit has joined #asahi-dev
14:25GraysonGuarino[m] has joined #asahi-dev
14:25IsfarSifat[m] has joined #asahi-dev
14:26wollymilkcap[m] has joined #asahi-dev
14:29sppdqd[m] has joined #asahi-dev
14:29josipknezovic[m] has joined #asahi-dev
14:30MatthewLeach[m] has joined #asahi-dev
14:39yuyichao_ has quit [Ping timeout: 480 seconds]
14:53yuyichao_ has joined #asahi-dev
15:06NotHere[m] has joined #asahi-dev
15:06citruscitrus[m] has joined #asahi-dev
15:07casperes1996[m] has joined #asahi-dev
15:07Dementor[m] has joined #asahi-dev
15:07xorly[m] has joined #asahi-dev
15:09RowanGoemans[m] has joined #asahi-dev
15:11rethematrix[m] has joined #asahi-dev
15:11svenpeter[m] has joined #asahi-dev
15:11long[m] has joined #asahi-dev
15:11matthewayers[m] has joined #asahi-dev
15:11svenpeter[m] is now known as Guest1290
15:12legarts[m] has joined #asahi-dev
15:13samfromspace[m] has joined #asahi-dev
15:13ryanhrob[m] has joined #asahi-dev
15:13roxiun[m] has joined #asahi-dev
15:15djk121[m] has joined #asahi-dev
15:18ryanhrob1[m] has joined #asahi-dev
15:18mariogrip[m] has joined #asahi-dev
15:19nirusu[m] has joined #asahi-dev
15:19abbas_faiz[m] has joined #asahi-dev
15:20ghantaz[m] has joined #asahi-dev
15:20kjm99[m] has joined #asahi-dev
15:20sproede[m] has joined #asahi-dev
15:20houlton[m] has joined #asahi-dev
15:20lockna has joined #asahi-dev
16:45mixi has joined #asahi-dev
17:13waagrr has quit [Remote host closed the connection]
17:16the_lanetly_052___ has quit [Ping timeout: 480 seconds]
17:53___nick___ has joined #asahi-dev
18:01jbowen has quit [Ping timeout: 480 seconds]
18:04___nick___ has quit []
18:05___nick___ has joined #asahi-dev
18:06___nick___ has quit []
18:07___nick___ has joined #asahi-dev
18:11MajorBiscuit has quit [Ping timeout: 480 seconds]
18:17jbowen has joined #asahi-dev
18:42yuyichao has joined #asahi-dev
18:45yuyichao_ has quit [Ping timeout: 480 seconds]
18:47yuyichao_ has joined #asahi-dev
18:51yuyichao has quit [Ping timeout: 480 seconds]
18:53m6wiq has joined #asahi-dev
20:11phire has joined #asahi-dev
20:59m6wiq1 has joined #asahi-dev
21:00m6wiq1 has quit []
21:00m6wiq1 has joined #asahi-dev
21:01m6wiq1 has quit []
21:01m6wiq1 has joined #asahi-dev
21:04m6wiq has quit [Ping timeout: 480 seconds]
21:07___nick___ has quit [Ping timeout: 480 seconds]
21:18m6wiq1 is now known as m6wiq
21:56jeffmiw has joined #asahi-dev
22:54m6wiq has quit [Quit: Leaving]
23:04m6wiq has joined #asahi-dev
23:04jeffmiw has quit [Ping timeout: 480 seconds]
23:32m6wiq has quit []
23:34yuyichao_ has quit [Ping timeout: 480 seconds]