<?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>10885</bug_id>
          
          <creation_ts>2017-01-06 02:23:23 +0000</creation_ts>
          <short_desc>qemu-x86_64 hangs when running target programs under grsec</short_desc>
          <delta_ts>2017-01-12 18:01:24 +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>Scripts and Tools</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>x86_64</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>jonathan.yong</reporter>
          <assigned_to name="Ed Bartosh">eduard.bartosh</assigned_to>
          <cc>jonathan.yong</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>ross.burton</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>69563</commentid>
    <comment_count>0</comment_count>
    <who name="">jonathan.yong</who>
    <bug_when>2017-01-06 02:23:23 +0000</bug_when>
    <thetext>This entry is more of an observational report than an actual bug.

The build machine uses a grsec kernel that enforces stack and mmap base address randomization (CONFIG_PAX_RANDMMAP &amp;&amp; CONFIG_PAX_PT_PAX_FLAGS &amp;&amp; !CONFIG_PAX_SOFTMODE).

The Yocto build is then started under a Docker session. All goes well until qemu-x86_64 is invoked to run target programs, where it hangs in a tight CPU loop.

paxctl is used to fix this situation:
[Stop the build, paxctl refuse to work on files that are in use]
paxctl -c .../qemu-x86_64
paxctl -r .../qemu-x86_64
[Continue the build]

Other grsec build machine observations:
Trusted Path Execution (CONFIG_GRKERNSEC_TPE) interferes with cdrecord-native build because it runs tests under world writeable directories.
W/A: Temporarily set /proc/sys/kernel/grsecurity/tpe to 0.

Likewise for these if the build is run under docker
/proc/sys/kernel/grsecurity/chroot_deny_chmod
/proc/sys/kernel/grsecurity/chroot_deny_fchdir</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69564</commentid>
    <comment_count>1</comment_count>
    <who name="">jonathan.yong</who>
    <bug_when>2017-01-06 07:48:44 +0000</bug_when>
    <thetext>Additionally, qt4-native also needs -no-pch to avoid ICE on the docker compiler. Cause is unknown.

Docker container is running Debian Jessie with gcc version 4.9.2 (Debian 4.9.2-10).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69771</commentid>
    <comment_count>2</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2017-01-12 18:01:24 +0000</bug_when>
    <thetext>Thanks for the report and the steps needed to work-around the problem.

There was a short discussion about this and while it&apos;s tempting to fix the problem, 
no one knew of a commonly used distro that enabled grsec so it didn&apos;t seem like a valid bug or one that would get fixed. It would be good to report the problem to qemu upstream maintainers.

I added a link to this defect in the wiki:
  https://wiki.yoctoproject.org/wiki/Technical_FAQ#Building_on_a_system_with_a_GRSec_kernel_doesn.27t_work_well.2C_is_that_supported.3F

and I&apos;m closing the defect as won&apos;t fix.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>