<?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>14369</bug_id>
          
          <creation_ts>2021-04-29 07:07:23 +0000</creation_ts>
          <short_desc>rng-tools: rngd hang when use jitter entropy with internal timer</short_desc>
          <delta_ts>2021-11-09 02:14:21 +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>oe-core other</component>
          <version>3.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>backport</status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>3.4 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mingli Yu">mingli.yu</reporter>
          <assigned_to name="Mingli Yu">mingli.yu</assigned_to>
          <cc>JPEWhacker</cc>
    
    <cc>randy.macleod</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>90151</commentid>
    <comment_count>0</comment_count>
    <who name="Mingli Yu">mingli.yu</who>
    <bug_when>2021-04-29 07:07:23 +0000</bug_when>
    <thetext>The rngd hang when the board only has jitter entropy and also coarse resolution timer.

And the issue can be reproduced in any board when force to use the internal timer as below:
1, apply below patch for libjitterentropy recipe which rng-tools depends(this pach force to use the internal timer).
$ git diff
diff --git a/jitterentropy-base.c b/jitterentropy-base.c
index 6dbb484..07397cb 100644
--- a/jitterentropy-base.c
+++ b/jitterentropy-base.c
@@ -1387,7 +1387,8 @@ int jent_entropy_init(void)
        if (sha3_tester())
                return EHASH;
 
-       ret = jent_time_entropy_init(0);
+       //ret = jent_time_entropy_init(0);
+       ret = 1;
 
 #ifdef JENT_CONF_ENABLE_INTERNAL_TIMER
        jent_force_internal_timer = 0;

2, use the jitter entropy as below:
rngd -f -x hwrng -x rdrand</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90168</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-04-29 15:18:48 +0000</bug_when>
    <thetext>We are following the general kernel security/ rngd recommendations.
There are other sources of entropy such as virt-io. 

maybe we should be using haveved?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90200</commentid>
    <comment_count>2</comment_count>
    <who name="Mingli Yu">mingli.yu</who>
    <bug_when>2021-04-30 02:04:50 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; We are following the general kernel security/ rngd recommendations.
&gt; There are other sources of entropy such as virt-io. 
&gt; 
&gt; maybe we should be using haveved?

The bug against the jitter entropy source, such as on the borad nxp-s32g2xx, we only have the jitter entropy source and also need to use the internal timer as the coarse resolution timer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90201</commentid>
    <comment_count>3</comment_count>
    <who name="Mingli Yu">mingli.yu</who>
    <bug_when>2021-04-30 02:05:32 +0000</bug_when>
    <thetext>The bug against the jitter entropy source, such as on the borad nxp-s32g2xx, we only have the jitter entropy source and also need to use the internal timer as the coarse resolution timer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90267</commentid>
    <comment_count>4</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-05-06 14:35:13 +0000</bug_when>
    <thetext>Mingli, Please work with the upstream developers to figure out how to deal with the behaviour on this board.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90269</commentid>
    <comment_count>5</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-05-06 14:36:09 +0000</bug_when>
    <thetext>Again:
We are following the general kernel security/ rngd recommendations.
There are other sources of entropy such as virt-io. 
maybe we should be using haveved?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90377</commentid>
    <comment_count>6</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-05-13 15:33:36 +0000</bug_when>
    <thetext>We&apos;re talking about this on the oe-core email list.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91915</commentid>
    <comment_count>7</comment_count>
    <who name="Mingli Yu">mingli.yu</who>
    <bug_when>2021-11-09 02:14:21 +0000</bug_when>
    <thetext>https://git.openembedded.org/openembedded-core/commit/?id=ea06a05bf00ffc004184faa93a41deee84105f8a
https://git.openembedded.org/openembedded-core/commit/?id=28b3d8c01966d16f8ab8d61beaf9527f987f1ec6</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>