From: Dan Williams Date: Wed, 30 Apr 2008 18:55:30 +0000 (+0000) Subject: md: fix use after free when removing rdev via sysfs X-Git-Tag: v2.6.25.3~16 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9bd2c7ca75b0ebe05b0c67852d050720119983e7;p=karo-tx-linux.git md: fix use after free when removing rdev via sysfs commit: 6a51830e14529063cb2685921e1177d9af50e49a upstream rdev->mddev is no longer valid upon return from entry->store() when the 'remove' command is given. Signed-off-by: Dan Williams Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/md/md.c b/drivers/md/md.c index 61ccbd2683fa..9f6d228b5607 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -2096,7 +2096,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; }