<?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>1008</bug_id>
          
          <creation_ts>2011-04-26 09:35:51 +0000</creation_ts>
          <short_desc>New santiy check for userspace packages</short_desc>
          <delta_ts>2012-02-06 10:24:11 +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>Meta-yocto</product>
          <component>meta-yocto</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>(P2)(QA Testing Completed) (Done)</status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>1.2 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mark Hatle">mark.hatle</reporter>
          <assigned_to name="Scott Garman">scott.a.garman</assigned_to>
          <cc>jiajun.xu</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>scott.a.garman</cc>
    
    <cc>sgw</cc>
    
    <cc>song.liu</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>13428</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2011-04-26 09:35:51 +0000</bug_when>
    <thetext>There is a general rule on Linux systems where the items in /bin, /sbin and /lib should never referenced things location under the /usr mount.

This is because /usr may be mounted much later in boot cycle, or perhaps won&apos;t be mounted at all in case of a system recovery action.

A sanity check should be added that verify that scripts, and libraries from /bin, /sbin and /lib do not reference other libraries that exist in outside of the /bin, /sbin and /lib directories.

This sanity check may be partially done during package generation, but may also have to be done at the end after the rootfs image has been constructed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17168</commentid>
    <comment_count>1</comment_count>
    <who name="Scott Garman">scott.a.garman</who>
    <bug_when>2011-11-09 14:02:46 +0000</bug_when>
    <thetext>Design I&apos;m starting with:

Iterate through each file in /bin, /sbin, and /lib of the rootfs, and grep the output of the &apos;file&apos; command to determine which type the file is. Based on my desktop system, the keywords I&apos;d grep for are:

ELF - binary or library
Bourne - shell script
&quot;POSIX shell&quot; - shell script

Then based on this I would grep shell scripts for &quot;usr&quot;, and grep the output of ldd of binaries/libraries for &quot;usr&quot;. I&apos;d then throw a QA warning.

This would be a function I&apos;d add to the default do_package step.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17169</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2011-11-09 14:33:46 +0000</bug_when>
    <thetext>I think the general design is correct.  But you&apos;ll likely want to break this up into a few steps as some are more useful (and time consuming) then others.

The critical one for me is the library dependencies.. things installed in /bin or /sbin should not reference libraries in /usr/lib.  Similarly libraries in /lib should also not references libraries in /usr/lib.  These to me should be an error.

For the scripts scanning for specific calls to /usr/...  from the items in /bin and /sbin.  This is likely the right approach.  It&apos;s far from fool-proof, but it will help...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17185</commentid>
    <comment_count>3</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2011-11-11 10:40:02 +0000</bug_when>
    <thetext>Design ACK&apos;ed</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18089</commentid>
    <comment_count>4</comment_count>
    <who name="Scott Garman">scott.a.garman</who>
    <bug_when>2012-01-11 16:57:49 +0000</bug_when>
    <thetext>In Poky master and oe-core as of:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=198f2ac06e60245750a2c6561b8c8e2eaa93f6be

http://git.openembedded.org/openembedded-core/commit/?id=ed937940f54d1a376b518fc276da78811c4ac50b</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18488</commentid>
    <comment_count>5</comment_count>
    <who name="Jiajun Xu">jiajun.xu</who>
    <bug_when>2012-02-05 21:21:05 +0000</bug_when>
    <thetext>I tested against latest master with commit cb89d43473a91ff4cb2447d642fcd9308d7366e3, the feature could work and improper link would be reported out by bitbake.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>