Skip to content

Commit

Permalink
md: fix use after free when removing rdev via sysfs
Browse files Browse the repository at this point in the history
rdev->mddev is no longer valid upon return from entry->store() when the
'remove' command is given.

Cc: <stable@kernel.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Dan Williams authored and Linus Torvalds committed Apr 30, 2008
1 parent 7f1133c commit 6a51830
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -2097,7 +2097,7 @@ rdev_attr_store(struct kobject *kobj, struct attribute *attr,
rv = -EBUSY;
else
rv = entry->store(rdev, page, length);
mddev_unlock(rdev->mddev);
mddev_unlock(mddev);
}
return rv;
}
Expand Down

0 comments on commit 6a51830

Please sign in to comment.