lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 17 Apr 2019 16:14:42 -0400
From:   Masayoshi Mizuma <msys.mizuma@...il.com>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     Masayoshi Mizuma <msys.mizuma@...il.com>,
        Masayoshi Mizuma <m.mizuma@...fujitsu.com>,
        linux-kernel@...r.kernel.org
Subject: [PATCH] ktest: Add workaround to avoid unexpected power cycle

From: Masayoshi Mizuma <m.mizuma@...fujitsu.com>

Unexpected power cycle occurs while the installation of the
kernel.

That is because the default reboot command, "ssh $SSH_USER@...CHINE
reboot" exits as 255 even if the reboot is successfully done,
like as:

  ]# ssh root@...t reboot
  Connection to Test closed by remote host.
  ]# echo $?
  255
  ]#

To avoid the unexpected power cycle, the reboot is considered as
successfully done if the reboot is the default command and the
return code is 255.

Signed-off-by: Masayoshi Mizuma <m.mizuma@...fujitsu.com>
---
 tools/testing/ktest/ktest.pl | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index ea07d43856b8..765c6bc83ab4 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -1737,6 +1737,11 @@ sub run_command {
     my $dord = 0;
     my $dostdout = 0;
     my $pid;
+    my $is_default_reboot = 0;
+
+    if ($command eq $default{REBOOT}) {
+	$is_default_reboot = 1;
+    }
 
     $command =~ s/\$SSH_USER/$ssh_user/g;
     $command =~ s/\$MACHINE/$machine/g;
@@ -1791,6 +1796,10 @@ sub run_command {
     # shift 8 for real exit status
     $run_command_status = $? >> 8;
 
+    if ($run_command_status == 255 && $is_default_reboot) {
+	$run_command_status = 0;
+    }
+
     close(CMD);
     close(LOG) if ($dolog);
     close(RD)  if ($dord);
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ