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, 18 Mar 2019 19:58:33 +0800
From:   Kefeng Wang <wangkefeng.wang@...wei.com>
To:     <linux-kernel@...r.kernel.org>
CC:     Kefeng Wang <wangkefeng.wang@...wei.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Bart Van Assche <bvanassche@....org>,
        "Ingo Molnar" <mingo@...nel.org>, Tejun Heo <tj@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>
Subject: [PATCH] workqueue, lockdep: Fix new alloc_workqueue() error path

If alloc_workqueue_attrs() fails, the workqueue lockdep is
uninitialized, it will trigger a warning in err_free_wq path
when try to unregister workqueue lockdep.

Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Bart Van Assche <bvanassche@....org>
Cc: Ingo Molnar <mingo@...nel.org>
Cc: Tejun Heo <tj@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Fixes: 009bb421b6ce ("workqueue, lockdep: Fix an alloc_workqueue() error path")
Signed-off-by: Kefeng Wang <wangkefeng.wang@...wei.com>
---
 kernel/workqueue.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 4026d1871407..2c19f2968bc7 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -4242,7 +4242,7 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
 	if (flags & WQ_UNBOUND) {
 		wq->unbound_attrs = alloc_workqueue_attrs(GFP_KERNEL);
 		if (!wq->unbound_attrs)
-			goto err_free_wq;
+			goto err_unbound_attrs;
 	}
 
 	va_start(args, max_active);
@@ -4296,6 +4296,7 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
 	wq_unregister_lockdep(wq);
 	wq_free_lockdep(wq);
 	free_workqueue_attrs(wq->unbound_attrs);
+err_unbound_attrs:
 	kfree(wq);
 	return NULL;
 err_destroy:
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ