1. 01 Oct, 2013 23 commits
    • Ben Skeggs's avatar
      drm/ttm: fix the tt_populated check in ttm_tt_destroy() · 3614efdf
      Ben Skeggs authored
      commit 182b17c8 upstream.
      
      After a vmalloc failure in ttm_dma_tt_alloc_page_directory(),
      ttm_dma_tt_init() will call ttm_tt_destroy() to cleanup, and end up
      inside the driver's unpopulate() hook when populate() has never yet
      been called.
      
      On nouveau, the first issue to be hit because of this is that
      dma_address[] may be a NULL pointer.  After working around this,
      ttm_pool_unpopulate() may potentially hit the same issue with
      the pages[] array.
      
      It seems to make more sense to avoid calling unpopulate on already
      unpopulated TTMs than to add checks to all the implementations.
      Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
      Reviewed-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
      Cc: Jerome Glisse <jglisse@redhat.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3614efdf
    • Dave Airlie's avatar
      drm/ast: fix the ast open key function · 2781ca89
      Dave Airlie authored
      commit 2e837813 upstream.
      
      When porting from UMS I mistyped this from the wrong place, AST noticed
      and pointed it out, so we should fix it to be like the X.org driver.
      Reported-by: default avatarY.C. Chen <yc_chen@aspeedtech.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2781ca89
    • David Herrmann's avatar
      drm: fix DRM_IOCTL_MODE_GETFB handle-leak · b61d2139
      David Herrmann authored
      commit 101b96f3 upstream.
      
      DRM_IOCTL_MODE_GETFB is used to retrieve information about a given
      framebuffer ID. It is a read-only helper and was thus declassified for
      unprivileged access in:
      
        commit a14b1b42
        Author: Mandeep Singh Baines <mandeep.baines@gmail.com>
        Date:   Fri Jan 20 12:11:16 2012 -0800
      
            drm: remove master fd restriction on mode setting getters
      
      However, alongside width, height and stride information,
      DRM_IOCTL_MODE_GETFB also passes back a handle to the underlying buffer of
      the framebuffer. This handle allows users to mmap() it and read or write
      into it. Obviously, this should be restricted to DRM-Master.
      
      With the current setup, *any* process with access to /dev/dri/card0 (which
      means any process with access to hardware-accelerated rendering) can
      access the current screen framebuffer and modify it ad libitum.
      
      For backwards-compatibility reasons we want to keep the
      DRM_IOCTL_MODE_GETFB call unprivileged. Besides, it provides quite useful
      information regarding screen setup. So we simply test whether the caller
      is the current DRM-Master and if not, we return 0 as handle, which is
      always invalid. A following DRM_IOCTL_GEM_CLOSE on this handle will fail
      with EINVAL, but we accept this. Users shouldn't test for errors during
      GEM_CLOSE, anyway. And it is still better as a failing MODE_GETFB call.
      
      v2: add capable(CAP_SYS_ADMIN) check for compatibility with i-g-t
      Signed-off-by: default avatarDavid Herrmann <dh.herrmann@gmail.com>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b61d2139
    • Daniel Vetter's avatar
      drm/i915: fix wait_for_pending_flips vs gpu hang deadlock · 590f5c01
      Daniel Vetter authored
      commit 17e1df07 upstream.
      
      My g33 here seems to be shockingly good at hitting them all. This time
      around kms_flip/flip-vs-panning-vs-hang blows up:
      
      intel_crtc_wait_for_pending_flips correctly checks for gpu hangs and
      if a gpu hang is pending aborts the wait for outstanding flips so that
      the setcrtc call will succeed and release the crtc mutex. And the gpu
      hang handler needs that lock in intel_display_handle_reset to be able
      to complete outstanding flips.
      
      The problem is that we can race in two ways:
      - Waiters on the dev_priv->pending_flip_queue aren't woken up after
        we've the reset as pending, but before we actually start the reset
        work. This means that the waiter doesn't notice the pending reset
        and hence will keep on hogging the locks.
      
        Like with dev->struct_mutex and the ring->irq_queue wait queues we
        there need to wake up everyone that potentially holds a lock which
        the reset handler needs.
      
      - intel_display_handle_reset was called _after_ we've already
        signalled the completion of the reset work. Which means a waiter
        could sneak in, grab the lock and never release it (since the
        pageflips won't ever get released).
      
        Similar to resetting the gem state all the reset work must complete
        before we update the reset counter. Contrary to the gem reset we
        don't need to have a second explicit wake up call since that will
        have happened already when completing the pageflips. We also don't
        have any issues that the completion happens while the reset state is
        still pending - wait_for_pending_flips is only there to ensure we
        display the right frame. After a gpu hang&reset events such
        guarantees are out the window anyway. This is in contrast to the gem
        code where too-early wake-up would result in unnecessary restarting
        of ioctls.
      
      Also, since we've gotten these various deadlocks and ordering
      constraints wrong so often throw copious amounts of comments at the
      code.
      
      This deadlock regression has been introduced in the commit which added
      the pageflip reset logic to the gpu hang work:
      
      commit 96a02917
      Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Date:   Mon Feb 18 19:08:49 2013 +0200
      
          drm/i915: Finish page flips and update primary planes after a GPU reset
      
      v2:
      - Add comments to explain how the wake_up serves as memory barriers
        for the atomic_t reset counter.
      - Improve the comments a bit as suggested by Chris Wilson.
      - Extract the wake_up calls before/after the reset into a little
        i915_error_wake_up and unconditionally wake up the
        pending_flip_queue waiters, again as suggested by Chris Wilson.
      
      v3: Throw copious amounts of comments at i915_error_wake_up as
      suggested by Chris Wilson.
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      590f5c01
    • Daniel Vetter's avatar
      drm/i915: fix gpu hang vs. flip stall deadlocks · d553bc6d
      Daniel Vetter authored
      commit 122f46ba upstream.
      
      Since we've started to clean up pending flips when the gpu hangs in
      
      commit 96a02917
      Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Date:   Mon Feb 18 19:08:49 2013 +0200
      
          drm/i915: Finish page flips and update primary planes after a GPU reset
      
      the gpu reset work now also grabs modeset locks. But since work items
      on our private work queue are not allowed to do that due to the
      flush_workqueue from the pageflip code this results in a neat
      deadlock:
      
      INFO: task kms_flip:14676 blocked for more than 120 seconds.
      "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
      kms_flip        D ffff88019283a5c0     0 14676  13344 0x00000004
       ffff88018e62dbf8 0000000000000046 ffff88013bdb12e0 ffff88018e62dfd8
       ffff88018e62dfd8 00000000001d3b00 ffff88019283a5c0 ffff88018ec21000
       ffff88018f693f00 ffff88018eece000 ffff88018e62dd60 ffff88018eece898
      Call Trace:
       [<ffffffff8138ee7b>] schedule+0x60/0x62
       [<ffffffffa046c0dd>] intel_crtc_wait_for_pending_flips+0xb2/0x114 [i915]
       [<ffffffff81050ff4>] ? finish_wait+0x60/0x60
       [<ffffffffa0478041>] intel_crtc_set_config+0x7f3/0x81e [i915]
       [<ffffffffa031780a>] drm_mode_set_config_internal+0x4f/0xc6 [drm]
       [<ffffffffa0319cf3>] drm_mode_setcrtc+0x44d/0x4f9 [drm]
       [<ffffffff810e44da>] ? might_fault+0x38/0x86
       [<ffffffffa030d51f>] drm_ioctl+0x2f9/0x447 [drm]
       [<ffffffff8107a722>] ? trace_hardirqs_off+0xd/0xf
       [<ffffffffa03198a6>] ? drm_mode_setplane+0x343/0x343 [drm]
       [<ffffffff8112222f>] ? mntput_no_expire+0x3e/0x13d
       [<ffffffff81117f33>] vfs_ioctl+0x18/0x34
       [<ffffffff81118776>] do_vfs_ioctl+0x396/0x454
       [<ffffffff81396b37>] ? sysret_check+0x1b/0x56
       [<ffffffff81118886>] SyS_ioctl+0x52/0x7d
       [<ffffffff81396b12>] system_call_fastpath+0x16/0x1b
      2 locks held by kms_flip/14676:
       #0:  (&dev->mode_config.mutex){+.+.+.}, at: [<ffffffffa0316545>] drm_modeset_lock_all+0x22/0x59 [drm]
       #1:  (&crtc->mutex){+.+.+.}, at: [<ffffffffa031656b>] drm_modeset_lock_all+0x48/0x59 [drm]
      INFO: task kworker/u8:4:175 blocked for more than 120 seconds.
      "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
      kworker/u8:4    D ffff88018de9a5c0     0   175      2 0x00000000
      Workqueue: i915 i915_error_work_func [i915]
       ffff88018e37dc30 0000000000000046 ffff8801938ab8a0 ffff88018e37dfd8
       ffff88018e37dfd8 00000000001d3b00 ffff88018de9a5c0 ffff88018ec21018
       0000000000000246 ffff88018e37dca0 000000005a865a86 ffff88018de9a5c0
      Call Trace:
       [<ffffffff8138ee7b>] schedule+0x60/0x62
       [<ffffffff8138f23d>] schedule_preempt_disabled+0x9/0xb
       [<ffffffff8138d0cd>] mutex_lock_nested+0x205/0x3b1
       [<ffffffffa0477094>] ? intel_display_handle_reset+0x7e/0xbd [i915]
       [<ffffffffa0477094>] ? intel_display_handle_reset+0x7e/0xbd [i915]
       [<ffffffffa0477094>] intel_display_handle_reset+0x7e/0xbd [i915]
       [<ffffffffa044e0a2>] i915_error_work_func+0x128/0x147 [i915]
       [<ffffffff8104a89a>] process_one_work+0x1d4/0x35a
       [<ffffffff8104a821>] ? process_one_work+0x15b/0x35a
       [<ffffffff8104b4a5>] worker_thread+0x144/0x1f0
       [<ffffffff8104b361>] ? rescuer_thread+0x275/0x275
       [<ffffffff8105076d>] kthread+0xac/0xb4
       [<ffffffff81059d30>] ? finish_task_switch+0x3b/0xc0
       [<ffffffff810506c1>] ? __kthread_parkme+0x60/0x60
       [<ffffffff81396a6c>] ret_from_fork+0x7c/0xb0
       [<ffffffff810506c1>] ? __kthread_parkme+0x60/0x60
      3 locks held by kworker/u8:4/175:
       #0:  (i915){.+.+.+}, at: [<ffffffff8104a821>] process_one_work+0x15b/0x35a
       #1:  ((&dev_priv->gpu_error.work)){+.+.+.}, at: [<ffffffff8104a821>] process_one_work+0x15b/0x35a
       #2:  (&crtc->mutex){+.+.+.}, at: [<ffffffffa0477094>] intel_display_handle_reset+0x7e/0xbd [i915]
      
      This blew up while running kms_flip/flip-vs-panning-vs-hang-interruptible
      on one of my older machines.
      
      Unfortunately (despite the proper lockdep annotations for
      flush_workqueue) lockdep still doesn't detect this correctly, so we
      need to rely on chance to discover these bugs.
      
      Apply the usual bugfix and schedule the reset work on the system
      workqueue to keep our own driver workqueue free of any modeset lock
      grabbing.
      
      Note that this is not a terribly serious regression since before the
      offending commit we'd simply have stalled userspace forever due to
      failing to abort all outstanding pageflips.
      
      v2: Add a comment as requested by Chris.
      
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d553bc6d
    • Alan Stern's avatar
      usb: gadget: fix a bug and a WARN_ON in dummy-hcd · 45f785a2
      Alan Stern authored
      commit 5f5610f6 upstream.
      
      This patch fixes a NULL pointer dereference and a WARN_ON in
      dummy-hcd.  These things were the result of moving to the UDC core
      framework, and possibly of changes to that framework.
      
      Now unloading a gadget driver causes the UDC to be stopped after the
      gadget driver is unbound, not before.  Therefore the "driver" argument
      to dummy_udc_stop() can be NULL, so we must not try to print the
      driver's name without checking first.
      
      Also, the UDC framework automatically unregisters the gadget when the
      UDC is deleted.  Therefore a sysfs attribute file attached to the
      gadget must be removed before the UDC is deleted, not after.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      45f785a2
    • Kees Cook's avatar
      HID: logitech-dj: validate output report details · 76611073
      Kees Cook authored
      commit 297502ab upstream.
      
      A HID device could send a malicious output report that would cause the
      logitech-dj HID driver to leak kernel memory contents to the device, or
      trigger a NULL dereference during initialization:
      
      [  304.424553] usb 1-1: New USB device found, idVendor=046d, idProduct=c52b
      ...
      [  304.780467] BUG: unable to handle kernel NULL pointer dereference at 0000000000000028
      [  304.781409] IP: [<ffffffff815d50aa>] logi_dj_recv_send_report.isra.11+0x1a/0x90
      
      CVE-2013-2895
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@gmail.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      76611073
    • Kees Cook's avatar
      HID: lenovo-tpkbd: validate output report details · 855f21e0
      Kees Cook authored
      commit 0a9cd0a8 upstream.
      
      A HID device could send a malicious output report that would cause the
      lenovo-tpkbd HID driver to write just beyond the output report allocation
      during initialization, causing a heap overflow:
      
      [   76.109807] usb 1-1: New USB device found, idVendor=17ef, idProduct=6009
      ...
      [   80.462540] BUG kmalloc-192 (Tainted: G        W   ): Redzone overwritten
      
      CVE-2013-2894
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      855f21e0
    • Kees Cook's avatar
      HID: steelseries: validate output report details · dcfd5f58
      Kees Cook authored
      commit 41df7f6d upstream.
      
      A HID device could send a malicious output report that would cause the
      steelseries HID driver to write beyond the output report allocation
      during initialization, causing a heap overflow:
      
      [  167.981534] usb 1-1: New USB device found, idVendor=1038, idProduct=1410
      ...
      [  182.050547] BUG kmalloc-256 (Tainted: G        W   ): Redzone overwritten
      
      CVE-2013-2891
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dcfd5f58
    • Benjamin Tissoires's avatar
      HID: lenovo-tpkbd: fix leak if tpkbd_probe_tp fails · 30c1e32f
      Benjamin Tissoires authored
      commit 0ccdd9e7 upstream.
      
      If tpkbd_probe_tp() bails out, the probe() function return an error,
      but hid_hw_stop() is never called.
      
      fixes:
      https://bugzilla.redhat.com/show_bug.cgi?id=1003998Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      30c1e32f
    • Kees Cook's avatar
      HID: zeroplus: validate output report details · be3cdbf5
      Kees Cook authored
      commit 78214e81 upstream.
      
      The zeroplus HID driver was not checking the size of allocated values
      in fields it used. A HID device could send a malicious output report
      that would cause the driver to write beyond the output report allocation
      during initialization, causing a heap overflow:
      
      [ 1442.728680] usb 1-1: New USB device found, idVendor=0c12, idProduct=0005
      ...
      [ 1466.243173] BUG kmalloc-192 (Tainted: G        W   ): Redzone overwritten
      
      CVE-2013-2889
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      be3cdbf5
    • Kees Cook's avatar
      HID: LG: validate HID output report details · 2ec96f1b
      Kees Cook authored
      commit 0fb6bd06 upstream.
      
      A HID device could send a malicious output report that would cause the
      lg, lg3, and lg4 HID drivers to write beyond the output report allocation
      during an event, causing a heap overflow:
      
      [  325.245240] usb 1-1: New USB device found, idVendor=046d, idProduct=c287
      ...
      [  414.518960] BUG kmalloc-4096 (Not tainted): Redzone overwritten
      
      Additionally, while lg2 did correctly validate the report details, it was
      cleaned up and shortened.
      
      CVE-2013-2893
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2ec96f1b
    • Benjamin Tissoires's avatar
      HID: multitouch: validate indexes details · 9f338388
      Benjamin Tissoires authored
      commit 8821f5dc upstream.
      
      When working on report indexes, always validate that they are in bounds.
      Without this, a HID device could report a malicious feature report that
      could trick the driver into a heap overflow:
      
      [  634.885003] usb 1-1: New USB device found, idVendor=0596, idProduct=0500
      ...
      [  676.469629] BUG kmalloc-192 (Tainted: G        W   ): Redzone overwritten
      
      Note that we need to change the indexes from s8 to s16 as they can
      be between -1 and 255.
      
      CVE-2013-2897
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Acked-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9f338388
    • Benjamin Tissoires's avatar
      HID: validate feature and input report details · ae5c98a4
      Benjamin Tissoires authored
      commit cc6b54aa upstream.
      
      When dealing with usage_index, be sure to properly use unsigned instead of
      int to avoid overflows.
      
      When working on report fields, always validate that their report_counts are
      in bounds.
      Without this, a HID device could report a malicious feature report that
      could trick the driver into a heap overflow:
      
      [  634.885003] usb 1-1: New USB device found, idVendor=0596, idProduct=0500
      ...
      [  676.469629] BUG kmalloc-192 (Tainted: G        W   ): Redzone overwritten
      
      CVE-2013-2897
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Acked-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ae5c98a4
    • Kees Cook's avatar
      HID: provide a helper for validating hid reports · 791abfbe
      Kees Cook authored
      commit 331415ff upstream.
      
      Many drivers need to validate the characteristics of their HID report
      during initialization to avoid misusing the reports. This adds a common
      helper to perform validation of the report exisitng, the field existing,
      and the expected number of values within the field.
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      791abfbe
    • Daisuke Nishimura's avatar
      sched/fair: Fix small race where child->se.parent,cfs_rq might point to invalid ones · 51f52947
      Daisuke Nishimura authored
      commit 6c9a27f5 upstream.
      
      There is a small race between copy_process() and cgroup_attach_task()
      where child->se.parent,cfs_rq points to invalid (old) ones.
      
              parent doing fork()      | someone moving the parent to another cgroup
        -------------------------------+---------------------------------------------
          copy_process()
            + dup_task_struct()
              -> parent->se is copied to child->se.
                 se.parent,cfs_rq of them point to old ones.
      
                                           cgroup_attach_task()
                                             + cgroup_task_migrate()
                                               -> parent->cgroup is updated.
                                             + cpu_cgroup_attach()
                                               + sched_move_task()
                                                 + task_move_group_fair()
                                                   +- set_task_rq()
                                                      -> se.parent,cfs_rq of parent
                                                         are updated.
      
            + cgroup_fork()
              -> parent->cgroup is copied to child->cgroup. (*1)
            + sched_fork()
              + task_fork_fair()
                -> se.parent,cfs_rq of child are accessed
                   while they point to old ones. (*2)
      
      In the worst case, this bug can lead to "use-after-free" and cause a panic,
      because it's new cgroup's refcount that is incremented at (*1),
      so the old cgroup(and related data) can be freed before (*2).
      
      In fact, a panic caused by this bug was originally caught in RHEL6.4.
      
          BUG: unable to handle kernel NULL pointer dereference at (null)
          IP: [<ffffffff81051e3e>] sched_slice+0x6e/0xa0
          [...]
          Call Trace:
           [<ffffffff81051f25>] place_entity+0x75/0xa0
           [<ffffffff81056a3a>] task_fork_fair+0xaa/0x160
           [<ffffffff81063c0b>] sched_fork+0x6b/0x140
           [<ffffffff8106c3c2>] copy_process+0x5b2/0x1450
           [<ffffffff81063b49>] ? wake_up_new_task+0xd9/0x130
           [<ffffffff8106d2f4>] do_fork+0x94/0x460
           [<ffffffff81072a9e>] ? sys_wait4+0xae/0x100
           [<ffffffff81009598>] sys_clone+0x28/0x30
           [<ffffffff8100b393>] stub_clone+0x13/0x20
           [<ffffffff8100b072>] ? system_call_fastpath+0x16/0x1b
      Signed-off-by: default avatarDaisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
      Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/039601ceae06$733d3130$59b79390$@mxp.nes.nec.co.jpSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      51f52947
    • Stanislaw Gruszka's avatar
      sched/cputime: Do not scale when utime == 0 · 013b14c3
      Stanislaw Gruszka authored
      commit 5a8e01f8 upstream.
      
      scale_stime() silently assumes that stime < rtime, otherwise
      when stime == rtime and both values are big enough (operations
      on them do not fit in 32 bits), the resulting scaling stime can
      be bigger than rtime. In consequence utime = rtime - stime
      results in negative value.
      
      User space visible symptoms of the bug are overflowed TIME
      values on ps/top, for example:
      
       $ ps aux | grep rcu
       root         8  0.0  0.0      0     0 ?        S    12:42   0:00 [rcuc/0]
       root         9  0.0  0.0      0     0 ?        S    12:42   0:00 [rcub/0]
       root        10 62422329  0.0  0     0 ?        R    12:42 21114581:37 [rcu_preempt]
       root        11  0.1  0.0      0     0 ?        S    12:42   0:02 [rcuop/0]
       root        12 62422329  0.0  0     0 ?        S    12:42 21114581:35 [rcuop/1]
       root        10 62422329  0.0  0     0 ?        R    12:42 21114581:37 [rcu_preempt]
      
      or overflowed utime values read directly from /proc/$PID/stat
      
      Reference:
      
        https://lkml.org/lkml/2013/8/20/259Reported-and-tested-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
      Cc: stable@vger.kernel.org
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Link: http://lkml.kernel.org/r/20130904131602.GC2564@redhat.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      013b14c3
    • John Stultz's avatar
      timekeeping: Fix HRTICK related deadlock from ntp lock changes · 63946e86
      John Stultz authored
      commit 7bd36014 upstream.
      
      Gerlando Falauto reported that when HRTICK is enabled, it is
      possible to trigger system deadlocks. These were hard to
      reproduce, as HRTICK has been broken in the past, but seemed
      to be connected to the timekeeping_seq lock.
      
      Since seqlock/seqcount's aren't supported w/ lockdep, I added
      some extra spinlock based locking and triggered the following
      lockdep output:
      
      [   15.849182] ntpd/4062 is trying to acquire lock:
      [   15.849765]  (&(&pool->lock)->rlock){..-...}, at: [<ffffffff810aa9b5>] __queue_work+0x145/0x480
      [   15.850051]
      [   15.850051] but task is already holding lock:
      [   15.850051]  (timekeeper_lock){-.-.-.}, at: [<ffffffff810df6df>] do_adjtimex+0x7f/0x100
      
      <snip>
      
      [   15.850051] Chain exists of: &(&pool->lock)->rlock --> &p->pi_lock --> timekeeper_lock
      [   15.850051]  Possible unsafe locking scenario:
      [   15.850051]
      [   15.850051]        CPU0                    CPU1
      [   15.850051]        ----                    ----
      [   15.850051]   lock(timekeeper_lock);
      [   15.850051]                                lock(&p->pi_lock);
      [   15.850051] lock(timekeeper_lock);
      [   15.850051] lock(&(&pool->lock)->rlock);
      [   15.850051]
      [   15.850051]  *** DEADLOCK ***
      
      The deadlock was introduced by 06c017fd ("timekeeping:
      Hold timekeepering locks in do_adjtimex and hardpps") in 3.10
      
      This patch avoids this deadlock, by moving the call to
      schedule_delayed_work() outside of the timekeeper lock
      critical section.
      Reported-by: default avatarGerlando Falauto <gerlando.falauto@keymile.com>
      Tested-by: default avatarLin Ming <minggr@gmail.com>
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Link: http://lkml.kernel.org/r/1378943457-27314-1-git-send-email-john.stultz@linaro.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      63946e86
    • Stanislaw Gruszka's avatar
      rt2800: fix wrong TX power compensation · beb6f0e8
      Stanislaw Gruszka authored
      commit 6e956da2 upstream.
      
      We should not do temperature compensation on devices without
      EXTERNAL_TX_ALC bit set (called DynamicTxAgcControl on vendor driver).
      Such devices can have totally bogus TSSI parameters on the EEPROM,
      but still threaded by us as valid and result doing wrong TX power
      calculations.
      
      This fix inability to connect to AP on slightly longer distance on
      some Ralink chips/devices.
      Reported-and-tested-by: default avatarFabien ADAM <id2ndr@crocobox.org>
      Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      beb6f0e8
    • Rafał Miłecki's avatar
      bgmac: fix internal switch initialization · 86f7c995
      Rafał Miłecki authored
      commit 6a391e7b upstream.
      
      Some devices (BCM4749, BCM5357, BCM53572) have internal switch that
      requires initialization. We already have code for this, but because
      of the typo in code it was never working. This resulted in network not
      working for some routers and possibility of soft-bricking them.
      
      Use correct bit for switch initialization and fix typo in the define.
      Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      86f7c995
    • Miklos Szeredi's avatar
      cifs: fix filp leak in cifs_atomic_open() · b1bf3479
      Miklos Szeredi authored
      commit dfb1d61b upstream.
      
      If an error occurs after having called finish_open() then fput() needs to
      be called on the already opened file.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      Cc: Steve French <sfrench@samba.org>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b1bf3479
    • Fabio Porcedda's avatar
    • Rafael J. Wysocki's avatar
      PCI / ACPI / PM: Clear pme_poll for devices in D3cold on wakeup · 65e8f55e
      Rafael J. Wysocki authored
      commit 83414515 upstream.
      
      Commit 448bd857 (PCI/PM: add PCIe runtime D3cold support) added a
      piece of code to pci_acpi_wake_dev() causing that function to behave
      in a special way for devices in D3cold (so that their configuration
      registers are not accessed before those devices are resumed).
      However, it didn't take the clearing of the pme_poll flag into
      account.  That has to be done for all devices, even if they are in
      D3cold, or pci_pme_list_scan() will not know that wakeup has been
      signaled for the device and will poll its PME Status bit
      unnecessarily.
      
      Fix the problem by moving the clearing of the pme_poll flag in
      pci_acpi_wake_dev() before the code introduced by commit 448bd857.
      Reported-and-tested-by: default avatarDavid E. Box <david.e.box@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      65e8f55e
  2. 27 Sep, 2013 17 commits
    • Greg Kroah-Hartman's avatar
      Linux 3.10.13 · cff43fc8
      Greg Kroah-Hartman authored
      cff43fc8
    • Miklos Szeredi's avatar
      fuse: readdir: check for slash in names · e5362560
      Miklos Szeredi authored
      commit efeb9e60 upstream.
      
      Userspace can add names containing a slash character to the directory
      listing.  Don't allow this as it could cause all sorts of trouble.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e5362560
    • Maxim Patlasov's avatar
      fuse: hotfix truncate_pagecache() issue · 4e208303
      Maxim Patlasov authored
      commit 06a7c3c2 upstream.
      
      The way how fuse calls truncate_pagecache() from fuse_change_attributes()
      is completely wrong. Because, w/o i_mutex held, we never sure whether
      'oldsize' and 'attr->size' are valid by the time of execution of
      truncate_pagecache(inode, oldsize, attr->size). In fact, as soon as we
      released fc->lock in the middle of fuse_change_attributes(), we completely
      loose control of actions which may happen with given inode until we reach
      truncate_pagecache. The list of potentially dangerous actions includes
      mmap-ed reads and writes, ftruncate(2) and write(2) extending file size.
      
      The typical outcome of doing truncate_pagecache() with outdated arguments
      is data corruption from user point of view. This is (in some sense)
      acceptable in cases when the issue is triggered by a change of the file on
      the server (i.e. externally wrt fuse operation), but it is absolutely
      intolerable in scenarios when a single fuse client modifies a file without
      any external intervention. A real life case I discovered by fsx-linux
      looked like this:
      
      1. Shrinking ftruncate(2) comes to fuse_do_setattr(). The latter sends
      FUSE_SETATTR to the server synchronously, but before getting fc->lock ...
      2. fuse_dentry_revalidate() is asynchronously called. It sends FUSE_LOOKUP
      to the server synchronously, then calls fuse_change_attributes(). The
      latter updates i_size, releases fc->lock, but before comparing oldsize vs
      attr->size..
      3. fuse_do_setattr() from the first step proceeds by acquiring fc->lock and
      updating attributes and i_size, but now oldsize is equal to
      outarg.attr.size because i_size has just been updated (step 2). Hence,
      fuse_do_setattr() returns w/o calling truncate_pagecache().
      4. As soon as ftruncate(2) completes, the user extends file size by
      write(2) making a hole in the middle of file, then reads data from the hole
      either by read(2) or mmap-ed read. The user expects to get zero data from
      the hole, but gets stale data because truncate_pagecache() is not executed
      yet.
      
      The scenario above illustrates one side of the problem: not truncating the
      page cache even though we should. Another side corresponds to truncating
      page cache too late, when the state of inode changed significantly.
      Theoretically, the following is possible:
      
      1. As in the previous scenario fuse_dentry_revalidate() discovered that
      i_size changed (due to our own fuse_do_setattr()) and is going to call
      truncate_pagecache() for some 'new_size' it believes valid right now. But
      by the time that particular truncate_pagecache() is called ...
      2. fuse_do_setattr() returns (either having called truncate_pagecache() or
      not -- it doesn't matter).
      3. The file is extended either by write(2) or ftruncate(2) or fallocate(2).
      4. mmap-ed write makes a page in the extended region dirty.
      
      The result will be the lost of data user wrote on the fourth step.
      
      The patch is a hotfix resolving the issue in a simplistic way: let's skip
      dangerous i_size update and truncate_pagecache if an operation changing
      file size is in progress. This simplistic approach looks correct for the
      cases w/o external changes. And to handle them properly, more sophisticated
      and intrusive techniques (e.g. NFS-like one) would be required. I'd like to
      postpone it until the issue is well discussed on the mailing list(s).
      
      Changed in v2:
       - improved patch description to cover both sides of the issue.
      Signed-off-by: default avatarMaxim Patlasov <mpatlasov@parallels.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4e208303
    • Anand Avati's avatar
      fuse: invalidate inode attributes on xattr modification · eb97a45d
      Anand Avati authored
      commit d331a415 upstream.
      
      Calls like setxattr and removexattr result in updation of ctime.
      Therefore invalidate inode attributes to force a refresh.
      Signed-off-by: default avatarAnand Avati <avati@redhat.com>
      Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      eb97a45d
    • Maxim Patlasov's avatar
      fuse: postpone end_page_writeback() in fuse_writepage_locked() · 3002e63b
      Maxim Patlasov authored
      commit 4a4ac4eb upstream.
      
      The patch fixes a race between ftruncate(2), mmap-ed write and write(2):
      
      1) An user makes a page dirty via mmap-ed write.
      2) The user performs shrinking truncate(2) intended to purge the page.
      3) Before fuse_do_setattr calls truncate_pagecache, the page goes to
         writeback. fuse_writepage_locked fills FUSE_WRITE request and releases
         the original page by end_page_writeback.
      4) fuse_do_setattr() completes and successfully returns. Since now, i_mutex
         is free.
      5) Ordinary write(2) extends i_size back to cover the page. Note that
         fuse_send_write_pages do wait for fuse writeback, but for another
         page->index.
      6) fuse_writepage_locked proceeds by queueing FUSE_WRITE request.
         fuse_send_writepage is supposed to crop inarg->size of the request,
         but it doesn't because i_size has already been extended back.
      
      Moving end_page_writeback to the end of fuse_writepage_locked fixes the
      race because now the fact that truncate_pagecache is successfully returned
      infers that fuse_writepage_locked has already called end_page_writeback.
      And this, in turn, infers that fuse_flush_writepages has already called
      fuse_send_writepage, and the latter used valid (shrunk) i_size. write(2)
      could not extend it because of i_mutex held by ftruncate(2).
      Signed-off-by: default avatarMaxim Patlasov <mpatlasov@parallels.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3002e63b
    • Mark Brown's avatar
      clk: wm831x: Initialise wm831x pointer on init · d662986b
      Mark Brown authored
      commit 08442ce9 upstream.
      
      Otherwise any attempt to interact with the hardware will crash. This is
      what happens when drivers get written blind.
      Signed-off-by: default avatarMark Brown <broonie@linaro.org>
      Signed-off-by: default avatarMike Turquette <mturquette@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d662986b
    • Brian Norris's avatar
      mtd: nand: fix NAND_BUSWIDTH_AUTO for x16 devices · 497587f8
      Brian Norris authored
      commit 68e80780 upstream.
      
      The code for NAND_BUSWIDTH_AUTO is broken. According to Alexander:
      
        "I have a problem with attach NAND UBI in 16 bit mode.
         NAND works fine if I specify NAND_BUSWIDTH_16 option, but not
         working with NAND_BUSWIDTH_AUTO option. In second case NAND
         chip is identifyed with ONFI."
      
      See his report for the rest of the details:
      
        http://lists.infradead.org/pipermail/linux-mtd/2013-July/047515.html
      
      Anyway, the problem is that nand_set_defaults() is called twice, we
      intend it to reset the chip functions to their x16 buswidth verions
      if the buswidth changed from x8 to x16; however, nand_set_defaults()
      does exactly nothing if called a second time.
      
      Fix this by hacking nand_set_defaults() to reset the buswidth-dependent
      functions if they were set to the x8 version the first time. Note that
      this does not do anything to reset from x16 to x8, but that's not the
      supported use case for NAND_BUSWIDTH_AUTO anyway.
      Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
      Reported-by: default avatarAlexander Shiyan <shc_work@mail.ru>
      Tested-by: default avatarAlexander Shiyan <shc_work@mail.ru>
      Cc: Matthieu Castet <matthieu.castet@parrot.com>
      Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      497587f8
    • Grant Likely's avatar
      of: Fix missing memory initialization on FDT unflattening · 6830e9ab
      Grant Likely authored
      commit 0640332e upstream.
      
      Any calls to dt_alloc() need to be zeroed. This is a temporary fix, but
      the allocation function itself needs to zero memory before returning
      it. This is a follow up to patch 9e401275, "of: fdt: fix memory
      initialization for expanded DT" which fixed one call site but missed
      another.
      Signed-off-by: default avatarGrant Likely <grant.likely@linaro.org>
      Acked-by: default avatarWladislav Wiebe <wladislav.kw@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6830e9ab
    • Sergei Shtylyov's avatar
      mmc: tmio_mmc_dma: fix PIO fallback on SDHI · c0da0888
      Sergei Shtylyov authored
      commit f936f9b6 upstream.
      
      I'm testing SH-Mobile SDHI driver in DMA mode with  a new DMA controller  using
      'bonnie++' and getting DMA error after which the tmio_mmc_dma.c code falls back
      to PIO but all commands time out after that.  It turned out that the fallback
      code calls tmio_mmc_enable_dma() with RX/TX channels already freed and pointers
      to them cleared, so that the function bails out early instead  of clearing the
      DMA bit in the CTL_DMA_ENABLE register. The regression was introduced by commit
      162f43e3 (mmc: tmio: fix a deadlock).
      Moving tmio_mmc_enable_dma() calls to the top of the PIO fallback code in
      tmio_mmc_start_dma_{rx|tx}() helps.
      Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Acked-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
      Signed-off-by: default avatarChris Ball <cjb@laptop.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c0da0888
    • Josh Durgin's avatar
      rbd: fix I/O error propagation for reads · be4c4b85
      Josh Durgin authored
      commit 17c1cc1d upstream.
      
      When a request returns an error, the driver needs to report the entire
      extent of the request as completed.  Writes already did this, since
      they always set xferred = length, but reads were skipping that step if
      an error other than -ENOENT occurred.  Instead, rbd would end up
      passing 0 xferred to blk_end_request(), which would always report
      needing more data.  This resulted in an assert failing when more data
      was required by the block layer, but all the object requests were
      done:
      
      [ 1868.719077] rbd: obj_request read result -108 xferred 0
      [ 1868.719077]
      [ 1868.719518] end_request: I/O error, dev rbd1, sector 0
      [ 1868.719739]
      [ 1868.719739] Assertion failure in rbd_img_obj_callback() at line 1736:
      [ 1868.719739]
      [ 1868.719739]   rbd_assert(more ^ (which == img_request->obj_request_count));
      
      Without this assert, reads that hit errors would hang forever, since
      the block layer considered them incomplete.
      
      Fixes: http://tracker.ceph.com/issues/5647Signed-off-by: default avatarJosh Durgin <josh.durgin@inktank.com>
      Reviewed-by: default avatarAlex Elder <alex.elder@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      be4c4b85
    • majianpeng's avatar
    • Sage Weil's avatar
      libceph: use pg_num_mask instead of pgp_num_mask for pg.seed calc · fd5e2dea
      Sage Weil authored
      commit 9542cf0b upstream.
      
      Fix a typo that used the wrong bitmask for the pg.seed calculation.  This
      is normally unnoticed because in most cases pg_num == pgp_num.  It is, however,
      a bug that is easily corrected.
      Signed-off-by: default avatarSage Weil <sage@inktank.com>
      Reviewed-by: default avatarAlex Elder <alex.elder@linary.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fd5e2dea
    • majianpeng's avatar
      libceph: unregister request in __map_request failed and nofail == false · 2ab0ad6a
      majianpeng authored
      commit 73d9f7ee upstream.
      
      For nofail == false request, if __map_request failed, the caller does
      cleanup work, like releasing the relative pages.  It doesn't make any sense
      to retry this request.
      Signed-off-by: default avatarJianpeng Ma <majianpeng@gmail.com>
      Reviewed-by: default avatarSage Weil <sage@inktank.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2ab0ad6a
    • Richard Weinberger's avatar
      um: Implement probe_kernel_read() · 4fdaa3d4
      Richard Weinberger authored
      commit f75b1b1b upstream.
      
      UML needs it's own probe_kernel_read() to handle kernel
      mode faults correctly.
      The implementation uses mincore() on the host side to detect
      whether a page is owned by the UML kernel process.
      
      This fixes also a possible crash when sysrq-t is used.
      Starting with 3.10 sysrq-t calls probe_kernel_read() to
      read details from the kernel workers. As kernel worker are
      completely async pointers may turn NULL while reading them.
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      Cc: <stian@nixia.no>
      Cc: <tj@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4fdaa3d4
    • Alex Deucher's avatar
      drm/edid: add quirk for Medion MD30217PG · 579db19e
      Alex Deucher authored
      commit 118bdbd8 upstream.
      
      This LCD monitor (1280x1024 native) has a completely
      bogus detailed timing (640x350@70hz).  User reports that
      1280x1024@60 has waves so prefer 1280x1024@75.
      
      Manufacturer: MED  Model: 7b8  Serial#: 99188
      Year: 2005  Week: 5
      EDID Version: 1.3
      Analog Display Input,  Input Voltage Level: 0.700/0.700 V
      Sync:  Separate
      Max Image Size [cm]: horiz.: 34  vert.: 27
      Gamma: 2.50
      DPMS capabilities: Off; RGB/Color Display
      First detailed timing is preferred mode
      redX: 0.645 redY: 0.348   greenX: 0.280 greenY: 0.605
      blueX: 0.142 blueY: 0.071   whiteX: 0.313 whiteY: 0.329
      Supported established timings:
      720x400@70Hz
      640x480@60Hz
      640x480@72Hz
      640x480@75Hz
      800x600@56Hz
      800x600@60Hz
      800x600@72Hz
      800x600@75Hz
      1024x768@60Hz
      1024x768@70Hz
      1024x768@75Hz
      1280x1024@75Hz
      Manufacturer's mask: 0
      Supported standard timings:
      Supported detailed timing:
      clock: 25.2 MHz   Image Size:  337 x 270 mm
      h_active: 640  h_sync: 688  h_sync_end 784 h_blank_end 800 h_border: 0
      v_active: 350  v_sync: 350  v_sync_end 352 v_blanking: 449 v_border: 0
      Monitor name: MD30217PG
      Ranges: V min: 56 V max: 76 Hz, H min: 30 H max: 83 kHz, PixClock max 145 MHz
      Serial No: 501099188
      EDID (in hex):
                00ffffffffffff0034a4b80774830100
                050f010368221b962a0c55a559479b24
                125054afcf00310a0101010101018180
                000000000000d60980a0205e63103060
                0200510e1100001e000000fc004d4433
                3032313750470a202020000000fd0038
                4c1e530e000a202020202020000000ff
                003530313039393138380a2020200078
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Reported-by: friedrich@mailstation.de
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      579db19e
    • Borislav Petkov's avatar
      amd64_edac: Fix single-channel setups · 34db3c07
      Borislav Petkov authored
      commit f0a56c48 upstream.
      
      It can happen that configurations are running in a single-channel mode
      even with a dual-channel memory controller, by, say, putting the DIMMs
      only on the one channel and leaving the other empty. This causes a
      problem in init_csrows which implicitly assumes that when the second
      channel is enabled, i.e. channel 1, the struct dimm hierarchy will be
      present. Which is not.
      
      So always allocate two channels unconditionally.
      
      This provides for the nice side effect that the data structures are
      initialized so some day, when memory hotplug is supported, it should
      just work out of the box when all of a sudden a second channel appears.
      Reported-and-tested-by: default avatarRoger Leigh <rleigh@debian.org>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      34db3c07
    • Jan Kara's avatar
      isofs: Refuse RW mount of the filesystem instead of making it RO · 4b5fe51a
      Jan Kara authored
      commit 17b7f7cf upstream.
      
      Refuse RW mount of isofs filesystem. So far we just silently changed it
      to RO mount but when the media is writeable, block layer won't notice
      this change and thus will think device is used RW and will block eject
      button of the drive. That is unexpected by users because for
      non-writeable media eject button works just fine.
      
      Userspace mount(8) command handles this just fine and retries mounting
      with MS_RDONLY set so userspace shouldn't see any regression.  Plus any
      tool mounting isofs is likely confronted with the case of read-only
      media where block layer already refuses to mount the filesystem without
      MS_RDONLY set so our behavior shouldn't be anything new for it.
      Reported-by: default avatarHui Wang <hui.wang@canonical.com>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4b5fe51a