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-prev] [day] [month] [year] [list]
Date:	Thu, 29 Jan 2015 20:54:53 -0600
From:	Josh Poimboeuf <jpoimboe@...hat.com>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	Satoru Takeuchi <satoru.takeuchi@...il.com>,
	linux-kernel@...r.kernel.org
Subject: [PATCH] ktest: cleanup terminal on dodie() failure

On Thu, Jan 29, 2015 at 05:07:51PM -0500, Steven Rostedt wrote:
> On Thu, 29 Jan 2015 15:39:39 -0600
> Josh Poimboeuf <jpoimboe@...hat.com> wrote:
> 
> 
> > Can you tell if it died via dodie()?  Looks like that wouldn't clean up
> > the stty settings.
> > 
> 
> Looks to have happen in monitor where it called:
> 
> 	fail "failed - got a bug report" and return 0;
> 
> And must have had $die_on_failure set because it did not post a KTEST
> RESULT message. That means yes, it would hit dodie() called by fail().

This fixes it for me:

--8<--

Subject: [PATCH] ktest: cleanup terminal on dodie() failure

If dodie() is called with the console open, restore the terminal's
original settings before dying.

Signed-off-by: Josh Poimboeuf <jpoimboe@...hat.com>
---
 tools/testing/ktest/ktest.pl | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index acaf05b..04e9391 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -1342,6 +1342,11 @@ sub dodie {
 	print " See $opt{LOG_FILE} for more info.\n";
     }
 
+    if ($monitor_cnt) {
+	    # restore terminal settings
+	    system("stty $stty_orig");
+    }
+
     die @_, "\n";
 }
 
@@ -1384,7 +1389,7 @@ sub exec_console {
     close($pts);
 
     exec $console or
-	dodie "Can't open console $console";
+	die "Can't open console $console";
 }
 
 sub open_console {
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ