Re: [PATCH][2.6.0-test5] fix oopses is kobject parent is removed before child

From: Greg KH
Date: Tue Sep 16 2003 - 12:57:54 EST


On Sun, Sep 14, 2003 at 05:37:04PM +0400, Andrey Borzenkov wrote:
> It is possible that parent is removed before child when child is in use.
> Trivial example is mounted USB storage when you unplug it. The kobject for
> USB device is removed but subordinate SCSI device remains. Then kernel oopses
> on attempt to release child e.g. umount removed USB storage. This patch fixes
> two problems:
>
> - kset_hotplug. It oopses in get_kobj_path_length because child->parent points
> to nowhere - even if parent has not yet been overwritten, its name is already
> freed. Common oops I get is

No, the scsi code should be fixed to prevent this from happening. This
used to happen in the past, but I thought the scsi people fixed it up.
The SCSI code should grab a reference on the parent device which will
prevent it from going away until the SCSI device does, preventing all of
these oopes.

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/