Skip to content

Conversation

@joergroedel
Copy link

Avoid using the insecure MSR kernel module and use a file in SYSFS to read the SEV_STATUS MSR.

This is a draft PR as the SYSFS support patch is still under discussion here

The function is only ever used to read the SEV_STATUS MSR, so rename
it and hard-code the function parameters. This helps adding
alternative means to read SEV_STATUS.

Signed-off-by: Joerg Roedel <[email protected]>
Since reading MSRs using the Linux MSR kernel module is generally
discouraged and disabled by default in many Linux distributions, add
another way of reading the SEV_STATUS value via SYSFS.

If that does not work the MSR module is still used as a fall-back.

Signed-off-by: Joerg Roedel <[email protected]>
Copy link
Member

@tylerfanelli tylerfanelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we'll wait for the changes to be upstream. Let us know when that's completed and we can merge this.

Just out of curiosity, why is the MSR module generally discouraged/disabled?

@joergroedel
Copy link
Author

Just out of curiosity, why is the MSR module generally discouraged/disabled?

The MSR module does not only give access to SEV_STATUS, but to all MSRs, including those that can affect system stability and security.

@larrydewey
Copy link
Contributor

I don't have any arguments against using the sysfs approach. One reason we were leaning so heavily on the MSR implementation is that 1) there was no other implementation, and 2) the MSR in question is a protected MSR. DO you know if the method of providing this through sysfs will be protected from hypervisor modification, as well?

@joergroedel
Copy link
Author

I don't have any arguments against using the sysfs approach. One reason we were leaning so heavily on the MSR implementation is that 1) there was no other implementation, and 2) the MSR in question is a protected MSR. DO you know if the method of providing this through sysfs will be protected from hypervisor modification, as well?

There is no change in security by using SYSFS instead of the MSR module, as there is also no guarantee that the MSR module behaves correctly and does actually read the MSR in question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants