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: <20100228160005.GA16144@redhat.com>
Date:	Sun, 28 Feb 2010 17:00:05 +0100
From:	Oleg Nesterov <oleg@...hat.com>
To:	Tejun Heo <tj@...nel.org>
Cc:	torvalds@...ux-foundation.org, mingo@...e.hu, peterz@...radead.org,
	awalls@...ix.net, linux-kernel@...r.kernel.org, jeff@...zik.org,
	akpm@...ux-foundation.org, jens.axboe@...cle.com,
	rusty@...tcorp.com.au, cl@...ux-foundation.org,
	dhowells@...hat.com, arjan@...ux.intel.com, avi@...hat.com,
	johannes@...solutions.net, andi@...stfloor.org
Subject: Re: [PATCH 16/43] workqueue: kill cpu_populated_map

On 02/26, Tejun Heo wrote:
>
> @@ -1023,41 +991,40 @@ struct workqueue_struct *__create_workqueue_key(const char *name,
> ...
> +	cpu_maps_update_done();
> ...
> +
> +	spin_lock(&workqueue_lock);
> +	list_add(&wq->list, &workqueues);
> +	spin_unlock(&workqueue_lock);

OK, but if cpu_up() happens right after we drop cpu_maps_update_done(),
cwq->thread on the new CPU will run unbound?

> @@ -1127,47 +1091,30 @@ static int __devinit workqueue_cpu_callback(struct notifier_block *nfb,
> ...
>  	list_for_each_entry(wq, &workqueues, list) {

this becomes unsafe. create/destroy can modify workqueues list
in parallel.

>  		case CPU_ONLINE:
> -			start_workqueue_thread(cwq, cpu);
> +			__set_cpus_allowed(cwq->thread, get_cpu_mask(cpu),
> +					   true);

if the thread doesn't have PF_THREAD_BOUND, who will set it?

>  		case CPU_POST_DEAD:
> -			cleanup_workqueue_thread(cwq);
> +			lock_map_acquire(&cwq->wq->lockdep_map);
> +			lock_map_release(&cwq->wq->lockdep_map);
> +			flush_cpu_workqueue(cwq);

This can race with destroy_workqueue(), no?



I guess this patch is preparation, probably these problems should
go away later...

Oleg.

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