public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: [GIT PATCH] driver core fixes against 2.6.26-rc3
Date: Tue, 20 May 2008 15:32:37 -0700	[thread overview]
Message-ID: <20080520223237.GA12383@suse.de> (raw)

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


             reply	other threads:[~2008-05-20 22:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-20 22:32 Greg KH [this message]
2008-05-20 22:34 ` [PATCH 01/13] Driver core: add device_create_vargs and device_create_drvdata Greg Kroah-Hartman
2008-05-20 22:34 ` [PATCH 02/13] mm: bdi: fix race in bdi_class device creation Greg Kroah-Hartman
2008-05-20 22:34 ` [PATCH 03/13] fbdev: fix race in device_create Greg Kroah-Hartman
2008-05-20 22:34 ` [PATCH 04/13] ide: " Greg Kroah-Hartman
2008-05-20 22:34 ` [PATCH 05/13] IB: " Greg Kroah-Hartman
2008-05-20 22:34 ` [PATCH 06/13] LEDS: " Greg Kroah-Hartman
2008-05-20 22:34 ` [PATCH 07/13] Power Supply: " Greg Kroah-Hartman
2008-05-20 22:34 ` [PATCH 08/13] UIO: " Greg Kroah-Hartman
2008-05-20 22:34 ` [PATCH 09/13] SOUND: " Greg Kroah-Hartman
2008-05-20 22:34 ` [PATCH 10/13] s390: " Greg Kroah-Hartman
2008-05-20 22:34 ` [PATCH 11/13] USB: Phidget: " Greg Kroah-Hartman
2008-05-20 22:34 ` [PATCH 12/13] USB: Core: " Greg Kroah-Hartman
2008-05-20 22:35 ` [PATCH 13/13] SCSI: " Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080520223237.GA12383@suse.de \
    --to=gregkh@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox