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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed,  1 Apr 2020 14:52:15 +0800
From:   liyueyi <liyueyi@...e.com>
To:     peterz@...radead.org, gregkh@...uxfoundation.org
Cc:     linux-kernel@...r.kernel.org, liyueyi <liyueyi@...omi.com>
Subject: [PATCH] kthread: set kthread state to TASK_IDLE.

From: liyueyi <liyueyi@...omi.com>

Currently kthread() sleeps in TASK_UNINTERRUPTIBLE state waiting
for the first wakeup, it may be detected by DETECT_HUNG_TASK if
the first wakeup is coming later. Since kernel has introduced
TASK_IDLE, change kthread state to TASK_IDLE.

Signed-off-by: liyueyi <liyueyi@...omi.com>
---
 kernel/kthread.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/kthread.c b/kernel/kthread.c
index b262f470..f841419 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -243,7 +243,7 @@ static int kthread(void *_create)
 	current->vfork_done = &self->exited;
 
 	/* OK, tell user we're spawned, wait for stop or wakeup */
-	__set_current_state(TASK_UNINTERRUPTIBLE);
+	__set_current_state(TASK_IDLE);
 	create->result = current;
 	complete(done);
 	schedule();
@@ -415,7 +415,7 @@ static void __kthread_bind(struct task_struct *p, unsigned int cpu, long state)
 
 void kthread_bind_mask(struct task_struct *p, const struct cpumask *mask)
 {
-	__kthread_bind_mask(p, mask, TASK_UNINTERRUPTIBLE);
+	__kthread_bind_mask(p, mask, TASK_IDLE);
 }
 
 /**
@@ -429,7 +429,7 @@ void kthread_bind_mask(struct task_struct *p, const struct cpumask *mask)
  */
 void kthread_bind(struct task_struct *p, unsigned int cpu)
 {
-	__kthread_bind(p, cpu, TASK_UNINTERRUPTIBLE);
+	__kthread_bind(p, cpu, TASK_IDLE);
 }
 EXPORT_SYMBOL(kthread_bind);
 
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ