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:	Mon, 5 Jan 2015 11:35:35 +0800
From:	Chunyan Zhang <chunyan.zhang@...eadtrum.com>
To:	<akpm@...ux-foundation.org>, <ionut.m.alexa@...il.com>,
	<mark.yang@...eadtrum.com>, <wei.qiao@...eadtrum.com>,
	<geng.ren@...eadtrum.com>
CC:	<orson.zhai@...eadtrum.com>, <zhizhou.zhang@...eadtrum.com>,
	<ke.wang@...eadtrum.com>, <zhang.lyra@...il.com>,
	<linux-kernel@...r.kernel.org>
Subject: [PATCH] kernel: async: Fixed the wrong waitting condition of wait_event

From: Yonghui Yang <mark.yang@...eadtrum.com>

This patch changes the waitting condition of wait_event in the
function 'async_synchronize_cookie_domain'.

This function waits until all asynchronous function calls for the certain
domain have been done.

But, the function 'lowest_in_progress' returns the lowest *pending*
entry's cookie.

So we should make sure that the return value of lowest_in_progress(domain)
must be larger than @cookie.

Verified-by: Wei Qiao <wei.qiao@...eadtrum.com>
Signed-off-by: Yonghui Yang <mark.yang@...eadtrum.com>
Signed-off-by: Geng Ren <geng.ren@...eadtrum.com>
Signed-off-by: Chunyan Zhang <chunyan.zhang@...eadtrum.com>
---
 kernel/async.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/async.c b/kernel/async.c
index 4c3773c..894ae80 100644
--- a/kernel/async.c
+++ b/kernel/async.c
@@ -267,7 +267,7 @@ EXPORT_SYMBOL_GPL(async_unregister_domain);
  */
 void async_synchronize_full_domain(struct async_domain *domain)
 {
-	async_synchronize_cookie_domain(ASYNC_COOKIE_MAX, domain);
+	async_synchronize_cookie_domain(ASYNC_COOKIE_MAX-1, domain);
 }
 EXPORT_SYMBOL_GPL(async_synchronize_full_domain);
 
@@ -289,7 +289,7 @@ void async_synchronize_cookie_domain(async_cookie_t cookie, struct async_domain
 		starttime = ktime_get();
 	}
 
-	wait_event(async_done, lowest_in_progress(domain) >= cookie);
+	wait_event(async_done, lowest_in_progress(domain) > cookie);
 
 	if (initcall_debug && system_state == SYSTEM_BOOTING) {
 		endtime = ktime_get();
-- 
1.7.9.5

--
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