[libvirt] [PATCH v9 06/17] qemu: Extend QEMU with external TPM support

bushuanshuan bushuanshuan at huawei.com
Thu Jun 7 01:08:36 UTC 2018


...

> +static int
> +qemuExtTPMStartEmulator(virQEMUDriverPtr driver,
> +                        virDomainDefPtr def,
> +                        qemuDomainLogContextPtr logCtxt)
> +{

...

> +    if (!(cmd = qemuTPMEmulatorBuildCommand(tpm, def->name, def->uuid,
> +                                            driver->privileged,
> +                                            cfg->swtpm_user,
> +                                            cfg->swtpm_group)))
> +        goto cleanup;
> +
> +    if (qemuExtDeviceLogCommand(logCtxt, cmd, "TPM Emulator") < 0)
> +        goto cleanup;
> +
> +    virCommandSetErrorBuffer(cmd, &errbuf);
> +
> +    if (virCommandRun(cmd, &exitstatus) < 0 || exitstatus != 0) {
> +        virReportError(VIR_ERR_INTERNAL_ERROR,
> +                       _("Could not start 'swtpm'. exitstatus: %d, "
> +                         "error: %s"), exitstatus, errbuf);
> +        goto cleanup;
> +    }

Now that the sensitive data in NVRAM need to be protected,  it might be a feasible way that swtpm uses the 'key' to encrypt it when VM shutdown.
I wonder why don't use the key when swtpm process is launched here.
Of course, we should avoid to let the key exposed in system log when we design the encryption scheme.
Another question is: where we can store the key securely. Maybe physical TPM can help this.
What do you think about this question?

...

Thanks,
Shuanshuan Bu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180607/4b2df956/attachment-0001.htm>


More information about the libvir-list mailing list