[tpm2] Re: Installing on FreeBSD?

John Connett <jrc at skylon.me.uk> Thu, 31 Mar 2022 23:04:14 +0100
Newsgroups dev.linux.lists.tpm2
Message-ID <[email protected]>
On 31/03/2022 20:50, Tadeusz Struk wrote:
> On 3/31/22 12:16, John Connett wrote:
>> That's what I would have hoped. However, I've found several problems:
>>
>>  1. /usr/local/etc/rc.d/tpm2-abrmd
>>     The line starting "desc=" breaks the script because of the un-quoted
>>     multi-word description text value. Putting quotes around the text 
>> value
>>     fixes it.
>
> Right, that will be fixed soon.
>
>>  2. /dev/tpm0
>>     This has owner root. A temporary fix is to change the owner to 
>> "_tss" which
>>     allows tpm2_getrandom to work. Not sure how the ownership and 
>> permissions
>>     are supposed to be set?
>
> Right, we are missing some udev rules here.
>
>>  3. Hyper-V Virtual TPM not found
>>     With FreeBSD installed on a Generation 2 VM on a Windows 11 host 
>> the Virtual
>>     TPM is not found. Ubuntu installed on the same VM does find the 
>> Virtual TPM.
>
> did you "sudo kldload tpm" ?
I hadn't (on bare hardware the TPM was found automatically). Here's the 
output:

    root(a)atelier2:~ # kldload tpm
    tpmcrb0: <Trusted Platform Module 2.0, CRB mode> iomem
    0xfed40000-0xfed40fff on acpi0
    device_attach: tpmcrb0 attach returned 6
    tpmcrb0: <Trusted Platform Module 2.0, CRB mode> iomem
    0xfed40000-0xfed40fff on acpi0
    device_attach: tpmcrb0 attach returned 6
    root(a)atelier2:~ #

Still no /dev/tpm0
>> Not quite as smooth as I anticipated. However, the problems are 
>> probably with the packaging for FreeBSD rather than tpm2-software 
>> issues. I've copied this to the maintainer of tpm2-tss for FreeBSD in 
>> case they have any comments.
>
Thanks
--
John
attachment.htm (text/html, 2.7 KB)
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 31/03/2022 20:50, Tadeusz Struk
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:[email protected]">On
      3/31/22 12:16, John Connett wrote:
      <br>
      <blockquote type="cite">That's what I would have hoped. However,
        I've found several problems:
        <br>
        <br>
         1. /usr/local/etc/rc.d/tpm2-abrmd
        <br>
            The line starting "desc=" breaks the script because of the
        un-quoted
        <br>
            multi-word description text value. Putting quotes around the
        text value
        <br>
            fixes it.
        <br>
      </blockquote>
      <br>
      Right, that will be fixed soon.
      <br>
      <br>
      <blockquote type="cite"> 2. /dev/tpm0
        <br>
            This has owner root. A temporary fix is to change the owner
        to "_tss" which
        <br>
            allows tpm2_getrandom to work. Not sure how the ownership
        and permissions
        <br>
            are supposed to be set?
        <br>
      </blockquote>
      <br>
      Right, we are missing some udev rules here.
      <br>
      <br>
      <blockquote type="cite"> 3. Hyper-V Virtual TPM not found
        <br>
            With FreeBSD installed on a Generation 2 VM on a Windows 11
        host the Virtual
        <br>
            TPM is not found. Ubuntu installed on the same VM does find
        the Virtual TPM.
        <br>
      </blockquote>
      <br>
      did you "sudo kldload tpm" ?
      <br>
    </blockquote>
    I hadn't (on bare hardware the TPM was found automatically). Here's
    the output:<br>
    <blockquote>root@atelier2:~ # kldload tpm<br>
      tpmcrb0: &lt;Trusted Platform Module 2.0, CRB mode&gt; iomem
      0xfed40000-0xfed40fff on acpi0<br>
      device_attach: tpmcrb0 attach returned 6<br>
      tpmcrb0: &lt;Trusted Platform Module 2.0, CRB mode&gt; iomem
      0xfed40000-0xfed40fff on acpi0<br>
      device_attach: tpmcrb0 attach returned 6<br>
      root@atelier2:~ # <br>
    </blockquote>
    Still no /dev/tpm0<br>
    <blockquote type="cite"
      cite="mid:[email protected]">
      <blockquote type="cite">Not quite as smooth as I anticipated.
        However, the problems are probably with the packaging for
        FreeBSD rather than tpm2-software issues. I've copied this to
        the maintainer of tpm2-tss for FreeBSD in case they have any
        comments.
        <br>
      </blockquote>
      <br>
    </blockquote>
    Thanks<br>
    --<br>
    John<br>
  </body>
</html>
OpenPGP_0x8F3115112EB8DB54.asc (application/pgp-keys, 2.1 KB)
-----BEGIN PGP PUBLIC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KDhiBueBFlsYuDZN9XdRSnAkvJ65jxhOyx5pVIMrLf125r
9Ccm57MmKc2N2cMcph6ZONx+7WhN72g1mvB7iGnO8LcumQ4xTI9qg+mg2Itw/xLG
DPznue4dJhTc/w29byN50SttGyQeAGfG0ODRN7X9UITmCpNh5n6Ijblx4fItIfF1
w2hlef02XvUcDj+XUw8LPlI0C/ltatcLYrCVZ7hUB3/VrpKl6+kYjs7ATQRevrlB
AQgAo9nBYXT9MvKCUhGEc6RO8E6Yk4w5ZnbjWg+g/3cWcE7wt+ZxuRwpx4DouCVZ
/p17zrix234aeptf6ObWu3vXqRek8Q8Nr7Z8gwBvps/id4D07XEdNi3vCKDJGdRz
BYBLTBABSFeIrkYCm+NaiRgE8XOBeJtAK7o59z/4L01Mxyo06MjL6GOxsISV0RKs
VuHGSRZc3IsilrFhLTm7vg8kIX3Xi6viNoGknet1sqa101PnNV+V8Fs5CNuD96qj
IYY2Ps8SRfS0X99cabTaOBESseFjzt9N8D9AQGDHYZ5N/C1w1PlwOGqLYfd1Yt40
s3dU3vJXVrUaJcRlDWck6xJ+vwARAQABwsB2BBgBCgAgFiEExwOaqro5cinGdE/X
jzEVES6421QFAl6+uUECGwwACgkQjzEVES6421Q5ZQgA7BwHKVN+GTaGsIjP9iIo
5hmzbsIfWqrdoBoqVEIIsRnJy5xmOkSk7e4B/4c5cAxAFhm2cT+HAPFQbLWARUA1
tmQp1qKKRGPt5p3Ks5Oe6aLk/myrfm+qVqnc+ffMhhc9aXnUGg24nqHmyec+upt3
ee+d7UsiiNCfVyApEVfky8Qm2mHP8AlK4fgTWI5QGMNAjIuPL9yf1277GIpAQ07j
daLw9XJL5Kh4raepWo8UJ1nDniazMCIQidRQhfqUoPzymlXHLCykktazjpwR3fdu
KbRh3cVvc7HjE542fIC64LvY3LQZjbNJDyp+TEwxarpOapRBczt/piYqUEv02oyx
rA==
=DCrz
-----END PGP PUBLIC KEY BLOCK-----
OpenPGP_signature.sig (application/pgp-signature, 495 B) - not displayed