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] [thread-next>] [day] [month] [year] [list]
Message-ID: <4AC1707D.6020909@intel.com>
Date:	Tue, 29 Sep 2009 10:27:09 +0800
From:	Shane Wang <shane.wang@...el.com>
To:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:	Ingo Molnar <mingo@...e.hu>, "H. Peter Anvin" <hpa@...or.com>,
	"Cihula, Joseph" <joseph.cihula@...el.com>,
	"arjan@...ux.intel.com" <arjan@...ux.intel.com>,
	"andi@...stfloor.org" <andi@...stfloor.org>,
	"chrisw@...s-sol.org" <chrisw@...s-sol.org>,
	"jmorris@...ei.org" <jmorris@...ei.org>,
	"jbeulich@...ell.com" <jbeulich@...ell.com>,
	"peterm@...hat.com" <peterm@...hat.com>
Subject: [PATCH] intel_txt: fix the buggy timeout warning logic in tboot

This patch based on an original version by H. Peter Anvin fixed the buggy 
timeout warning logic in tboot.

---
  arch/x86/kernel/tboot.c |    9 +++++----
  1 file changed, 5 insertions(+), 4 deletions(-)


Signed-off-by: Shane Wang <shane.wang@...el.com>

diff -r 0edd117ada44 arch/x86/kernel/tboot.c
--- a/arch/x86/kernel/tboot.c	Wed Sep 23 10:06:56 2009 -0700
+++ b/arch/x86/kernel/tboot.c	Mon Sep 28 07:42:18 2009 -0700
@@ -301,16 +301,17 @@ static int tboot_wait_for_aps(int num_ap
  	unsigned long timeout;

  	timeout = AP_WAIT_TIMEOUT*HZ;
-	while (atomic_read((atomic_t *)&tboot->num_in_wfs) != num_aps &&
-	       timeout) {
+	while (timeout) {
+		if (atomic_read((atomic_t *)&tboot->num_in_wfs) == num_aps)
+			break;
  		mdelay(1);
  		timeout--;
  	}

-	if (timeout)
+	if (!timeout)
  		pr_warning("tboot wait for APs timeout\n");

-	return !(atomic_read((atomic_t *)&tboot->num_in_wfs) == num_aps);
+	return !timeout;
  }

  static int __cpuinit tboot_cpu_callback(struct notifier_block *nfb,

View attachment "timeout_fix.patch" of type "text/plain" (903 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ