#
✕ nick:DmitrySharshakov[m]
#asahi-dev · 2022-08-30 06:09
DmitrySharshakov[m]marcan: of
#asahi-dev · 2022-08-30 06:03
DmitrySharshakov[m]And maybe even ship such sealed kernels, idk. I think many people would be fine with internal hardware + standard USB classes support for some super extended security
#asahi-dev · 2022-08-30 06:01
DmitrySharshakov[m]So CONFIG_APPLE_KTRR could be added which depends on !CONFIG_MODULES
#asahi-dev · 2022-08-30 06:00
DmitrySharshakov[m]Since many usecases include Mac mini or Mac Studio as a server/build machine, this option should be considered a useful one
#asahi-dev · 2022-08-29 19:21
DmitrySharshakov[m]Well, if somebody cares, that could be a kernel build-time option, which implies nothing can be built as a module. This would open a way for some really special scenarios where people can easily do a custom monolithic kernel build
#asahi-dev · 2022-08-29 19:06
DmitrySharshakov[m]Gentoo users will definitely enjoy the concept of building a moduleless kernel
#asahi-dev · 2022-08-29 19:06
DmitrySharshakov[m]Someone has to try building everything needed in and enable the thing
#asahi-dev · 2022-08-29 19:05
DmitrySharshakov[m]Yes. So we're left with the only approach to enabling ktrr: evict everything from the kernel land and make them use VFIO to implement their PCIe card drivers in userspace and libusb for usb ofc
#asahi-dev · 2022-08-29 19:02
DmitrySharshakov[m]What's the largest kernel image ever built and what could possibly stop it from working when tons of unused modules are linked in?
#asahi-dev · 2022-08-29 19:00
DmitrySharshakov[m]Just like kc, a single monolith
#asahi-dev · 2022-08-29 19:00
DmitrySharshakov[m]Exactly
#asahi-dev · 2022-08-29 18:59
DmitrySharshakov[m]With them being statically linked together
#asahi-dev · 2022-08-29 18:59
DmitrySharshakov[m]nicolas17: I mean protecting the kernel _with_ modules
#asahi-dev · 2022-08-29 18:58
DmitrySharshakov[m]Builtin modules should be in the same region
#asahi-dev · 2022-08-29 18:57
DmitrySharshakov[m]I guess kernel will be around 150 MB if compiled with all modules for builtin devices and whatever can be hotplugged. Quite a lot for kernel image
#asahi-dev · 2022-08-29 18:56
DmitrySharshakov[m]cannot kernel executable code be protected as well?
#asahi-dev · 2022-08-29 18:56
DmitrySharshakov[m]I guess it can be achieved when linking modules in (config Y), which essentially produces the same thing as kernelcache
#asahi-dev · 2022-08-29 18:55
DmitrySharshakov[m]Why is contiguous text region necessary for this thing?
#asahi-dev · 2022-08-29 18:55
DmitrySharshakov[m]Dumping a lot of drivers out of Fedora's aarch64 modules package yielded 160 MiB with not all drivers decompressed
#asahi-dev · 2022-08-29 18:41
DmitrySharshakov[m]Well, `/lib/modules/<ver>/kernel` contains xz-ed modules, they could be counted (including un-xz-ing them)
#asahi-dev · 2022-08-29 18:38
DmitrySharshakov[m]However, somebody has to calculate that
#asahi-dev · 2022-08-29 18:36
DmitrySharshakov[m]Imagine we only can have USB pluggable devices. There's just a ton of them
#asahi-dev · 2022-08-29 18:32
DmitrySharshakov[m]But I couldn't imagine having all the modules built in
#asahi-dev · 2022-08-29 18:32
DmitrySharshakov[m]tpw_rules: Probably not
#asahi-dev · 2022-08-29 18:31
DmitrySharshakov[m]kernelcache has essential drivers (parts of the Mac itself and basic externals)
#asahi-dev · 2022-08-29 18:31
DmitrySharshakov[m]tpw_rules: Their size I guess
#asahi-dev · 2022-08-29 18:30
DmitrySharshakov[m]Just recalled Logitech input is also a kernel module on Linux (at least rich functions). Having tons of userspace drivers isn't great, so that's not a good way to go
#asahi-dev · 2022-08-29 18:29
DmitrySharshakov[m]Possible, but not feasible
#asahi-dev · 2022-08-29 18:27
DmitrySharshakov[m]Well, and tun, and wireguard etc. Non-modular Linux is as possible as kext-free macOS is, but not really decent for most cases
#asahi-dev · 2022-08-29 18:26
DmitrySharshakov[m]Might be useful for some people if internal parts + USB common classes are embedded this way. However, as I mentioned, that monolithization of the kernel would be certainly not upstreamable
#asahi-dev · 2022-08-29 18:24
DmitrySharshakov[m]Building modules in to make a monolithic kc-like kernel without module support and then locking kernel memory into RO
#asahi-dev · 2022-08-29 18:24
DmitrySharshakov[m]Well, so looks like there's no practical use of mainlining such a feature. It could be done for special occasions though I guess
#asahi-dev · 2022-08-29 18:22
DmitrySharshakov[m]marcan: Do end-users ever use this kind of thing?
#asahi-dev · 2022-08-29 18:21
DmitrySharshakov[m]Yes, so all other devices are handled by userspace drivers since they aren't in kc?
#asahi-dev · 2022-08-29 18:20
DmitrySharshakov[m]Well how does XNU load its kexts? Or doesn't it do that at all on aarch64?
#asahi-dev · 2022-08-29 18:15
DmitrySharshakov[m]Well yes, since if something in between entrance and exit of higher EL is RW to evil forces, they can make it call outside of the secure area
#asahi-dev · 2022-08-29 18:11
DmitrySharshakov[m]s/&/?/
#asahi-dev · 2022-08-29 18:11
DmitrySharshakov[m]nicolas17: It does restrict it to SecureBoot, doesn't it&
#asahi-dev · 2022-08-29 18:11
DmitrySharshakov[m]Idk if we can lock some generally immutable parts and will it make any sense if something will have to be RO for modules to load
#asahi-dev · 2022-08-29 18:10
DmitrySharshakov[m]This will lock us out of kexec and kpatch
#asahi-dev · 2022-08-29 18:09
DmitrySharshakov[m]However I guess some parts of the kernel might be extra hardened, at least some code which is never touched while module loads
#asahi-dev · 2022-08-29 18:08
DmitrySharshakov[m]Yes, but kernel has to write parts of its memory to link a module in
#asahi-dev · 2022-08-29 18:07
DmitrySharshakov[m]So lockdown mode does not make kernel image immutable to itself
#asahi-dev · 2022-08-29 18:07
DmitrySharshakov[m]x86 does not have hardware RO memory (well, maybe somewhere in the SMM...)
#asahi-dev · 2022-08-29 18:07
DmitrySharshakov[m]Lockdown is just signature verification and many other rules enforced
#asahi-dev · 2022-08-29 17:45
DmitrySharshakov[m]marcan: Ah, alright, quite a lot more complex thing
#asahi-dev · 2022-08-29 17:43
DmitrySharshakov[m]marcan: It uses SBU?
#asahi-dev · 2022-08-29 17:43
DmitrySharshakov[m]Of course that works with TB, but that should be a variant for the DP altmode as well IIRC
#asahi-dev · 2022-08-29 17:42
DmitrySharshakov[m]Btw does atc support 2x2 scheme where you give 2 lanes for DP and 2 for USB 3 link?
#asahi-dev · 2022-08-29 17:42
DmitrySharshakov[m]Essentially a multiplexer which can connect Type-C pins to either DisplayPort, Thunderbolt, USB 3 or some debug stuff probably

plus ›