Message ID | 20250421162712.77452-1-ross.philipson@oracle.com |
---|---|
Headers | show |
Series | x86: Trenchboot secure dynamic launch Linux kernel support | expand |
On 4/21/25 09:26, Ross Philipson wrote: > The larger focus of the TrenchBoot project (https://github.com/TrenchBoot) is to > enhance the boot security and integrity in a unified manner. Hey Folks, It isn't immediately apparent what these 5,000 lines of code do which is new, why they are important to users and who will use them. I've wondered this from v1 and I was hoping it would have gotten better by v14, but alas... Purely from the amount of interest and review tags and the whole "v14" thing, it doesn't look like this is very important to anyone. Not to be to flippant about it, but if nobody else cares, why should I (or the other x86 maintainers)?
On 21/04/2025 9:52 pm, Dave Hansen wrote: > On 4/21/25 09:26, Ross Philipson wrote: >> The larger focus of the TrenchBoot project (https://github.com/TrenchBoot) is to >> enhance the boot security and integrity in a unified manner. > Hey Folks, > > It isn't immediately apparent what these 5,000 lines of code do which is > new, why they are important to users and who will use them. I've > wondered this from v1 and I was hoping it would have gotten better by > v14, but alas... > > Purely from the amount of interest and review tags and the whole "v14" > thing, it doesn't look like this is very important to anyone. Not to be > to flippant about it, but if nobody else cares, why should I (or the > other x86 maintainers)? The very-tl;dr is: This is an implementation of Intel TXT which isn't a piece of abandonware with unaddressed CVEs (i.e. isn't tboot). AMD and ARM support of equivalent technologies will be coming next. ~Andrew
On 4/21/25 09:27, Ross Philipson wrote: > +static u64 sl_rdmsr(u32 reg) > +{ > + u64 lo, hi; > + > + asm volatile ("rdmsr" : "=a" (lo), "=d" (hi) : "c" (reg)); > + > + return (hi << 32) | lo; > +} Is there a reason this code doesn't just use boot_rdmsr()?
On 21/04/2025 9:52 pm, Dave Hansen wrote: > Purely from the amount of interest and review tags and the whole "v14" > thing, it doesn't look like this is very important to anyone. Not to be > to flippant about it, but if nobody else cares, why should I (or the > other x86 maintainers)? There are several downstreams already using this as a part of their overall system security, one example being https://www.qubes-os.org/doc/anti-evil-maid/ It's all giant out-of-tree patch series (in multiple projects; Grub, Xen, iPXE too). Ross and others are trying to be good open source citizen and put it upstream where yet-more downstreams can benefit too. ~Andrew
On 4/22/25 11:17, Andrew Cooper wrote: > On 21/04/2025 9:52 pm, Dave Hansen wrote: >> Purely from the amount of interest and review tags and the whole "v14" >> thing, it doesn't look like this is very important to anyone. Not to be >> to flippant about it, but if nobody else cares, why should I (or the >> other x86 maintainers)? > There are several downstreams already using this as a part of their > overall system security, one example being > https://www.qubes-os.org/doc/anti-evil-maid/ OK, but what problems are they solving by using this as opposed to existing trusted boot? While I don't doubt that folks _can_ install and use Xen on their laptop, it's unclear to me how pervasive this is. Is this just folks tinkering around or is this something that has large deployments where folks really *CARE* about it?
On 4/21/25 3:57 PM, Dave Hansen wrote: > On 4/21/25 09:27, Ross Philipson wrote: >> @@ -788,6 +790,9 @@ static void native_machine_halt(void) >> >> tboot_shutdown(TB_SHUTDOWN_HALT); >> >> + /* SEXIT done after machine_shutdown() to meet TXT requirements */ >> + slaunch_finalize(1); > > This is the kind of stuff that needs to get fixed up before this series > can go _anywhere_. > > "TXT requirements" is not useful to a maintainer. *WHAT* requirement? > *WHY* must it be done this way? > > This code is unmaintainable as it stands. Sorry we understand the frustration especially for maintainers. We have gone over your responses so far. We will do whatever it takes to make this patch set maintainable and acceptable to upstream. I think we are starting to understand what the main issues are with the set overall from what you are pointing out. Thank you for your feedback, Ross
On 4/21/25 6:18 PM, Dave Hansen wrote: > On 4/21/25 09:27, Ross Philipson wrote: >> +static u64 sl_rdmsr(u32 reg) >> +{ >> + u64 lo, hi; >> + >> + asm volatile ("rdmsr" : "=a" (lo), "=d" (hi) : "c" (reg)); >> + >> + return (hi << 32) | lo; >> +} > > Is there a reason this code doesn't just use boot_rdmsr()? No I just didn't know those functions were there. I will fix it. Thanks Ross > >
On Tue, 22 Apr 2025 at 20:17, Andrew Cooper <andrew.cooper3@citrix.com> wrote: > > On 21/04/2025 9:52 pm, Dave Hansen wrote: > > Purely from the amount of interest and review tags and the whole "v14" > > thing, it doesn't look like this is very important to anyone. Not to be > > to flippant about it, but if nobody else cares, why should I (or the > > other x86 maintainers)? > > There are several downstreams already using this as a part of their > overall system security, one example being > https://www.qubes-os.org/doc/anti-evil-maid/ > > It's all giant out-of-tree patch series (in multiple projects; Grub, > Xen, iPXE too). ... and this is the main problem: All the existing protocols and layering go straight out the window, and are replaced with bespoke alternatives, for booting but also for secondary bringup, etc etc Conceptually, the secure launch could be performed under the hood, e.g., during ExitBootServices() when doing EFI boot, and the OS would have to be none the wiser (or at least, not need 100s of additional lines of opaque assembly to be able to operate in this mode). The fact that all these components need such intrusive changes in order to orchestrate this pivot to the reduced TCB constitutes a spectacular failure in design IMO, but AIUI, the software side is not really at fault here: the layering violations are intrinsic to the hardware support in the CPU. I'm sure Andy or others on cc can elaborate on this, as they have done many times already. So if that is true (I'm not a x86 uarch expert by any measure), then pushing back on this series on the basis that it is ugly and intrusive is not really reasonable. From security pov, I think D-RTM is an important feature and it deserves to be upstream if it is used widely in the field. OTOH, if the arm64 implementation (which is still on the drawing board) bears any resemblance at all to the x86 version, it can be considered NACKed already.
On 4/22/25 14:26, Ard Biesheuvel wrote: > So if that is true (I'm not a x86 uarch expert by any measure), then > pushing back on this series on the basis that it is ugly and intrusive > is not really reasonable. From security pov, I think D-RTM is an > important feature and it deserves to be upstream if it is used widely > in the field. BTW, I'm not pushing back on it for being intrusive. It's actually not _that_ intrusive. Most of it sits off on the side. It looked like it had a parallel boot entry point, for instance, that is separate from but shouldn't break the normal entry points. BTW. it sounds like folks are pretty unhappy with Intel here on a bunch of levels. It's not my personal hardware design or anything, so please don't pull any punches. If Intel screwed up here and that's why we need 5,000 lines of arguably duplicate functionality, then please say so. You're not going to hurt my feelings.
On 4/21/25 09:26, Ross Philipson wrote: > This patchset provides detailed documentation of DRTM, the approach used for > adding the capbility, and relevant API/ABI documentation. In addition to the > documentation the patch set introduces Intel TXT support as the first platform > for Linux Secure Launch. So, I know some of the story here thanks to Andy Cooper. But the elephant in the room is: > INTEL(R) TRUSTED EXECUTION TECHNOLOGY (TXT) > M: Ning Sun <ning.sun@intel.com> > L: tboot-devel@lists.sourceforge.net > S: Supported > W: http://tboot.sourceforge.net > T: hg http://tboot.hg.sourceforge.net:8000/hgroot/tboot/tboot > F: Documentation/arch/x86/intel_txt.rst > F: arch/x86/kernel/tboot.c > F: include/linux/tboot.h Linux already supports TXT. Why do we need TrenchBoot? I think I know the answer, but it also needs to be a part of the documentation, changelogs and cover letter. Also, honestly, what do you think we should do with the Linux tboot code? Is everyone going to be moving over to Trenchboot so that Linux support for TXT/tboot can just go away?