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: <tip-1c322ac06d9af7ea259098ae5dc977855207d335@git.kernel.org>
Date:   Tue, 29 Aug 2017 07:24:19 -0700
From:   tip-bot for Boqun Feng <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     boqun.feng@...il.com, torvalds@...ux-foundation.org, arnd@...db.de,
        dan.j.williams@...el.com, linux-kernel@...r.kernel.org,
        akpm@...ux-foundation.org, hpa@...or.com, rjw@...ysocki.net,
        lenb@...nel.org, peterz@...radead.org, mingo@...nel.org,
        npiggin@...il.com, byungchul.park@....com, tglx@...utronix.de
Subject: [tip:locking/core] acpi/nfit: Fix COMPLETION_INITIALIZER_ONSTACK()
 abuse

Commit-ID:  1c322ac06d9af7ea259098ae5dc977855207d335
Gitweb:     http://git.kernel.org/tip/1c322ac06d9af7ea259098ae5dc977855207d335
Author:     Boqun Feng <boqun.feng@...il.com>
AuthorDate: Thu, 24 Aug 2017 22:22:36 +0800
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Tue, 29 Aug 2017 15:14:38 +0200

acpi/nfit: Fix COMPLETION_INITIALIZER_ONSTACK() abuse

COMPLETION_INITIALIZER_ONSTACK() is supposed to be used as an initializer,
in other words, it should only be used in assignment expressions or
compound literals. So the usage in drivers/acpi/nfit/core.c:

	COMPLETION_INITIALIZER_ONSTACK(flush.cmp);

... is inappropriate.

Besides, this usage could also break the build for another fix that
reduces stack sizes caused by COMPLETION_INITIALIZER_ONSTACK(), because
that fix changes COMPLETION_INITIALIZER_ONSTACK() from rvalue to lvalue,
and usage as above will report the following error:

	drivers/acpi/nfit/core.c: In function 'acpi_nfit_flush_probe':
	include/linux/completion.h:77:3: error: value computed is not used [-Werror=unused-value]
	  (*({ init_completion(&work); &work; }))

This patch fixes this by replacing COMPLETION_INITIALIZER_ONSTACK()
with init_completion() in acpi_nfit_flush_probe(), which does the
same initialization without any other problems.

Signed-off-by: Boqun Feng <boqun.feng@...il.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Acked-by: Dan Williams <dan.j.williams@...el.com>
Acked-by: Arnd Bergmann <arnd@...db.de>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Byungchul Park <byungchul.park@....com>
Cc: Len Brown <lenb@...nel.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Nicholas Piggin <npiggin@...il.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Rafael J. Wysocki <rjw@...ysocki.net>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: walken@...gle.com
Cc: willy@...radead.org
Link: http://lkml.kernel.org/r/20170824142239.15178-1-boqun.feng@gmail.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 drivers/acpi/nfit/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 19182d0..1893e41 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -2884,7 +2884,7 @@ static int acpi_nfit_flush_probe(struct nvdimm_bus_descriptor *nd_desc)
 	 * need to be interruptible while waiting.
 	 */
 	INIT_WORK_ONSTACK(&flush.work, flush_probe);
-	COMPLETION_INITIALIZER_ONSTACK(flush.cmp);
+	init_completion(&flush.cmp);
 	queue_work(nfit_wq, &flush.work);
 	mutex_unlock(&acpi_desc->init_mutex);
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ