Linux RAID subsystem development
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: akpm@linux-foundation.org
Cc: m.hampel@gmx.de, linux-raid@vger.kernel.org
Subject: Re: + md-raid10-fix-use-after-free-of-bio.patch added to -mm tree
Date: Mon, 30 Jul 2007 17:34:02 +1000	[thread overview]
Message-ID: <18093.37994.408428.500569@notabene.brown> (raw)
In-Reply-To: message from akpm@linux-foundation.org on Saturday July 28

On Saturday July 28, akpm@linux-foundation.org wrote:
> 
> The patch titled
>      md: raid10: fix use-after-free of bio
> has been added to the -mm tree.  Its filename is
>      md-raid10-fix-use-after-free-of-bio.patch
> 
> *** Remember to use Documentation/SubmitChecklist when testing your code ***
> 
> See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
> out what to do about this
> 
> ------------------------------------------------------
> Subject: md: raid10: fix use-after-free of bio
> From: Maik Hampel <m.hampel@gmx.de>
> 
> In case of read errors raid10d tries to print a nice error message,
> unfortunately using data from an already put bio.
> 

Thanks for catching that Maik!

> 
> diff -puN drivers/md/raid10.c~md-raid10-fix-use-after-free-of-bio drivers/md/raid10.c
> --- a/drivers/md/raid10.c~md-raid10-fix-use-after-free-of-bio
> +++ a/drivers/md/raid10.c
> @@ -1534,7 +1534,6 @@ static void raid10d(mddev_t *mddev)
>  			bio = r10_bio->devs[r10_bio->read_slot].bio;
>  			r10_bio->devs[r10_bio->read_slot].bio =
>  				mddev->ro ? IO_BLOCKED : NULL;
> -			bio_put(bio);
>  			mirror = read_balance(conf, r10_bio);
>  			if (mirror == -1) {
>  				printk(KERN_ALERT "raid10: %s: unrecoverable I/O"
> @@ -1542,8 +1541,10 @@ static void raid10d(mddev_t *mddev)
>  				       bdevname(bio->bi_bdev,b),
>  				       (unsigned long long)r10_bio->sector);
>  				raid_end_bio_io(r10_bio);
> +				bio_put(bio);

and for catching that Andrew!

Acked-By: NeilBrown <neilb@suse.de>


>  			} else {
>  				const int do_sync = bio_sync(r10_bio->master_bio);
> +				bio_put(bio);
>  				rdev = conf->mirrors[mirror].rdev;
>  				if (printk_ratelimit())
>  					printk(KERN_ERR "raid10: %s: redirecting sector %llu to"
> _
> 
> Patches currently in -mm which might be from m.hampel@gmx.de are
> 
> md-raid10-fix-use-after-free-of-bio.patch

           reply	other threads:[~2007-07-30  7:34 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <200707290655.l6T6tOfA012547@imap1.linux-foundation.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18093.37994.408428.500569@notabene.brown \
    --to=neilb@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=m.hampel@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox