1. 18 8月, 2013 1 次提交
    • R
      ACPI / hotplug / PCI: Fix NULL pointer dereference in cleanup_bridge() · 1aaac071
      Rafael J. Wysocki 提交于
      After commit bbd34fcd (ACPI / hotplug / PCI: Register all devices
      under the given bridge) register_slot() is called for all PCI
      devices under a given bridge that have corresponding objects in
      the ACPI namespace, but it calls acpiphp_register_hotplug_slot()
      only for devices satisfying specific criteria.  Still,
      cleanup_bridge() calls acpiphp_unregister_hotplug_slot() for all
      objects created by register_slot(), although it should only call it
      for the ones that acpiphp_register_hotplug_slot() has been called
      for (successfully).  This causes a NULL pointer to be dereferenced
      by the acpiphp_unregister_hotplug_slot() executed by cleanup_bridge()
      if the object it is called for has not been passed to
      acpiphp_register_hotplug_slot().
      
      To fix this problem, check if the 'slot' field of the object passed
      to acpiphp_unregister_hotplug_slot() in cleanup_bridge() is not NULL,
      which only is the case if acpiphp_register_hotplug_slot() has been
      executed for that object.  In addition to that, make register_slot()
      reset the 'slot' field to NULL if acpiphp_register_hotplug_slot() has
      failed for the given object to prevent stale pointers from being
      used by acpiphp_unregister_hotplug_slot().
      Reported-and-tested-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      1aaac071
  2. 01 8月, 2013 1 次提交
  3. 23 7月, 2013 30 次提交
  4. 19 7月, 2013 4 次提交
  5. 18 7月, 2013 4 次提交
    • N
      md/raid1: fix bio handling problems in process_checks() · 30bc9b53
      NeilBrown 提交于
      Recent change to use bio_copy_data() in raid1 when repairing
      an array is faulty.
      
      The underlying may have changed the bio in various ways using
      bio_advance and these need to be undone not just for the 'sbio' which
      is being copied to, but also the 'pbio' (primary) which is being
      copied from.
      
      So perform the reset on all bios that were read from and do it early.
      
      This also ensure that the sbio->bi_io_vec[j].bv_len passed to
      memcmp is correct.
      
      This fixes a crash during a 'check' of a RAID1 array.  The crash was
      introduced in 3.10 so this is suitable for 3.10-stable.
      
      Cc: stable@vger.kernel.org (3.10)
      Reported-by: NJoe Lawrence <joe.lawrence@stratus.com>
      Signed-off-by: NNeilBrown <neilb@suse.de>
      30bc9b53
    • N
      md: Remove recent change which allows devices to skip recovery. · 5024c298
      NeilBrown 提交于
      commit 7ceb17e8
          md: Allow devices to be re-added to a read-only array.
      
      allowed a bit more than just that.  It also allows devices to be added
      to a read-write array and to end up skipping recovery.
      
      This patch removes the offending piece of code pending a rewrite for a
      subsequent release.
      
      More specifically:
       If the array has a bitmap, then the device will still need a bitmap
       based resync ('saved_raid_disk' is set under different conditions
       is a bitmap is present).
       If the array doesn't have a bitmap, then this is correct as long as
       nothing has been written to the array since the metadata was checked
       by ->validate_super.  However there is no locking to ensure that there
       was no write.
      
      Bug was introduced in 3.10 and causes data corruption so
      patch is suitable for 3.10-stable.
      
      Cc: stable@vger.kernel.org (3.10)
      Reported-by: NJoe Lawrence <joe.lawrence@stratus.com>
      Signed-off-by: NNeilBrown <neilb@suse.de>
      5024c298
    • N
      md/raid10: fix two problems with RAID10 resync. · 7bb23c49
      NeilBrown 提交于
      1/ When an different between blocks is found, data is copied from
         one bio to the other.  However bv_len is used as the length to
         copy and this could be zero.  So use r10_bio->sectors to calculate
         length instead.
         Using bv_len was probably always a bit dubious, but the introduction
         of bio_advance made it much more likely to be a problem.
      
      2/ When preparing some blocks for sync, we don't set BIO_UPTODATE
         except on bios that we schedule for a read.  This ensures that
         missing/failed devices don't confuse the loop at the top of
         sync_request write.
         Commit 8be185f2 "raid10: Use bio_reset()"
         removed a loop which set BIO_UPTDATE on all appropriate bios.
         So we need to re-add that flag.
      
      These bugs were introduced in 3.10, so this patch is suitable for
      3.10-stable, and can remove a potential for data corruption.
      
      Cc: stable@vger.kernel.org (3.10)
      Reported-by: NBrassow Jonathan <jbrassow@redhat.com>
      Signed-off-by: NNeilBrown <neilb@suse.de>
      7bb23c49
    • A
      ACPI / video: no automatic brightness changes by win8-compatible firmware · efaa14c7
      Aaron Lu 提交于
      Starting from win8, MS backlight control driver will set bit 2 of the
      parameter of control method _DOS, to inform firmware it should not
      perform any automatic brightness changes. This mostly affects hotkey
      notification deliver - if we do not set this bit, on hotkey press,
      firmware may choose to adjust brightness level instead of sending out
      notification and doing nothing.
      
      So this patch sets bit 2 when calling _DOS so that GUIs can show the
      notification window on hotkey press.  This behavior change is only
      necessary for win8 systems.
      
      The MS document on win8 backlight control is here:
      http://msdn.microsoft.com/en-US/library/windows/hardware/jj159305
      
      References: https://bugzilla.kernel.org/show_bug.cgi?id=52951
      References: https://bugzilla.kernel.org/show_bug.cgi?id=56711Reported-by: NMicael Dias <kam1kaz3@gmail.com>
      Reported-by: NDan Garton <dan.garton@gmail.com>
      Reported-by: NBob Ziuchkovski <bob.ziuchkovski@gmail.com>
      Signed-off-by: NAaron Lu <aaron.lu@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      efaa14c7