<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>11080</bug_id>
          
          <creation_ts>2017-02-20 08:15:41 +0000</creation_ts>
          <short_desc>Enabling testing TPM(v1.2) Support on QEMU</short_desc>
          <delta_ts>2017-04-18 07:31:58 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>IoT Reference OS Kit</product>
          <component>intel-iot-refkit-security</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>2.3 M4</target_milestone>
          
          <blocked>11201</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Amaranth Valluri">amarnath.valluri</reporter>
          <assigned_to name="Amaranth Valluri">amarnath.valluri</assigned_to>
          <cc>amarnath.valluri</cc>
    
    <cc>matti-pekka.sivosuo</cc>
    
    <cc>mikko.ylinen</cc>
    
    <cc>patrick.ohly</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>70822</commentid>
    <comment_count>0</comment_count>
    <who name="Amaranth Valluri">amarnath.valluri</who>
    <bug_when>2017-02-20 08:15:41 +0000</bug_when>
    <thetext>Using &apos;swtpm(Software TPM Emulator)&apos; with QEMU is currently depends on  starting swtpm as root before each runqemu invocation. This is neither user-friendly nor compatible with some automated testing environments where &apos;no-root&apos; is required. 

The reason for this is that swtpm emulates /dev/vtpm0 via CUSE (character device in user space) and needs root privileges for setting that up. qemu communicates with swtpm in two ways: 1) read/write calls 2) ioctl calls.

A better solution would be to connect qemu to swtpm through a unix domain datagram socket (no root rights needed). Read/write can work as before. ioctls could be mapped to out-of-band messages.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72205</commentid>
    <comment_count>1</comment_count>
    <who name="Amaranth Valluri">amarnath.valluri</who>
    <bug_when>2017-04-10 11:00:18 +0000</bug_when>
    <thetext>Patch set submitted to upstream, currently under review:
http://lists.nongnu.org/archive/html/qemu-devel/2017-04/msg01287.html

From QEMU upstream getting some resistance against using of &apos;swtpm&apos; for TPM emulation, as it is foreign project to qemu. And suggesting to define a private/protocol protocol specification. So it is not realistic that the current proposal accepted by upstream with in the M4 time frame.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72268</commentid>
    <comment_count>2</comment_count>
    <who name="Mikko Ylinen">mikko.ylinen</who>
    <bug_when>2017-04-11 05:13:54 +0000</bug_when>
    <thetext>(In reply to comment #1)

&gt; From QEMU upstream getting some resistance against using of &apos;swtpm&apos; for TPM
&gt; emulation, as it is foreign project to qemu. And suggesting to define a
&gt; private/protocol protocol specification. So it is not realistic that the
&gt; current proposal accepted by upstream with in the M4 time frame.

One may argue whether the upstream acceptance is a criteria to deliver this feature. I think not. Especially if we follow the dependency logic: it would not be possible to deliver bug #11070 either if this was not closed.

AFAICS, the swtpm part is done. Have you submitted a meta-security patch to update the SRCREV?

Also, the qemu part we&apos;d need to maintain in a bbappend until the upstream patch is merged. The upstream status shall be tracked in the patch Upstream-Status.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72273</commentid>
    <comment_count>3</comment_count>
    <who name="Amaranth Valluri">amarnath.valluri</who>
    <bug_when>2017-04-11 08:45:32 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; (In reply to comment #1)
&gt; 
&gt; &gt; From QEMU upstream getting some resistance against using of &apos;swtpm&apos; for TPM
&gt; &gt; emulation, as it is foreign project to qemu. And suggesting to define a
&gt; &gt; private/protocol protocol specification. So it is not realistic that the
&gt; &gt; current proposal accepted by upstream with in the M4 time frame.
&gt; 
&gt; One may argue whether the upstream acceptance is a criteria to deliver this
&gt; feature. I think not. Especially if we follow the dependency logic: it would
&gt; not be possible to deliver bug #11070 either if this was not closed.
&gt; 
&gt; AFAICS, the swtpm part is done. Have you submitted a meta-security patch to
&gt; update the SRCREV?
I have submitted the PR:
https://lists.yoctoproject.org/pipermail/yocto/2017-April/035572.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72575</commentid>
    <comment_count>4</comment_count>
    <who name="Mikko Ylinen">mikko.ylinen</who>
    <bug_when>2017-04-18 07:28:57 +0000</bug_when>
    <thetext>Amarnath, this can be set to &apos;RESOLVED&apos;, IMO.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72576</commentid>
    <comment_count>5</comment_count>
    <who name="Amaranth Valluri">amarnath.valluri</who>
    <bug_when>2017-04-18 07:31:58 +0000</bug_when>
    <thetext>swtpm/meta-security patches are merged to upstream, and qemu changes are submitted upstream and .bbappended in refkit.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>