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: <20101014233041.GJ2447@linux.vnet.ibm.com>
Date:	Thu, 14 Oct 2010 16:30:41 -0700
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Jens Axboe <axboe@...nel.dk>
Cc:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] blk: fix a wrong accounting of hd_struct->in_flight

On Thu, Oct 14, 2010 at 02:44:32PM +0200, Jens Axboe wrote:
> On 2010-10-14 08:07, KOSAKI Motohiro wrote:
> >> @@ -1268,7 +1270,17 @@ static int __make_request(struct request
> >>  		 * not touch req->buffer either...
> >>  		 */
> >>  		req->buffer = bio_data(bio);
> >> +		src_part = disk_map_sector_rcu(req->rq_disk, blk_rq_pos(req));
> >>  		req->__sector = bio->bi_sector;
> >> +		dst_part = disk_map_sector_rcu(req->rq_disk, blk_rq_pos(req));
> > 
> > I think this is wrong. disk_map_sector_rcu() require
> > rcu read lock held (see function comment). all other call site take 
> > part_stat_lock() before disk_map_sector_rcu() call.
> 
> It's called under the queue lock with irqs disabled, which implies a
> rcu critical section.

Having irqs disabled does imply an rcu_read_lock_sched() or an
rcu_read_lock_bh(), but not an rcu_read_lock(), especially if
CONFIG_PREEMPT_RCU.

So an explicit rcu_read_lock() does seem to be needed here.

							Thanx, Paul
--
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