Skip to content

efi: implement platform-agnostic arm64 host security checks - #566

Open
alexclewontin wants to merge 2 commits into
alexclewontin/check-host-security-unpin-amd64from
alexclewontin/check-host-security-arm64
Open

efi: implement platform-agnostic arm64 host security checks#566
alexclewontin wants to merge 2 commits into
alexclewontin/check-host-security-unpin-amd64from
alexclewontin/check-host-security-arm64

Conversation

@alexclewontin

Copy link
Copy Markdown
Member

This PR adds a framework for host security checks on arm64 platforms. It moves #564 to the stack.

It adds a generic framework to check host security on ARM64. Very few truly cross-platform APIs were found to be applicable to that ecosystem, but we can use the backing driver for the TPM to prove that a given TPM is a fTPM: if it is using the OP-TEE fTPM driver we can be sure that it is an fTPM. This is not conclusive (absence of that driver doesn't prove that a TPM is a dTPM), but it is a common reference implementation for the ARM ecosystem, so worth including.

return checkHostSecurityARM64Generic(env, log, integrity)
}

func checkHostSecurityARM64Generic(env internal_efi.HostEnvironment, log *tcglog.Log, integrity platformFirmwareIntegrityConfig) (platformFirmwareIntegrityConfig, error) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This does not look very Arm64 specific and duplicates code from checkHostSecurityAMD64.
Could both be merged? (does it make sense?)

Or do you intend to make them diverge in the next PR?

)))
}

newDevices := func(tpmDriver string, withIOMMU bool) []internal_efi.SysfsDevice {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same question as for intelDevices in PR#565: #565 (comment)

)

func init() {
RegisterARM64TestPlatform(exampleARM64CPUManufacturer, exampleARM64CPUVersion)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please add a comment about what is the purpose of this, and why this is done here.

Wouldn't it be more explicit to have this done in the setup of one of the test suites instead?

return func() { runtimeGOARCH = orig }
}

func RegisterARM64TestPlatform(cpuManufacturer, cpuVersion string) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please add a description of this function.


eventLogPath = "/sys/kernel/security/tpm0/binary_bios_measurements" // Path of the TCG event log for the default TPM, in binary form

dmiProcessorInfoPath = "/sys/firmware/dmi/entries/4-0/raw"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does "4" means type 4?
Does "0" means processor 0? Do we make any assumption there (eg: that other CPUs are the same as CPU 0...)
Please document these.

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.

2 participants