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: <20130619155218.GA14881@htj.dyndns.org>
Date:	Wed, 19 Jun 2013 08:52:18 -0700
From:	Tejun Heo <tj@...nel.org>
To:	Chen Gang <gang.chen@...anux.com>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	Oleg Nesterov <oleg@...hat.com>, laijs@...fujitsu.com,
	Andrew Morton <akpm@...ux-foundation.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] kernel/kthread.c: need spin_lock_irq() for 'worker'
 before main looping,  since it can "WARN_ON(worker->task)".

On Wed, Jun 19, 2013 at 06:17:36PM +0800, Chen Gang wrote:
> Hmm... can 'worker->task' has chance to be not NULL before set 'current'
> to it ?

Yes, if the caller screws up and try to attach more than one workers
to the kthread_worker, which has some possibility of happening as
kthread_worker allows both attaching and detaching a worker.

> why do we use WARN_ON(worker->task) ?

To detect bugs on the caller side.

> I guess it still has chance to let "worker->task != NULL", or it should
> be BUG_ON(worker->task) instead of.

What difference does that make?

-- 
tejun
--
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