<?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>11026</bug_id>
          
          <creation_ts>2017-02-07 18:19:05 +0000</creation_ts>
          <short_desc>cve-check: Error in executing cve-check-update</short_desc>
          <delta_ts>2017-02-23 16:08:52 +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>Security - Recipe Upgrade</product>
          <component>security</component>
          <version>2.3</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>normal</bug_severity>
          <target_milestone>2.3 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sona Sarmadi">sona.sarmadi</reporter>
          <assigned_to name="Jussi Kukkonen">jku</assigned_to>
          <cc>bluelightning</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>70509</commentid>
    <comment_count>0</comment_count>
    <who name="Sona Sarmadi">sona.sarmadi</who>
    <bug_when>2017-02-07 18:19:05 +0000</bug_when>
    <thetext>cve-check tool does not work on master and latest morty branch:
 
poky/build-cve-check$ bitbake -k -c cve_check universe


WARNING: cve-check-tool-native-5.6.4-r0 do_populate_cve_db: Error in executing cve-check-update
WARNING: cve-check-tool-native-5.6.4-r0 do_populate_cve_db: Failed to update cve-check-tool database, CVEs won&apos;t be checked



do_populate_cve_db() {
    if [ &quot;${BB_NO_NETWORK}&quot; = &quot;1&quot; ] ; then
        bberror &quot;BB_NO_NETWORK is set; Can&apos;t update cve-check-tool database, CVEs won&apos;t be checked&quot;
        return
    fi

    # In case we don&apos;t inherit cve-check class, use default values defined in the class.
    cve_dir=&quot;${CVE_CHECK_DB_DIR}&quot;
    cve_file=&quot;${CVE_CHECK_TMP_FILE}&quot;

    [ -z &quot;${cve_dir}&quot; ] &amp;&amp; cve_dir=&quot;${DL_DIR}/CVE_CHECK&quot;
    [ -z &quot;${cve_file}&quot; ] &amp;&amp; cve_file=&quot;${TMPDIR}/cve_check&quot;

    bbdebug 2 &quot;Updating cve-check-tool database located in $cve_dir&quot;
    if cve-check-update -d &quot;$cve_dir&quot; ; then
        printf &quot;CVE database was updated on %s UTC\n\n&quot; &quot;$(LANG=C date --utc +&apos;%F %T&apos;)&quot; &gt; &quot;$cve_file&quot;
    else
        bbwarn &quot;Error in executing cve-check-update&quot;  &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
        if [ &quot;${@&apos;1&apos; if bb.data.inherits_class(&apos;cve-check&apos;, d) else &apos;0&apos;}&quot; -ne 0 ] ; then
            bbwarn &quot;Failed to update cve-check-tool database, CVEs won&apos;t be checked&quot;    &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
        fi
    fi
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70510</commentid>
    <comment_count>1</comment_count>
    <who name="Sona Sarmadi">sona.sarmadi</who>
    <bug_when>2017-02-07 18:23:14 +0000</bug_when>
    <thetext>
On 6 February 2017 at 16:56, Burton, Ross &lt;ross.burton@intel.com&gt; wrote:

This definitely needs to be rewritten so you can see the output if it fails.  Just run cve-check-update -d &lt;dir&gt; yourself and see what it says.  Last time I had this failing it was because the mitre servers were offline.

Jussi:
Agreed about the error output.

I think recipe specific sysroots broke the setup somehow (so the tools are not actually in sysroot when they&apos;re needed). I&apos;m taking a look at this tomorrow.

Jussi</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70911</commentid>
    <comment_count>2</comment_count>
    <who name="Jussi Kukkonen">jku</who>
    <bug_when>2017-02-23 16:08:52 +0000</bug_when>
    <thetext>Fixed in master with these patches.

commit d887c24d5af0f570a259985fa99af5c56158fcfa
Author: Jussi Kukkonen &lt;jussi.kukkonen@intel.com&gt;
Date:   Thu Feb 9 21:38:33 2017 +0200

    cve-check-tool: Use CA cert bundle in correct sysroot
    
    Native libcurl looks for CA certs in the wrong place by
    default.
    * Add patch that allows overriding the default CA certificate
      location. Patch is originally from meta-security-isafw.
    * Use the new --cacert to set the correct CA bundle path
    
    (From OE-Core rev: 73bd11d5190a072064128cc13b4537154d07b129)
    
    Signed-off-by: Jussi Kukkonen &lt;jussi.kukkonen@intel.com&gt;
    Signed-off-by: Ross Burton &lt;ross.burton@intel.com&gt;
    Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;

commit ea616d122676e7d5bbf606b7dbfa8f62c63d4a27
Author: Jussi Kukkonen &lt;jussi.kukkonen@intel.com&gt;
Date:   Thu Feb 9 21:38:32 2017 +0200

    cve-check-tool: Fixes for recipe sysroots
    
    * Use --enable-relative-plugins so cve-check-tool looks for
      loadable modules relative to binary location instead of
      hard-coding a wrong sysroot location
    * do_populate_cve_db() assumes that the binary cve-check-update is in
      the sysroot. Ensure that this is true by adding a task dependency
    
    (From OE-Core rev: 2da6b01893d0afe8750bd0b12a8d55aafa82f58c)
    
    Signed-off-by: Jussi Kukkonen &lt;jussi.kukkonen@intel.com&gt;
    Signed-off-by: Ross Burton &lt;ross.burton@intel.com&gt;
    Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;

commit 0d637857f2a8387e38da2ed590a10daf595ed124
Author: Jussi Kukkonen &lt;jussi.kukkonen@intel.com&gt;
Date:   Thu Feb 9 21:38:31 2017 +0200

    cve-check.bbclass: Fix dependencies
    
    With recipe-specific sysroots the cve_check task must depend on
    cve-check-tool-native:do_populate_sysroot to get the cve-check-tool
    binary into the recipe sysroot.
    
    A normal DEPENDS isn&apos;t used to avoid cyclic dependencies.
    
    (From OE-Core rev: bd60b1018bc0304bc928701e6d1090c8b1223616)
    
    Signed-off-by: Jussi Kukkonen &lt;jussi.kukkonen@intel.com&gt;
    Signed-off-by: Ross Burton &lt;ross.burton@intel.com&gt;
    Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>