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: <alpine.LNX.2.00.1510301441210.17538@pobox.suse.cz>
Date:	Fri, 30 Oct 2015 14:48:07 +0100 (CET)
From:	Jiri Kosina <jikos@...nel.org>
To:	"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
	Dave Chinner <david@...morbit.com>, Jan Kara <jack@...e.cz>,
	Christoph Hellwig <hch@....de>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Al Viro <viro@...IV.linux.org.uk>, Tejun Heo <tj@...nel.org>,
	Pavel Machek <pavel@....cz>
cc:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	linux-pm@...r.kernel.org
Subject: [PATCH 3/3] freezer: warn if anyone is trying to use freezer on
 kthreads

From: Jiri Kosina <jkosina@...e.cz>

kthread freezing has been deprecated in favor of fs freezing. Issue
a warning if anyone attempts to still use this API.

Signed-off-by: Jiri Kosina <jkosina@...e.cz>
---
 include/linux/freezer.h | 2 ++
 kernel/freezer.c        | 1 +
 2 files changed, 3 insertions(+)

diff --git a/include/linux/freezer.h b/include/linux/freezer.h
index 81335f6..c0bc520 100644
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -59,6 +59,8 @@ static inline bool try_to_freeze_unsafe(void)
 
 static inline bool try_to_freeze(void)
 {
+	WARN_ON(current->flags & PF_KTHREAD);
+
 	if (!(current->flags & PF_NOFREEZE))
 		debug_check_no_locks_held();
 	return try_to_freeze_unsafe();
diff --git a/kernel/freezer.c b/kernel/freezer.c
index a8900a3..fe2afb9 100644
--- a/kernel/freezer.c
+++ b/kernel/freezer.c
@@ -164,6 +164,7 @@ void __thaw_task(struct task_struct *p)
 bool set_freezable(void)
 {
 	might_sleep();
+	WARN_ON(current->flags & PF_KTHREAD);
 
 	/*
 	 * Modify flags while holding freezer_lock.  This ensures the
-- 
1.9.2
--
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