1. 21 5月, 2008 16 次提交
    • G
      USB: Core: fix race in device_create · c013d040
      Greg Kroah-Hartman 提交于
      There is a race from when a device is created with device_create() and
      then the drvdata is set with a call to dev_set_drvdata() in which a
      sysfs file could be open, yet the drvdata will be NULL, causing all
      sorts of bad things to happen.
      
      This patch fixes the problem by using the new function,
      device_create_drvdata().
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c013d040
    • G
      USB: Phidget: fix race in device_create · bfd3a5a9
      Greg Kroah-Hartman 提交于
      There is a race from when a device is created with device_create() and
      then the drvdata is set with a call to dev_set_drvdata() in which a
      sysfs file could be open, yet the drvdata will be NULL, causing all
      sorts of bad things to happen.
      
      This patch fixes the problem by using the new function,
      device_create_drvdata().  It fixes all 3 phidget drivers, which all have
      the same problem.
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Cc: Sean Young <sean@mess.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      bfd3a5a9
    • G
      s390: fix race in device_create · c5fb920a
      Greg Kroah-Hartman 提交于
      There is a race from when a device is created with device_create() and
      then the drvdata is set with a call to dev_set_drvdata() in which a
      sysfs file could be open, yet the drvdata will be NULL, causing all
      sorts of bad things to happen.
      
      This patch fixes the problem by using the new function,
      device_create_drvdata().
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c5fb920a
    • G
      SOUND: fix race in device_create · 5d99a8b8
      Greg Kroah-Hartman 提交于
      There is a race from when a device is created with device_create() and
      then the drvdata is set with a call to dev_set_drvdata() in which a
      sysfs file could be open, yet the drvdata will be NULL, causing all
      sorts of bad things to happen.
      
      This patch fixes the problem by using the new function,
      device_create_drvdata().
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      5d99a8b8
    • G
      UIO: fix race in device_create · 43691da4
      Greg Kroah-Hartman 提交于
      There is a race from when a device is created with device_create() and
      then the drvdata is set with a call to dev_set_drvdata() in which a
      sysfs file could be open, yet the drvdata will be NULL, causing all
      sorts of bad things to happen.
      
      This patch fixes the problem by using the new function,
      device_create_drvdata().
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Cc: Hans J. Koch <hjk@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      43691da4
    • G
      Power Supply: fix race in device_create · 54d29ad3
      Greg Kroah-Hartman 提交于
      There is a race from when a device is created with device_create() and
      then the drvdata is set with a call to dev_set_drvdata() in which a
      sysfs file could be open, yet the drvdata will be NULL, causing all
      sorts of bad things to happen.
      
      This patch fixes the problem by using the new function,
      device_create_drvdata().
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Cc: Anton Vorontsov <cbou@mail.ru>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      54d29ad3
    • G
      LEDS: fix race in device_create · 0b00fc58
      Greg Kroah-Hartman 提交于
      There is a race from when a device is created with device_create() and
      then the drvdata is set with a call to dev_set_drvdata() in which a
      sysfs file could be open, yet the drvdata will be NULL, causing all
      sorts of bad things to happen.
      
      This patch fixes the problem by using the new function,
      device_create_drvdata().
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0b00fc58
    • G
      IB: fix race in device_create · 6c06aec2
      Greg Kroah-Hartman 提交于
      There is a race from when a device is created with device_create() and
      then the drvdata is set with a call to dev_set_drvdata() in which a
      sysfs file could be open, yet the drvdata will be NULL, causing all
      sorts of bad things to happen.
      
      This patch fixes the problem by using the new function,
      device_create_drvdata().
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Reviewed-by: NRoland Dreier <rolandd@cisco.com>
      Cc: Sean Hefty <sean.hefty@intel.com>
      Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6c06aec2
    • G
      ide: fix race in device_create · 716ad875
      Greg Kroah-Hartman 提交于
      There is a race from when a device is created with device_create() and
      then the drvdata is set with a call to dev_set_drvdata() in which a
      sysfs file could be open, yet the drvdata will be NULL, causing all
      sorts of bad things to happen.
      
      This patch fixes the problem by using the new function,
      device_create_drvdata().
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Acked-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      716ad875
    • G
      fbdev: fix race in device_create · 8b485877
      Greg Kroah-Hartman 提交于
      There is a race from when a device is created with device_create() and
      then the drvdata is set with a call to dev_set_drvdata() in which a
      sysfs file could be open, yet the drvdata will be NULL, causing all
      sorts of bad things to happen.
      
      This patch fixes the problem by using the new function,
      device_create_drvdata().
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Cc: James Simmons <jsimmons@infradead.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8b485877
    • G
      mm: bdi: fix race in bdi_class device creation · 19051c50
      Greg Kroah-Hartman 提交于
      There is a race from when a device is created with device_create() and
      then the drvdata is set with a call to dev_set_drvdata() in which a
      sysfs file could be open, yet the drvdata will be NULL, causing all
      sorts of bad things to happen.
      
      This patch fixes the problem by using the new function,
      device_create_vargs().
      
      Many thanks to Arthur Jones <ajones@riverbed.com> for reporting the bug,
      and testing patches out.
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Cc: Arthur Jones <ajones@riverbed.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Miklos Szeredi <mszeredi@suse.cz>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      19051c50
    • G
      Driver core: add device_create_vargs and device_create_drvdata · 8882b394
      Greg Kroah-Hartman 提交于
      We want to have the drvdata field set properly when creating the device
      as sysfs callbacks can assume it is present and it can race the later
      setting of this field.
      
      So, create two new functions, deviec_create_vargs() and
      device_create_drvdata() that take this new field.
      
      device_create_drvdata() will go away in 2.6.27 as the drvdata field will
      just be moved to the device_create() call as it should be.
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8882b394
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 · c110a2bd
      Linus Torvalds 提交于
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
        firewire: prevent userspace from accessing shut down devices
        ieee1394: sbp2: use correct size of command descriptor block
      c110a2bd
    • A
      Fix a deadlock in the bttv driver · 81b2dbca
      Arjan van de Ven 提交于
      vidiocgmbuf() does this:
              mutex_lock(&fh->cap.vb_lock);
              retval = videobuf_mmap_setup(&fh->cap, gbuffers, gbufsize,
                                           V4L2_MEMORY_MMAP);
      
      and videobuf_mmap_setup() then just does
              mutex_lock(&q->vb_lock);
              ret = __videobuf_mmap_setup(q, bcount, bsize, memory);
              mutex_unlock(&q->vb_lock);
      
      which is an obvious double-take deadlock.
      
      This patch fixes this by having vidiocgmbuf() just call the
      __videobuf_mmap_setup function instead.
      Acked-by: NMauro Carvalho Chehab <mchehab@infradead.org>
      Reported-by: NKoos Vriezen <koos.vriezen@gmail.com>
      Signed-off-by: NArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      81b2dbca
    • J
      firewire: prevent userspace from accessing shut down devices · 551f4cb9
      Jay Fenlason 提交于
      If userspace ignores the POLLERR bit from poll(), and only attempts to
      read() the device when POLLIN is set, it can still make ioctl() calls on
      a device that has been removed from the system.  The node_id and
      generation returned by GET_INFO will be outdated, but INITIATE_BUS_RESET
      would still cause a bus reset, and GET_CYCLE_TIMER will return data.
      And if you guess the correct generation to use, you can send requests to
      a different device on the bus, and get responses back.
      
      This patch prevents open, ioctl, compat_ioctl, and mmap against shutdown
      devices.
      Signed-off-by: NJay Fenlason <fenlason@redhat.com>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      551f4cb9
    • S
      ieee1394: sbp2: use correct size of command descriptor block · 93c596f7
      Stefan Richter 提交于
      Boaz Harrosh wrote:
      > cmd->cmd_len is now guarantied to be set properly at all cases.
      > And some commands you want to support will not be set correctly
      > by COMMAND_SIZE().
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      93c596f7
  2. 20 5月, 2008 24 次提交