<?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>14900</bug_id>
          
          <creation_ts>2022-08-19 07:43:14 +0000</creation_ts>
          <short_desc>Apparmor gives host contamination error with Dunfell 3.1.19 + Ubuntu 22.04</short_desc>
          <delta_ts>2022-08-25 14:42:19 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>Pseudo</product>
          <component>pseudo</component>
          <version>3.1.19</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ernst Persson">ernstp</reporter>
          <assigned_to name="Mark Hatle">mark.hatle</assigned_to>
          <cc>akuster</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>steve</cc>
    
    <cc>yp.pseudo.watcher</cc>
    
    <cc>yp.watcher</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>93862</commentid>
    <comment_count>0</comment_count>
    <who name="Ernst Persson">ernstp</who>
    <bug_when>2022-08-19 07:43:14 +0000</bug_when>
    <thetext>With Dunfell as of today (3.1.19-ish), Ubuntu 22.04 and meta-security,
building the Apparmor recipe gives the following error:

ERROR: apparmor-2.13.6-r0 do_package: Error executing a python function in exec_func_python() autogenerated:
...
File: &apos;/home/ernst/code/upstream/poky/meta/lib/oe/sstatesig.py&apos;, lineno: 553, function: process
     0549:                    add_perm(stat.S_IXOTH, &apos;x&apos;)
     0550:
     0551:                if include_owners:
     0552:                    try:
 *** 0553:                        update_hash(&quot; %10s&quot; % pwd.getpwuid(s.st_uid).pw_name)
     0554:                        update_hash(&quot; %10s&quot; % grp.getgrgid(s.st_gid).gr_name)
     0555:                    except KeyError as e:
     0556:                        bb.warn(&quot;KeyError in %s&quot; % path)
     0557:                        msg = (&quot;KeyError: %s\nPath %s is owned by uid %d, gid %d, which doesn&apos;t match &quot;
Exception: Exception: KeyError: &apos;getpwuid(): uid not found: 1000&apos;
Path ./package/etc/apparmor.d is owned by uid 1000, gid 1000, which doesn&apos;t match any user/group on target. This may be due to host contamination.

This doesn&apos;t happen on older Ubuntu LTS&apos;s!

From what I can tell etc/apparmor.d is created with a normal install -d command in apparmor profiles/Makefile .

Is there a libc system call that pseudo fails to intercept with Ubuntu 22.04?

To reproduce it&apos;s just setting up meta-security and meta-oe, everything dunfell, DISTRO_FEATURES:append = &quot; apparmor&quot;,
and then bitbake apparmor.

With Yocto from master this doesn&apos;t happen but it has a newer version of Apparmor so it&apos;s hard to pinpoint the difference...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93863</commentid>
    <comment_count>1</comment_count>
    <who name="Ernst Persson">ernstp</who>
    <bug_when>2022-08-19 08:22:29 +0000</bug_when>
    <thetext>Interesting, the exact same thing happens on Kirkstone with apparmor-3.0.4-r0 actually!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93864</commentid>
    <comment_count>2</comment_count>
    <who name="Ernst Persson">ernstp</who>
    <bug_when>2022-08-19 08:46:51 +0000</bug_when>
    <thetext>Ah, just found this workaround: https://git.yoctoproject.org/meta-security/commit/?id=b67b4cf5cafa5fb0c13dddc344ed286e7e6fcc72

But why is it needed?! :-)

Armin, backport to dunfell and kirkstone in the meantime?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93906</commentid>
    <comment_count>3</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2022-08-25 14:42:19 +0000</bug_when>
    <thetext>Appears to be a meta-security bug. Please discuss with that community 
https://git.yoctoproject.org/meta-security/tree/README

Looks like a broken Makefile but we&apos;re guessing (RP&apos;s guess.) -- YP Bug review</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>