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>] [day] [month] [year] [list]
Date:   Thu, 15 Oct 2020 22:05:10 +0800
From:   Hui Su <sh_def@....com>
To:     sh_def@....com, leon@...nel.org, jgg@...pe.ca,
        keescook@...omium.org, kvalo@...eaurora.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH] async.c: reduce the critical region in lowest_in_progress()

The judgement of first do not need to be in the critical region.
So move it out.

Signed-off-by: Hui Su <sh_def@....com>
---
 kernel/async.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/async.c b/kernel/async.c
index 33258e6e20f8..9d33ffcc84c7 100644
--- a/kernel/async.c
+++ b/kernel/async.c
@@ -96,10 +96,10 @@ static async_cookie_t lowest_in_progress(struct async_domain *domain)
 					struct async_entry, global_list);
 	}
 
+	spin_unlock_irqrestore(&async_lock, flags);
 	if (first)
 		ret = first->cookie;
 
-	spin_unlock_irqrestore(&async_lock, flags);
 	return ret;
 }
 
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ