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] [day] [month] [year] [list]
Message-ID: <20150414094315.GJ23327@quack.suse.cz>
Date:	Tue, 14 Apr 2015 11:43:15 +0200
From:	Jan Kara <jack@...e.cz>
To:	Dmitry Monakhov <dmonakhov@...nvz.org>
Cc:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	axboe@...nel.dk, viro@...iv.linux.org.uk, dm-devel@...hat.com
Subject: Re: [PATCH 5/7] md: use block_device name vsprintf helper

On Mon 13-04-15 16:31:38, Dmitry Monakhov wrote:
> 
> Signed-off-by: Dmitry Monakhov <dmonakhov@...nvz.org>
...
> @@ -2610,7 +2597,6 @@ static void handle_read_error(struct mddev *mddev, struct r10bio *r10_bio)
>  	struct bio *bio;
>  	struct r10conf *conf = mddev->private;
>  	struct md_rdev *rdev = r10_bio->devs[slot].rdev;
> -	char b[BDEVNAME_SIZE];
>  	unsigned long do_sync;
>  	int max_sectors;
>  
> @@ -2623,7 +2609,6 @@ static void handle_read_error(struct mddev *mddev, struct r10bio *r10_bio)
>  	 * frozen.
>  	 */
>  	bio = r10_bio->devs[slot].bio;
> -	bdevname(bio->bi_bdev, b);
>  	bio_put(bio);
>  	r10_bio->devs[slot].bio = NULL;
>  
> @@ -2639,9 +2624,9 @@ static void handle_read_error(struct mddev *mddev, struct r10bio *r10_bio)
>  read_more:
>  	rdev = read_balance(conf, r10_bio, &max_sectors);
>  	if (rdev == NULL) {
> -		printk(KERN_ALERT "md/raid10:%s: %s: unrecoverable I/O"
> +		printk(KERN_ALERT "md/raid10:%s: %pg: unrecoverable I/O"
>  		       " read error for block %llu\n",
> -		       mdname(mddev), b,
> +		       mdname(mddev), bio->bi_bdev,
>  		       (unsigned long long)r10_bio->sector);
>  		raid_end_bio_io(r10_bio);
>  		return;
  So it seems to me that in the above, you'll reference bio->bi_bdev of an
already free bio since the code does bio_put() just after calling
bdevname()...

								Honza
-- 
Jan Kara <jack@...e.cz>
SUSE Labs, CR
--
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