Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/deploy: Also install HMAC file into /boot #1962

Merged
merged 1 commit into from
Oct 30, 2019

Conversation

jlebon
Copy link
Member

@jlebon jlebon commented Oct 29, 2019

To allow for FIPS mode, we need to also install the HMAC file from
/usr/lib/modules to /boot alongside the kernel image where the
fips dracut module will find it. For details, see:

coreos/fedora-coreos-tracker#302

Note I didn't include the file in the boot checksum since it's itself a
checksum of the kernel, so we don't really gain much here other than
potentially causing an unnecessary bootcsum bump.

@jlebon
Copy link
Member Author

jlebon commented Oct 29, 2019

Actually, let's hold this for a second.
/hold

I'm still working out the dracut side of this, and I think another thing that will fail is that the HMAC file is of course pointing at the wrong path (this one is just from my Silverblue laptop for example):

$ cat .vmlinuz.hmac
2acb3115489a9f42e5d88fbcb49207adcd976ffea080b8758d885be51969d0e268825b7b6925f702753cc0f49cfc1a3a4ae4dc39f3a27c41deff4fcbc12a227d  /boot/vmlinuz-5.2.18-200.fc30.x86_64

So... hmm, might need to have libostree also edit the path in there? Yuck.

@cgwalters
Copy link
Member

I think this is more an rpm-ostree bug:

$ cat /usr/lib/modules/5.2.16-200.fc30.x86_64/.vmlinuz.hmac
654f49c15416a589cd6892e6900385e4c1fcc2e34213b177972085d1ef0cb0e355f4c57eed973f6c44a2279c367b95f90f3a14aeda5fb9e71cdf03c405a7c89f  /boot/vmlinuz-5.2.16-200.fc30.x86_64

is also wrong. Or to say it more precisely, how we built it is wrong; ostree shouldn't be working around build problems.

Hm, maybe it'd work to just make the file purely relative?

jlebon added a commit to jlebon/rpm-ostree that referenced this pull request Oct 29, 2019
As mentioned in the comment block:

```
If there's an HMAC file, fix the path to the kernel in it to be
relative. Right now, the kernel spec encodes `/boot/vmlinux-$kver`,
which of course not going to work for us. We should work towards making
this change directly into the kernel spec.
```

For background, see this comment and following:
ostreedev/ostree#1962 (comment)
To allow for FIPS mode, we need to also install the HMAC file from
`/usr/lib/modules` to `/boot` alongside the kernel image where the
`fips` dracut module will find it. For details, see:

coreos/fedora-coreos-tracker#302

Note I didn't include the file in the boot checksum since it's itself a
checksum of the kernel, so we don't really gain much here other than
potentially causing an unnecessary bootcsum bump.
@jlebon
Copy link
Member Author

jlebon commented Oct 29, 2019

/hold cancel

@jlebon
Copy link
Member Author

jlebon commented Oct 29, 2019

Hm, maybe it'd work to just make the file purely relative?

Yeah, seems like the cleanest solution. Done in coreos/rpm-ostree#1934 now!

@cgwalters
Copy link
Member

/lgtm

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cgwalters, jlebon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 632e4eb into ostreedev:master Oct 30, 2019
openshift-merge-robot pushed a commit to coreos/rpm-ostree that referenced this pull request Oct 31, 2019
As mentioned in the comment block:

```
If there's an HMAC file, fix the path to the kernel in it to be
relative. Right now, the kernel spec encodes `/boot/vmlinux-$kver`,
which of course not going to work for us. We should work towards making
this change directly into the kernel spec.
```

For background, see this comment and following:
ostreedev/ostree#1962 (comment)
@jlebon jlebon deleted the pr/support-hmac branch April 24, 2023 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants