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: <20161026141834.GB6893@redhat.com>
Date:   Wed, 26 Oct 2016 16:18:35 +0200
From:   Oleg Nesterov <oleg@...hat.com>
To:     Roman Pen <roman.penyaev@...fitbricks.com>
Cc:     Andy Lutomirski <luto@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Tejun Heo <tj@...nel.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 1/1] workqueue: ignore dead tasks in a workqueue sleep
 hook

On 10/25, Roman Pen wrote:
>
>  void wq_worker_waking_up(struct task_struct *task, int cpu)
>  {
> -	struct worker *worker = kthread_data(task);
> +	struct worker *worker;
> +
> +	if (task->flags & PF_EXITING) {
> +		/*
> +		 * Careful here, t->vfork_done is zeroed out for
> +		 * almost dead tasks, do not touch kthread_data().
> +		 */
> +		return;
> +	}
> +
> +	worker = kthread_data(task);
>  
>  	if (!(worker->flags & WORKER_NOT_RUNNING)) {
>  		WARN_ON_ONCE(worker->pool->cpu != cpu);
> @@ -875,9 +885,19 @@ void wq_worker_waking_up(struct task_struct *task, int cpu)
>   */
>  struct task_struct *wq_worker_sleeping(struct task_struct *task)
>  {
> -	struct worker *worker = kthread_data(task), *to_wakeup = NULL;
> +	struct worker *worker, *to_wakeup = NULL;
>  	struct worker_pool *pool;
>  
> +	if (task->flags & PF_EXITING) {
> +		/*
> +		 * Careful here, t->vfork_done is zeroed out for
> +		 * almost dead tasks, do not touch kthread_data().
> +		 */
> +		return NULL;
> +	}
> +
> +	worker = kthread_data(task);
> +

Please see the patch I send a minute ago. With that patch we do not need
this fix, kthread_data() no longer uses ->vfork_done.

Oleg.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ