<?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>8622</bug_id>
          
          <creation_ts>2015-11-02 08:28:29 +0000</creation_ts>
          <short_desc>e2fsprogs: support xattr</short_desc>
          <delta_ts>2016-01-19 10:32:23 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>devtools / tool chain</component>
          <version>2.1</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.1 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Patrick Ohly">patrick.ohly</reporter>
          <assigned_to name="Robert Yang">liezhi.yang</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>joshuagloe</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>richard.purdie</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>56069</commentid>
    <comment_count>0</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-11-02 08:28:29 +0000</bug_when>
    <thetext>Current master branch of e2fsprogs contains support for creating images with xattrs. Updating to that code would allow different layers which currently carry their own patches for that (meta-intel-iot-security, meta-selinux) to remove their patches and use a common, upstream code base again.

It would also fix certain file system corruption problems that we&apos;ve seen with meta-intel-iot-security, but could never fully reproduce in OE-core itself (only one part of those were fixed in bug #8544 by backporting from master).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56231</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2015-11-05 15:45:08 +0000</bug_when>
    <thetext>As I understand it, we have patches in Yocto jethro/master which supports xattrs. If we don&apos;t, we should look into how we can get that support, perhaps on the latest stable 1.42 release.

I&apos;m hearing rumour that 1.43-pre hasn&apos;t been released as there are stability concerns with it and as such I&apos;m worried that switching to such a pre release may cause more problems that it solves.

Do we have a known good version of e2fsprogs that works ok without corruption with xattrs?

Really need more info since blindly updating to 1.43-pre worries me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56245</commentid>
    <comment_count>2</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-11-05 17:02:03 +0000</bug_when>
    <thetext>If I remember correctly, Robert said that 1.42 does not yet have the &quot;create image from directory&quot; support. 1.43-pre would have that plus xattr and thus can be used directly with no or only very minimal build patches.

I can try 1.42 plus separate &quot;create image from directory&quot; patch if someone prepares it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56255</commentid>
    <comment_count>3</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2015-11-06 03:06:16 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; If I remember correctly, Robert said that 1.42 does not yet have the &quot;create
&gt; image from directory&quot; support. 1.43-pre would have that plus xattr and thus

I had ported the patches &quot;create image from directory&quot; to 1.42.

&gt; can be used directly with no or only very minimal build patches.
&gt; 
&gt; I can try 1.42 plus separate &quot;create image from directory&quot; patch if someone
&gt; prepares it.

It is already in oe-core&apos;s 1.42 e2fsprogs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56260</commentid>
    <comment_count>4</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-11-06 08:33:13 +0000</bug_when>
    <thetext>Sorry, I had lost track of what is in OE-core and what isn&apos;t.

While moving to 1.43-pre would allow OE-core to drop some patches because creation from a directory is in that upstream version, the real motivation for filing this issue was the lack of xattr support in current OE-core. I&apos;ve renamed the issue accordingly.

Instead of moving to 1.43-pre, another solution would be to take in the patches that are currently in meta-selinux. Besides the e2fsprogs_1.42.bbappend and its patches, the linux-libc-headers%.bbappend change is also needed.

I tried that and can confirm that it also fixes the problem that we have with the current xattr patches in meta-intel-iot-security.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56499</commentid>
    <comment_count>5</comment_count>
    <who name="Stephen K Jolley">sjolley.yp.pm</who>
    <bug_when>2015-11-16 20:59:50 +0000</bug_when>
    <thetext>It appears the questions have been answered.   If other items require NEEDINFO, please place it back in that state.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57140</commentid>
    <comment_count>6</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-12-09 10:36:53 +0000</bug_when>
    <thetext>Do we have an estimate when this might get done?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57147</commentid>
    <comment_count>7</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-12-09 16:31:20 +0000</bug_when>
    <thetext>When you add it to OE-core, can bump the version that is higher than 1.42.9 (the current version in OE-core) and (more importantly) higher than 1.42.9+git... (which is what we had in meta-intel-iot-security)?

Something like 1.4.9+1 perhaps?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57156</commentid>
    <comment_count>8</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-12-10 11:36:56 +0000</bug_when>
    <thetext>Choosing a suitable candidate that meets the requirement won&apos;t be as easy as I thought. I noticed that the e2fsprogs from meta-selinux also has problems.

My testcase is a build with meta-security-smack and meta-integrity enabled and capabilities set for one binary, leading to:

$ bitbake -c devshell iot-os-image

# getfattr -d -m . ../rootfs/etc/
# file: ../rootfs/etc/
security.SMACK64=&quot;System::Shared&quot;
security.SMACK64TRANSMUTE=&quot;TRUE&quot;
# filecap `pwd`/../rootfs/bin/busybox.net_raw 
file                 capabilities
.../rootfs/bin/busybox.net_raw     net_raw
# getfattr -d -m . ../rootfs/bin/busybox.net_raw 
# file: ../rootfs/bin/busybox.net_raw
security.capability=0sAQAAAgAgAAAAAAAAAAAAAAAAAAA=
security.ima=0sAwIC2C1O/QCAhDxwbreBIrADq3f0LdBQ3D2LAF/KE2IhFSnAI9kz8anW0+MzC7aSMR+MSi6DJ0NlDBmHthjG9m6hWxHWFHhlDMZegkBBxow4LdM5Ia/puQHYGwWjWc1tqi+awU2HjlsnsE3Y+QEn8dUCYFOSeFgftZxDtAX6jMDk/2vvYtlnrjU=



With e2fsprogs from meta-selinux I only get into the ext4 partition:

# getfattr -d -m . /etc
getfattr: Removing leading &apos;/&apos; from absolute path names
# file: etc
security.SMACK64=&quot;_&quot;
security.SMACK64TRANSMUTE=&quot;TRUE&quot;
root@qemux86:~# filecap /bin/busybox.net_raw 
root@qemux86:~# getfattr -d -m . /bin/busybox.net_raw 
getfattr: Removing leading &apos;/&apos; from absolute path names
# file: bin/busybox.net_raw
security.ima=0sAwIC2C1O/QCAhDxwbreBIrADq3f0LdBQ3D2LAF/KE2IhFSnAI9kz8anW0+MzC7aSMR+MSi6DJ0NlDBmHthjG9m6hWxHWFHhlDMZegkBBxow4LdM5Ia/puQHYGwWjWc1tqi+awU2HjlsnsE3Y+QEn8dUCYFOSeFgftZxDtAX6jMDk/2vvYtlnrjU=

Note that security.SMACK64 has the wrong value.

With e2fprogs 1.43-pre, the result is slightly better, but security.capabilities still gets dropped:

# getfattr -d -m . /etc/
getfattr: Removing leading &apos;/&apos; from absolute path names
# file: etc/
security.SMACK64=&quot;System::Shared&quot;
security.SMACK64TRANSMUTE=&quot;TRUE&quot;
root@qemux86:~# filecap /bin/busybox.net_raw
root@qemux86:~# getfattr -d -m . /bin/busybox.net_raw 
getfattr: Removing leading &apos;/&apos; from absolute path names
# file: bin/busybox.net_raw
security.ima=0sAwIC2C1O/QCAhDxwbreBIrADq3f0LdBQ3D2LAF/KE2IhFSnAI9kz8anW0+MzC7aSMR+MSi6DJ0NlDBmHthjG9m6hWxHWFHhlDMZegkBBxow4LdM5Ia/puQHYGwWjWc1tqi+awU2HjlsnsE3Y+QEn8dUCYFOSeFgftZxDtAX6jMDk/2vvYtlnrjU=</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57157</commentid>
    <comment_count>9</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-12-10 11:46:19 +0000</bug_when>
    <thetext>The revision of 1.43-pre was 0f26747167cc9d82df849b0aad387bf824f04544

The recipes I used are here:
https://github.com/pohly/meta-intel-iot-security/tree/e2fsprogs-1.43-pre
https://github.com/pohly/meta-intel-iot-security/tree/e2fsprogs-selinux</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57201</commentid>
    <comment_count>10</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-12-11 13:22:56 +0000</bug_when>
    <thetext>The reason why security.capability of busybox.net_raw does not get copied into the image is due to a flaw in the input data, not because of a flaw in e2fsprogs: busybox.net_raw is a hard link to busybox.suid.

pseudo allows setting capabilities and the suid bit differently for them (that&apos;s why everything looks alright in &quot;-c devshell&quot;, but in a real file system that is not possible, because file attributes are attached to the inode, not the directory entry. e2fsprogs thus randomly copies the attribute from one of the copies.

However, the meta-selinux problem with not coping security.SMACK64=&quot;System::Shared&quot; on /etc seems to be real.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57948</commentid>
    <comment_count>11</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2016-01-19 10:32:23 +0000</bug_when>
    <thetext>Updated to 1.43 WIP:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=8c3276ecea38d4d67c22e6db49060b2d4b457278</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>