<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <pre style="white-space: pre-wrap; color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">On Fri, 31 May 2019, Jamie wrote:
> On Fri, 31 May 2019, Ian wrote:
>
>><i> The only thing outstanding is some trouble I run into after the initramfs
</i>>><i> chroot transition but before the apparmor service starts:
</i>>><i> 
</i>>><i>    May 31 12:10:55 1546-w-dev audit[5162]: AVC apparmor="ALLOWED"
</i>>><i>    operation="exec" info="profile transition not found" error=-13
</i>>><i>    profile="init-sys
</i>>><i>    temd" name="/usr/bin/unshare" pid=5162 comm="(spawn)"
</i>>><i>    requested_mask="x" denied_mask="x" fsuid=0 ouid=0
</i>>><i>    target="/usr/bin/unshare"
</i>>><i>    May 31 12:10:54 1546-w-dev audit[5004]: AVC apparmor="ALLOWED"
</i>>><i>    operation="exec" info="profile transition not found" error=-13
</i>>><i>    profile="init-sys
</i>>><i>    temd" name="/usr/bin/unshare" pid=5004 comm="(spawn)"
</i>>><i>    requested_mask="x" denied_mask="x" fsuid=0 ouid=0
</i>>><i>    target="/usr/bin/unshare"
</i>>
>Notice it is /usr/bin/unshare here, but you mention below that
>'/usr/sbin/unshare' exists, but what you pasted looks correct. Is this a typo
>in the email or somewhere else?
>
>><i> The /usr/sbin/unshare profile exists:
</i>>><i> 
</i>>><i>    <a href="https://lists.ubuntu.com/mailman/listinfo/apparmor">root at 1546-w-dev</a>:/etc/apparmor.d# cat usr.bin.unshare
</i>>><i>    profile usr.bin.unshare /usr/bin/unshare
</i>>><i>    flags=(complain,attach_disconnected) {
</i>>><i>         #include <local/whitelist>
</i>>><i>    }
</i>
</pre>
    Jamie,<br>
    <br>
    That was a typo in the email. There is no /usr/sbin/unshare
    executable or profile.<br>
    <br>
    After everything loads, if I restart the "lvm2-pvscan@8:1" service
    that I think is responsible for those errors during boot (systemctl
    shows it as failed), it all works correctly.<br>
    <br>
    --- <br>
    <br>
    <br>
    On a different topic, when I attempted to run 'apt update', this
    happens:<br>
    <br>
    <blockquote>
      <pre style="white-space: pre-wrap; color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">type=AVC msg=audit(1559334318.936:8850): apparmor="ALLOWED" operation="exec" info="no new privs" error=-1 profile="usr.lib.apt.methods.gpgv" name="/usr/bin/apt-key" pid=11011 comm="gpgv" requested_mask="x" denied_mask="x" fsuid=104 ouid=0 target="usr.bin.apt_key"
type=AVC msg=audit(1559334319.212:8851): apparmor="ALLOWED" operation="exec" info="no new privs" error=-1 profile="usr.lib.apt.methods.gpgv" name="/usr/bin/apt-key" pid=11013 comm="gpgv" requested_mask="x" denied_mask="x" fsuid=104 ouid=0 target="usr.bin.apt_key"
type=AVC msg=audit(1559334319.228:8852): apparmor="ALLOWED" operation="exec" info="no new privs" error=-1 profile="usr.lib.apt.methods.gpgv" name="/usr/bin/apt-key" pid=11015 comm="gpgv" requested_mask="x" denied_mask="x" fsuid=104 ouid=0 target="usr.bin.apt_key"
type=AVC msg=audit(1559334319.332:8853): apparmor="ALLOWED" operation="exec" info="no new privs" error=-1 profile="usr.lib.apt.methods.gpgv" name="/usr/bin/apt-key" pid=11017 comm="gpgv" requested_mask="x" denied_mask="x" fsuid=104 ouid=0 target="usr.bin.apt_key"


W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: <a class="moz-txt-link-freetext" href="http://us.archive.ubuntu.com/ubuntu">http://us.archive.ubuntu.com/ubuntu</a> bionic InRelease: Couldn't execute /usr/bin/apt-key to check /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_bionic_InRelease
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: <a class="moz-txt-link-freetext" href="http://us.archive.ubuntu.com/ubuntu">http://us.archive.ubuntu.com/ubuntu</a> bionic-updates InRelease: Couldn't execute /usr/bin/apt-key to check /var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_bionic-updates_InRelease
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: <a class="moz-txt-link-freetext" href="http://security.ubuntu.com/ubuntu">http://security.ubuntu.com/ubuntu</a> bionic-security InRelease: Couldn't execute /usr/bin/apt-key to check /var/lib/apt/lists/partial/security.ubuntu.com_ubuntu_dists_bionic-security_InRelease
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: <a class="moz-txt-link-freetext" href="http://us.archive.ubuntu.com/ubuntu">http://us.archive.ubuntu.com/ubuntu</a> bionic-backports InRelease: Couldn't execute /usr/bin/apt-key to check /var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_bionic-backports_InRelease
</pre>
    </blockquote>
    <br>
    <p>It's not clear to me why it thinks I would be requesting new
      privs when all of the profiles I've created have the exact same
      priv requests.  It's also odd that apparmor is stating "ALLOWED"
      but then still blocking the execution?</p>
    <p>Running pstree at the same time as apt shows the following order:
      systemd, sshd, sshd, sshd, bash, sudo, bash, apt, gpgv (and http,
      http), gpgv
    </p>
    <blockquote>
      <p><a class="moz-txt-link-abbreviated" href="mailto:root@1546-w-dev:/etc/apparmor.d#">root@1546-w-dev:/etc/apparmor.d#</a> cat usr.lib.apt.methods.gpgv <br>
        profile usr.lib.apt.methods.gpgv /usr/lib/apt/methods/gpgv
        flags=(complain) {<br>
            #include <local/whitelist><br>
        }</p>
      <p><br>
      </p>
      <p><a class="moz-txt-link-abbreviated" href="mailto:root@1546-w-dev:/etc/apparmor.d#">root@1546-w-dev:/etc/apparmor.d#</a> cat usr.bin.apt_key<br>
        profile usr.bin.apt_key /usr/bin/apt-key flags=(complain) {<br>
            #include <local/whitelist><br>
        }</p>
    </blockquote>
    <p><br>
    </p>
    <p>Have I ran into this? 
      <a class="moz-txt-link-freetext" href="https://lists.ubuntu.com/archives/apparmor/2018-November/011846.html">https://lists.ubuntu.com/archives/apparmor/2018-November/011846.html</a></p>
    <blockquote>
      <p><a class="moz-txt-link-abbreviated" href="mailto:root@1546-w-dev:/etc/apparmor.d#">root@1546-w-dev:/etc/apparmor.d#</a> uname -r<br>
        4.15.0-50-generic<br>
      </p>
    </blockquote>
    <p>I see this problem with 'man' too.</p>
    <p>I'm sooo close to getting this working... <br>
    </p>
  </body>
</html>