[GIT PATCH] driver core fixes against 2.6.26-rc3

From: Greg KH
Date: Tue May 20 2008 - 18:33:43 EST

Here are some patches against your 2.6.26-rc3-git tree.

They fix a race condition when device_create is called. At that point
in time sysfs files can be created automatically by the class or the
driver subsystem, and if those files are opened before the device
specific data is set, oopses can happen. This was found and reported
for the bdi subsystem by Arthur Jones and he verified that these patches
fix the problem.

I then went and audited all users of the api and found other places
where this was also a problem. This patch series fixes all of those

The API will be chaned in 2.6.27 so this can not happen in the future by
making device_create() look exactly like device_create_drvdata() but to
do that now would require a few hundred other changes through the tree.
I'll leave that for .27 and have patches queued up right now in -next
for this so it gets good testing.

These patches have been in -mm and -next.

Please pull from:

The patchs will be sent as a follow-on to this message to lkml for
people to see.


greg k-h


drivers/base/core.c | 85 +++++++++++++++++++++++++++++--
drivers/ide/ide-probe.c | 5 +-
drivers/infiniband/core/user_mad.c | 14 ++---
drivers/infiniband/core/uverbs_main.c | 11 ++--
drivers/leds/led-class.c | 6 +--
drivers/power/power_supply_core.c | 6 +--
drivers/s390/char/vmlogrdr.c | 9 ++--
drivers/scsi/ch.c | 7 +--
drivers/scsi/osst.c | 3 +-
drivers/scsi/sg.c | 11 ++--
drivers/scsi/st.c | 12 +++--
drivers/uio/uio.c | 7 +--
drivers/usb/core/hcd.c | 6 +-
drivers/usb/misc/phidgetkit.c | 6 +-
drivers/usb/misc/phidgetmotorcontrol.c | 7 +--
drivers/usb/misc/phidgetservo.c | 6 +-
drivers/video/display/display-sysfs.c | 10 +++-
include/linux/device.h | 12 +++++
mm/backing-dev.c | 12 +----
sound/core/sound.c | 8 +--
20 files changed, 157 insertions(+), 86 deletions(-)


Greg Kroah-Hartman (13):
Driver core: add device_create_vargs and device_create_drvdata
mm: bdi: fix race in bdi_class device creation
fbdev: fix race in device_create
ide: fix race in device_create
IB: fix race in device_create
LEDS: fix race in device_create
Power Supply: fix race in device_create
UIO: fix race in device_create
SOUND: fix race in device_create
s390: fix race in device_create
USB: Phidget: fix race in device_create
USB: Core: fix race in device_create
SCSI: fix race in device_create

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/