login
Header Space

 
 

[GIT PATCH] driver core fixes against 2.6.26-rc3

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linus Torvalds <torvalds@...>, Andrew Morton <akpm@...>
Cc: <linux-kernel@...>
Date: Tuesday, May 20, 2008 - 6:32 pm

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
instances.

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:
	master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6.git/

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

thanks,

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

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[GIT PATCH] driver core fixes against 2.6.26-rc3, Greg KH, (Tue May 20, 6:32 pm)
[PATCH 13/13] SCSI: fix race in device_create, Greg Kroah-Hartman, (Tue May 20, 6:35 pm)
[PATCH 12/13] USB: Core: fix race in device_create, Greg Kroah-Hartman, (Tue May 20, 6:34 pm)
[PATCH 11/13] USB: Phidget: fix race in device_create, Greg Kroah-Hartman, (Tue May 20, 6:34 pm)
[PATCH 10/13] s390: fix race in device_create, Greg Kroah-Hartman, (Tue May 20, 6:34 pm)
[PATCH 09/13] SOUND: fix race in device_create, Greg Kroah-Hartman, (Tue May 20, 6:34 pm)
[PATCH 08/13] UIO: fix race in device_create, Greg Kroah-Hartman, (Tue May 20, 6:34 pm)
[PATCH 07/13] Power Supply: fix race in device_create, Greg Kroah-Hartman, (Tue May 20, 6:34 pm)
[PATCH 06/13] LEDS: fix race in device_create, Greg Kroah-Hartman, (Tue May 20, 6:34 pm)
[PATCH 05/13] IB: fix race in device_create, Greg Kroah-Hartman, (Tue May 20, 6:34 pm)
[PATCH 03/13] fbdev: fix race in device_create, Greg Kroah-Hartman, (Tue May 20, 6:34 pm)
[PATCH 04/13] ide: fix race in device_create, Greg Kroah-Hartman, (Tue May 20, 6:34 pm)
[PATCH 02/13] mm: bdi: fix race in bdi_class device creation, Greg Kroah-Hartman, (Tue May 20, 6:34 pm)
[PATCH 01/13] Driver core: add device_create_vargs and devic..., Greg Kroah-Hartman, (Tue May 20, 6:34 pm)
speck-geostationary