<?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>11671</bug_id>
          
          <creation_ts>2017-06-15 16:04:02 +0000</creation_ts>
          <short_desc>[openssh] Interrupting host key generation can prevent SSH login</short_desc>
          <delta_ts>2017-10-09 14:05: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>connectivity</component>
          <version>unspecified</version>
          <rep_platform>All</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.5</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joshua Watt">JPEWhacker</reporter>
          <assigned_to name="Joshua Watt">JPEWhacker</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</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>74238</commentid>
    <comment_count>0</comment_count>
    <who name="Joshua Watt">JPEWhacker</who>
    <bug_when>2017-06-15 16:04:02 +0000</bug_when>
    <thetext>The host key generation for openSSH can take a significant amount of time when a product is booting up, and the current init scripts only use a file existence check to determine if the keys should be generated. This leaves a window of time where a power interruption during boot can cause the key files to be created, but corrupted (either zero length files, or bad data). If this happens, the device will not regenerate valid keys (because they exist), but login via SSH will not be possible (because the keys are corrupted).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74239</commentid>
    <comment_count>1</comment_count>
    <who name="Joshua Watt">JPEWhacker</who>
    <bug_when>2017-06-15 16:07:53 +0000</bug_when>
    <thetext>NOTE: I have a patch series to address this already: https://patchwork.openembedded.org/series/6626/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75767</commentid>
    <comment_count>2</comment_count>
    <who name="Jussi Kukkonen">jku</who>
    <bug_when>2017-08-09 11:03:39 +0000</bug_when>
    <thetext>I think the idea is good and the patch looks ok to me... except the last version is somehow malformed?

Is this still on your radar Joshua?


The only complaint I might have is with the sshdgenkeys.service  ConditionPathExists rules...


+ConditionPathExists=|!/var/run/ssh/ssh_host_rsa_key
+ConditionPathExists=|!/var/run/ssh/ssh_host_dsa_key
+ConditionPathExists=|!/var/run/ssh/ssh_host_ecdsa_key
+ConditionPathExists=|!/var/run/ssh/ssh_host_ed25519_key
+ConditionPathExists=|!/etc/ssh/ssh_host_rsa_key
+ConditionPathExists=|!/etc/ssh/ssh_host_dsa_key
+ConditionPathExists=|!/etc/ssh/ssh_host_ecdsa_key
+ConditionPathExists=|!/etc/ssh/ssh_host_ed25519_key

There does not seem to not trigger this condition -- some of those files will always be missing. If we can&apos;t make a useful condition then we should remove the conditions altogether.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75768</commentid>
    <comment_count>3</comment_count>
    <who name="Joshua Watt">JPEWhacker</who>
    <bug_when>2017-08-09 13:02:25 +0000</bug_when>
    <thetext>Yes, this is still on my radar.

I don&apos;t believe the patch is malformed, it just depends on https://patchwork.openembedded.org/series/7509/ being merged first. Would you like me to assign it to myself?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75770</commentid>
    <comment_count>4</comment_count>
    <who name="Jussi Kukkonen">jku</who>
    <bug_when>2017-08-09 13:20:55 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; I don&apos;t believe the patch is malformed, it just depends on
&gt; https://patchwork.openembedded.org/series/7509/ being merged first. Would
&gt; you like me to assign it to myself?

Oh that makes sense, thanks. I&apos;m assigning the bug to you to reflect reality.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77462</commentid>
    <comment_count>5</comment_count>
    <who name="Joshua Watt">JPEWhacker</who>
    <bug_when>2017-10-09 14:05:24 +0000</bug_when>
    <thetext>Merged as 43fc3d8e180c168dbe5dd5faa577e69a279bd1bd</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>