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]
Date:	Wed, 19 Oct 2011 10:49:52 -0700
From:	Tejun Heo <tj@...nel.org>
To:	Vivek Goyal <vgoyal@...hat.com>
Cc:	axboe@...nel.dk, linux-kernel@...r.kernel.org, ctalbott@...gle.com
Subject: Re: [PATCH 07/10] block: reorganize throtl_get_tg() and
 blk_throtl_bio()

Hello,

On Wed, Oct 19, 2011 at 01:45:56PM -0400, Vivek Goyal wrote:
> > Hmmmm, yeah, right, switching itself would be racy.  Maybe not sharing
> > is the solution, I don't know.  There's a way to make the switching
> > safe tho.  Sth like the following.
> > 
> > 	lock_queue(q, flags)
> > 	{
> > 		spinlock_t *lock;
> > 
> > 		local_irq_save(flags);
> > 		lock = rcu_dereference_sched(q->queue_lock);
> > 		spin_lock(lock);
> > 	}
> > 
> > and on cleanup, do synchronize_sched() after lock switching.  But yeah
> > it still stinks.
> 
> rcu protected spinlocks. Interesting. :-)

:)

> IIUC, it still leaves the window open that two callers think they have
> the spinlock. One is holding the driver provided lock and other is holding
> the queue private lock.

On blk_cleanup_queue() completion, the two are disjoint, so that
shouldn't be a problem.  Block layer won't call into low level drivers
and low level drivers aren't supposed to call into block layer either.

Thanks.

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