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: <200705310913.45234.rjw@sisk.pl>
Date:	Thu, 31 May 2007 09:13:44 +0200
From:	"Rafael J. Wysocki" <rjw@...k.pl>
To:	Herbert Xu <herbert@...dor.apana.org.au>
Cc:	Maximilian Engelhardt <maxi@...monizer.de>,
	nigel@...el.suspend2.net,
	linux-kernel <linux-kernel@...r.kernel.org>,
	Pavel Machek <pavel@....cz>,
	"Eric W. Biederman" <ebiederm@...ssion.com>
Subject: Re: software suspend doesn't work with 2.6.22-rc3

On Thursday, 31 May 2007 09:04, Rafael J. Wysocki wrote:
> On Thursday, 31 May 2007 08:54, Rafael J. Wysocki wrote:
> > On Tuesday, 29 May 2007 02:39, Herbert Xu wrote:
> > > On Mon, May 28, 2007 at 08:21:29PM +0200, Rafael J. Wysocki wrote:
> > > >
> > > > Well, it looks like we have to fix this one separately.
> > > > 
> > > > Can you please tell me what to do to make cryptd run?
> > > 
> > > If you build it as a module then just loading it should be sufficient.
> > > If you have it built-in then it should always be there.
> > > 
> > > Let me know when you guys have a final patch.
> > 
> > The problem is more serious than I thought:
> > 
> > kthread_create() in crypto/cryptd.c line 302 doesn't return, so cryptd is stuck
> > in TASK_UNINTERRUPTIBLE all the time and it doesn't even execute one
> > instruction from cryptd_thread() [this happens on x86_64].
> 
> Sorry, I was wrong.
> 
> kthread_create() returns, but cryptd_thread() is not executed and the cryptd
> process is stuck in TASK_UNINTERRUPTIBLE.

It can be fixed by replacing the kthread_create() with kthread_run().  Patch
follows.

Greetings,
Rafael

---
From: Rafael J. Wysocki <rjw@...k.pl>

Make cryptd actually run and mark it as nonfreezable.

Signed-off-by: Rafael J. Wysocki <rjw@...k.pl>
---
 crypto/cryptd.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux-2.6.22-rc3/crypto/cryptd.c
===================================================================
--- linux-2.6.22-rc3.orig/crypto/cryptd.c	2007-05-26 22:08:07.000000000 +0200
+++ linux-2.6.22-rc3/crypto/cryptd.c	2007-05-31 09:13:38.000000000 +0200
@@ -298,7 +298,7 @@ static inline int cryptd_create_thread(s
 	mutex_init(&state->mutex);
 	crypto_init_queue(&state->queue, CRYPTD_MAX_QLEN);
 
-	state->task = kthread_create(fn, state, name);
+	state->task = kthread_run(fn, state, name);
 	if (IS_ERR(state->task))
 		return PTR_ERR(state->task);
 
@@ -316,6 +316,8 @@ static int cryptd_thread(void *data)
 	struct cryptd_state *state = data;
 	int stop;
 
+	current->flags |= PF_NOFREEZE;
+
 	do {
 		struct crypto_async_request *req, *backlog;
 
-
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