Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 204830 - sys-boot/grub-0.97: Add tpm support
Summary: sys-boot/grub-0.97: Add tpm support
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal enhancement with 1 vote (vote)
Assignee: Gentoo's Team for Core System packages
URL: http://sourceforge.net/forum/forum.ph...
Whiteboard: queue:0.97-r11
Keywords:
Depends on: 674364
Blocks:
  Show dependency tree
 
Reported: 2008-01-07 22:18 UTC by RB
Modified: 2019-02-08 15:30 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch to grub-0.97-r3.ebuild for -r4 (grub-0.97-r4.ebuild.patch,2.04 KB, patch)
2008-01-07 22:21 UTC, RB
Details | Diff
goes in ${FILESDIR} (grub-0.97-ima-gentoo.patch,933 bytes, patch)
2008-01-07 22:24 UTC, RB
Details | Diff
grub with ima (tpm) support (grub-0.97-r4.ebuild,5.33 KB, text/plain)
2008-04-03 18:49 UTC, Robert A.
Details
patch to the (ima) patch (grub-0.97-ima-gentoo.patch,862 bytes, patch)
2008-04-03 18:50 UTC, Robert A.
Details | Diff
grub with ima (tpm) support (grub-0.97-r4.ebuild,5.34 KB, text/plain)
2008-04-05 03:07 UTC, Robert A.
Details
grub with tpm (ima) and tpm-debug (imatest) support (grub-0.97-r4.ebuild,5.36 KB, text/plain)
2008-04-05 19:31 UTC, Robert A.
Details
grub-0.97 (gentooified) tpm patch (850_all_grub-0.97-13-ima-1.1.0.0.patch,112.58 KB, patch)
2008-11-06 12:28 UTC, Robert A.
Details | Diff
with tpm use flag (and tpm debug messages disabled) (grub-0.97-r8.ebuild.patch,850 bytes, patch)
2008-11-06 12:30 UTC, Robert A.
Details | Diff
with tpm use flag (and tpm debug messages disabled) (grub-0.97-r8.ebuild,8.76 KB, text/plain)
2008-11-06 12:31 UTC, Robert A.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description RB 2008-01-07 22:18:57 UTC
The TrouSerS project puts out a set of grub patches (grub-ima) designed to help complete the TPM chain of trust.  I've been running this out-of-tree under the hardened profile on a Thinkpad X31 for some time with no ill effects and have just gotten around to actually writing an ebuild to manage it.  I am open to whatever implementation is deemed appropriate, but have implemented this as a 'tpm' USE flag on the grub-0.97-r3 ebuild, manifested as grub-0.97-r4.  I will attach the patch for the -r3 ebuild shortly, as well as a small housekeeping patch for a conflict between the grub-ima patches and the current Gentoo patchset (input on that process solicited as well).

I think all that I haven't done is added a use.desc entry.
Comment 1 RB 2008-01-07 22:21:51 UTC
Created attachment 140411 [details, diff]
patch to grub-0.97-r3.ebuild for -r4
Comment 2 RB 2008-01-07 22:24:47 UTC
Created attachment 140414 [details, diff]
goes in ${FILESDIR}

Fixes the conflict between existing Gentoo patches and the grub-ima one in configure.ac
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2008-01-07 22:33:16 UTC
Ugh... TPM/Trusted Computing is extreme evil. :X
Comment 4 RB 2008-01-07 22:55:00 UTC
It is if you use it the way our favorite commercial OS vendor has sold it, and as a result the OSS community has responded with FUD and lots of misunderstanding.  Think of it this way - it's a reasonably secure hardware-based CA embedded in your machine that can help prevent you from having to use a USB stick, boot CD, etc. to protect your keys.  We can nearly reach physical compromise-proof with this.

This is the start of my campaign to use TPM to help securely manage encrypted-root systems - I am one [very short] program away from using the TPM to seal a portion (or all) of an encryption key that will then be passed on to loop-aes, dm-crypt, etc. and seamlessly decrypt /.  No remote attestation, no preventing you from running certain apps, but you (the owner) can prevent the filesystem from being decrypted should any of the boot chain (kernel/initrd/grub/etc.) be modified.
Comment 5 RB 2008-01-08 15:46:35 UTC
Dropping this to P5 (seemingly due to TPM FUD) really bothers me.  I won't argue the priority, but I hope to help educate on the reality of TPM rather than let everyone swallow Stallman's arguably misinformed rant against them.  If you're against appropriate usage of TPM, you're against PKCS#11 and smartcards in general.  If you would, a couple of articles on the subject:

http://www.research.ibm.com/gsal/tcpa/tcpa_rebuttal.pdf
http://blog.bosabosa.org/2008/01/rethinking-trusted-computing.html
Comment 6 SpanKY gentoo-dev 2008-01-08 17:11:27 UTC
just ignore him

have you talked with upstream grub about getting tpm integrated in grub2 ?
Comment 7 RB 2008-01-08 17:38:22 UTC
No, but I will now, starting with the TrouSerS group to see if they'll help push the patch upstream.  Kent Yoder just left (internal to IBM), but it shouldn't be a big issue.
Comment 8 RB 2008-01-09 05:05:05 UTC
Looks like the battle will be uphill; I'd forgotten for a few hours that Grub is hosted/run by the GNU project.  With alarmist fantasies like http://www.gnu.org/philosophy/right-to-read.html, I think it goes outside of the scope of this bug.  I will do what I can and work with TrouSerS for a grub2 patch.
Comment 9 Robert A. 2008-04-03 18:49:34 UTC
Created attachment 148479 [details]
grub with ima (tpm) support

ebuild including the patch above
Comment 10 Robert A. 2008-04-03 18:50:32 UTC
Created attachment 148481 [details, diff]
patch to the (ima) patch

looks pretty the same as the original one, which did not apply (this one uses tabs instead of spaces)
Comment 11 Robert A. 2008-04-05 03:07:20 UTC
Created attachment 148693 [details]
grub with ima (tpm) support


autoconf needs to be run after applying the ima patch (otherwise configure doesnt know about it).
Comment 12 RB 2008-04-05 05:27:19 UTC
Spaces/tabs is what I get for pasting from a VT with GPM.  I don't see how you applied my 2nd patch, as it would have had that 'eautoreconf' from the start, or what value an ebuild adds over a patch that does the same thing; whatever strikes your fancy.

For my purposes, a patch is easier so others can see precisely what's being done w/o having to download and diff themselves.  Don't know what all devs do, but it's highly unlikely they'll incorporate an attached ebuild wholesale anyway.
Comment 13 Robert A. 2008-04-05 09:08:48 UTC
patch for devs and ebuild for users looks ok to me (:
Comment 14 Robert A. 2008-04-05 19:31:54 UTC
Created attachment 148783 [details]
grub with tpm (ima) and tpm-debug (imatest) support

makes the quite annoying debug messages optional
Comment 15 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-11-05 22:42:28 UTC
Could you please update it to apply on top of 0.97-r8. I strongly recommend just respinning the upstream IMA patch so that it applies cleanly, and is ALWAYS applied, but is only enabled depending on USE=tpm.

If you look in the Gentoo anonymous CVS, gentoo/src/patchsets/grub/0.97, you'll find our raw patchset files where your patches to grub itself would be included.
Comment 16 Robert A. 2008-11-06 12:28:38 UTC
Created attachment 170901 [details, diff]
grub-0.97 (gentooified) tpm patch
Comment 17 Robert A. 2008-11-06 12:30:54 UTC
Created attachment 170903 [details, diff]
with tpm use flag (and tpm debug messages disabled)
Comment 18 Robert A. 2008-11-06 12:31:46 UTC
Created attachment 170905 [details]
with tpm use flag (and tpm debug messages disabled)
Comment 19 RB 2008-11-06 16:56:45 UTC
Added Robert's 850 to my local grub-0.97-patches-1.8.tar.bz2 and tested his version of r8 against it (I can live w/o debug by default) with USE='ncurses netboot tpm'.  Booted & working fine (Vaio, Infineon 1.2.1.0).
Comment 20 Robert A. 2008-11-06 18:13:55 UTC
(In reply to comment #19)
> Added Robert's 850 to my local grub-0.97-patches-1.8.tar.bz2 and tested his
> version of r8 against it (I can live w/o debug by default) with USE='ncurses
> netboot tpm'.  Booted & working fine (Vaio, Infineon 1.2.1.0).

thanks for testing! (:
Comment 21 RB 2009-02-24 15:35:01 UTC
This works fine with Robert's 850_ patch against the -r9 ebuild in the main tree.  I renamed it to '855' in my local repo to avoid potential conflict with the new ext4 patch, but it's still good.
Comment 22 RB 2009-06-26 15:43:41 UTC
FWIW, still running well in production, zero issues.  Any chance of this going mainstream so I don't have to maintain a local ebuild?
Comment 23 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-07-04 18:52:13 UTC
Updating the queue marker.
I'm waiting for test results on patches on bug 139277 and bug 200505, then -r10 will be ready to roll.
Comment 24 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-06-25 04:05:50 UTC
pushing this to -r11 now, I got some conflicts with other stuff in -r10, please see about a respin?
Comment 25 Robert A. 2010-06-25 06:59:57 UTC
I dont use Gentoo anymore, so someone else has to go for it. RB?
Comment 26 RB 2010-06-28 12:42:24 UTC
Headed there, just had a weekend out.  Probably by EOW.
Comment 27 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2011-01-30 16:27:54 UTC
Any news RB?
Comment 28 RB 2011-01-30 17:29:06 UTC
Still here, still marked TODO on my end, just need to get it done.  Will try to dig into it with the remainder of this weekend.
Comment 29 Jonas Stein gentoo-dev 2017-07-18 06:56:44 UTC
What is the status? 
@RB are you still working on this?
Comment 30 RB 2017-07-18 15:51:06 UTC
Sadly, no - this fell off of my plate after changing roles a couple of times.  I'm still working with Gentoo, but it is no longer my primary boot.
Comment 31 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2019-02-08 15:30:12 UTC
grub:0 is gone