1. 05 Jul, 2015 30 commits
    • Jeff Layton's avatar
      nfs: take extra reference to fl->fl_file when running a setlk · bdece860
      Jeff Layton authored
      [ Upstream commit feaff8e5 ]
      
      We had a report of a crash while stress testing the NFS client:
      
          BUG: unable to handle kernel NULL pointer dereference at 0000000000000150
          IP: [<ffffffff8127b698>] locks_get_lock_context+0x8/0x90
          PGD 0
          Oops: 0000 [#1] SMP
          Modules linked in: rpcsec_gss_krb5 nfsv4 dns_resolver nfs fscache ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack ebtable_nat ebtable_filter ebtable_broute bridge stp llc ebtables ip6table_security ip6table_mangle ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_raw ip6table_filter ip6_tables iptable_security iptable_mangle iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_raw coretemp crct10dif_pclmul ppdev crc32_pclmul crc32c_intel ghash_clmulni_intel vmw_balloon serio_raw vmw_vmci i2c_piix4 shpchp parport_pc acpi_cpufreq parport nfsd auth_rpcgss nfs_acl lockd grace sunrpc vmwgfx drm_kms_helper ttm drm mptspi scsi_transport_spi mptscsih mptbase e1000 ata_generic pata_acpi
          CPU: 1 PID: 399 Comm: kworker/1:1H Not tainted 4.1.0-0.rc1.git0.1.fc23.x86_64 #1
          Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/30/2013
          Workqueue: rpciod rpc_async_schedule [sunrpc]
          task: ffff880036aea7c0 ti: ffff8800791f4000 task.ti: ffff8800791f4000
          RIP: 0010:[<ffffffff8127b698>]  [<ffffffff8127b698>] locks_get_lock_context+0x8/0x90
          RSP: 0018:ffff8800791f7c00  EFLAGS: 00010293
          RAX: ffff8800791f7c40 RBX: ffff88001f2ad8c0 RCX: ffffe8ffffc80305
          RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
          RBP: ffff8800791f7c88 R08: ffff88007fc971d8 R09: 279656d600000000
          R10: 0000034a01000000 R11: 279656d600000000 R12: ffff88001f2ad918
          R13: ffff88001f2ad8c0 R14: 0000000000000000 R15: 0000000100e73040
          FS:  0000000000000000(0000) GS:ffff88007fc80000(0000) knlGS:0000000000000000
          CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
          CR2: 0000000000000150 CR3: 0000000001c0b000 CR4: 00000000000407e0
          Stack:
           ffffffff8127c5b0 ffff8800791f7c18 ffffffffa0171e29 ffff8800791f7c58
           ffffffffa0171ef8 ffff8800791f7c78 0000000000000246 ffff88001ea0ba00
           ffff8800791f7c40 ffff8800791f7c40 00000000ff5d86a3 ffff8800791f7ca8
          Call Trace:
           [<ffffffff8127c5b0>] ? __posix_lock_file+0x40/0x760
           [<ffffffffa0171e29>] ? rpc_make_runnable+0x99/0xa0 [sunrpc]
           [<ffffffffa0171ef8>] ? rpc_wake_up_task_queue_locked.part.35+0xc8/0x250 [sunrpc]
           [<ffffffff8127cd3a>] posix_lock_file_wait+0x4a/0x120
           [<ffffffffa03e4f12>] ? nfs41_wake_and_assign_slot+0x32/0x40 [nfsv4]
           [<ffffffffa03bf108>] ? nfs41_sequence_done+0xd8/0x2d0 [nfsv4]
           [<ffffffffa03c116d>] do_vfs_lock+0x2d/0x30 [nfsv4]
           [<ffffffffa03c251d>] nfs4_lock_done+0x1ad/0x210 [nfsv4]
           [<ffffffffa0171a30>] ? __rpc_sleep_on_priority+0x390/0x390 [sunrpc]
           [<ffffffffa0171a30>] ? __rpc_sleep_on_priority+0x390/0x390 [sunrpc]
           [<ffffffffa0171a5c>] rpc_exit_task+0x2c/0xa0 [sunrpc]
           [<ffffffffa0167450>] ? call_refreshresult+0x150/0x150 [sunrpc]
           [<ffffffffa0172640>] __rpc_execute+0x90/0x460 [sunrpc]
           [<ffffffffa0172a25>] rpc_async_schedule+0x15/0x20 [sunrpc]
           [<ffffffff810baa1b>] process_one_work+0x1bb/0x410
           [<ffffffff810bacc3>] worker_thread+0x53/0x480
           [<ffffffff810bac70>] ? process_one_work+0x410/0x410
           [<ffffffff810bac70>] ? process_one_work+0x410/0x410
           [<ffffffff810c0b38>] kthread+0xd8/0xf0
           [<ffffffff810c0a60>] ? kthread_worker_fn+0x180/0x180
           [<ffffffff817a1aa2>] ret_from_fork+0x42/0x70
           [<ffffffff810c0a60>] ? kthread_worker_fn+0x180/0x180
      
      Jean says:
      
      "Running locktests with a large number of iterations resulted in a
       client crash.  The test run took a while and hasn't finished after close
       to 2 hours. The crash happened right after I gave up and killed the test
       (after 107m) with Ctrl+C."
      
      The crash happened because a NULL inode pointer got passed into
      locks_get_lock_context. The call chain indicates that file_inode(filp)
      returned NULL, which means that f_inode was NULL. Since that's zeroed
      out in __fput, that suggests that this filp pointer outlived the last
      reference.
      
      Looking at the code, that seems possible. We copy the struct file_lock
      that's passed in, but if the task is signalled at an inopportune time we
      can end up trying to use that file_lock in rpciod context after the process
      that requested it has already returned (and possibly put its filp
      reference).
      
      Fix this by taking an extra reference to the filp when we allocate the
      lock info, and put it in nfs4_lock_release.
      Reported-by: default avatarJean Spector <jean@primarydata.com>
      Signed-off-by: default avatarJeff Layton <jeff.layton@primarydata.com>
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      bdece860
    • Miklos Szeredi's avatar
      fuse: initialize fc->release before calling it · 1cfdc447
      Miklos Szeredi authored
      [ Upstream commit 0ad0b325 ]
      
      fc->release is called from fuse_conn_put() which was used in the error
      cleanup before fc->release was initialized.
      
      [Jeremiah Mahler <jmmahler@gmail.com>: assign fc->release after calling
      fuse_conn_init(fc) instead of before.]
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      Fixes: a325f9b9 ("fuse: update fuse_conn_init() and separate out fuse_conn_kill()")
      Cc: <stable@vger.kernel.org> #v2.6.31+
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      1cfdc447
    • Ilya Dryomov's avatar
      rbd: use GFP_NOIO in rbd_obj_request_create() · 3e3deab3
      Ilya Dryomov authored
      [ Upstream commit 5a60e876 ]
      
      rbd_obj_request_create() is called on the main I/O path, so we need to
      use GFP_NOIO to make sure allocation doesn't blow back on us.  Not all
      callers need this, but I'm still hardcoding the flag inside rather than
      making it a parameter because a) this is going to stable, and b) those
      callers shouldn't really use rbd_obj_request_create() and will be fixed
      in the future.
      
      More memory allocation fixes will follow.
      
      Cc: stable@vger.kernel.org # 3.10+
      Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
      Reviewed-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      3e3deab3
    • Simon Guinot's avatar
      net: mvneta: disable IP checksum with jumbo frames for Armada 370 · 5ac8dc12
      Simon Guinot authored
      [ Upstream commit b65657fc ]
      
      The Ethernet controller found in the Armada 370, 380 and 385 SoCs don't
      support TCP/IP checksumming with frame sizes larger than 1600 bytes.
      
      This patch fixes the issue by disabling the features NETIF_F_IP_CSUM and
      NETIF_F_TSO for the Armada 370 and compatibles SoCs when the MTU is set
      to a value greater than 1600 bytes.
      Signed-off-by: default avatarSimon Guinot <simon.guinot@sequanux.org>
      Fixes: c5aff182 ("net: mvneta: driver for Marvell Armada 370/XP network unit")
      Cc: <stable@vger.kernel.org> # v3.8+
      Acked-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      5ac8dc12
    • Simon Guinot's avatar
      ARM: mvebu: update Ethernet compatible string for Armada XP · d5ced3d1
      Simon Guinot authored
      [ Upstream commit ea3b55fe ]
      
      This patch updates the Ethernet DT nodes for Armada XP SoCs with the
      compatible string "marvell,armada-xp-neta".
      Signed-off-by: default avatarSimon Guinot <simon.guinot@sequanux.org>
      Fixes: 77916519 ("arm: mvebu: Armada XP MV78230 has only three Ethernet interfaces")
      Cc: <stable@vger.kernel.org> # v3.8+
      Acked-by: default avatarGregory CLEMENT <gregory.clement@free-electrons.com>
      Reviewed-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      d5ced3d1
    • Simon Guinot's avatar
      net: mvneta: introduce compatible string "marvell, armada-xp-neta" · 8b0a9f5b
      Simon Guinot authored
      [ Upstream commit f522a975 ]
      
      The mvneta driver supports the Ethernet IP found in the Armada 370, XP,
      380 and 385 SoCs. Since at least one more hardware feature is available
      for the Armada XP SoCs then a way to identify them is needed.
      
      This patch introduces a new compatible string "marvell,armada-xp-neta".
      Signed-off-by: default avatarSimon Guinot <simon.guinot@sequanux.org>
      Fixes: c5aff182 ("net: mvneta: driver for Marvell Armada 370/XP network unit")
      Cc: <stable@vger.kernel.org> # v3.8+
      Acked-by: default avatarGregory CLEMENT <gregory.clement@free-electrons.com>
      Acked-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      8b0a9f5b
    • Jérôme Glisse's avatar
      drm/radeon: SDMA fix hibernation (CI GPU family). · 4a6adec5
      Jérôme Glisse authored
      [ Upstream commit 2ba8d1bb ]
      
      In order for hibernation to reliably work we need to properly turn
      off the SDMA block, sadly after numerous attemps i haven't not found
      proper sequence for clean and full shutdown. So simply reset both
      SDMA block, this makes hibernation works reliably on sea island GPU
      family (CI)
      
      Hibernation and suspend to ram were tested (several times) on :
      Bonaire
      Hawaii
      Mullins
      Kaveri
      Kabini
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJérôme Glisse <jglisse@redhat.com>
      Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      4a6adec5
    • Jérôme Glisse's avatar
      drm/radeon: compute ring fix hibernation (CI GPU family) v2. · bce1845b
      Jérôme Glisse authored
      [ Upstream commit 161569de ]
      
      In order for hibernation to reliably work we need to cleanup more
      thoroughly the compute ring. Hibernation is different from suspend
      resume as when we resume from hibernation the hardware is first
      fully initialize by regular kernel then freeze callback happens
      (which correspond to a suspend inside the radeon kernel driver)
      and turn off each of the block. It turns out we were not cleanly
      shutting down the compute ring. This patch fix that.
      
      Hibernation and suspend to ram were tested (several times) on :
      Bonaire
      Hawaii
      Mullins
      Kaveri
      Kabini
      
      Changed since v1:
        - Factor the ring stop logic into a function taking ring as arg.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJérôme Glisse <jglisse@redhat.com>
      Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      bce1845b
    • Chris Wilson's avatar
      agp/intel: Fix typo in needs_ilk_vtd_wa() · 9b424477
      Chris Wilson authored
      [ Upstream commit 8b572a42 ]
      
      In needs_ilk_vtd_wa(), we pass in the GPU device but compared it against
      the ids for the mobile GPU and the mobile host bridge. That latter is
      impossible and so likely was just a typo for the desktop GPU device id
      (which is also buggy).
      
      Fixes commit da88a5f7
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Wed Feb 13 09:31:53 2013 +0000
      
          drm/i915: Disable WC PTE updates to w/a buggy IOMMU on ILK
      Reported-by: default avatarTing-Wei Lan <lantw44@gmail.com>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91127
      References: https://bugzilla.freedesktop.org/show_bug.cgi?id=60391Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      9b424477
    • Takashi Iwai's avatar
      ALSA: hda - Fix the dock headphone output on Fujitsu Lifebook E780 · 4ead2784
      Takashi Iwai authored
      [ Upstream commit 4df3fd17 ]
      
      Fujitsu Lifebook E780 sets the sequence number 0x0f to only only of
      the two headphones, thus the driver tries to assign another as the
      line-out, and this results in the inconsistent mapping between the
      created jack ctl and the actual I/O.  Due to this, PulseAudio doesn't
      handle it properly and gets the silent output.
      
      The fix is to ignore the non-HP sequencer checks.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=99681
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      4ead2784
    • Takashi Iwai's avatar
      ALSA: hda - Add headset support to Acer Aspire V5 · b1afcca9
      Takashi Iwai authored
      [ Upstream commit 7819717b ]
      
      Acer Aspire V5 with ALC282 codec needs the similar quirk like Dell
      laptops to support the headset mic.  The headset mic pin is 0x19 and
      it's not exposed by BIOS, thus we need to fix the pincfg as well.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=96201
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      b1afcca9
    • Damian Eppel's avatar
      clocksource: exynos_mct: Avoid blocking calls in the cpu hotplug notifier · 9d7754d5
      Damian Eppel authored
      [ Upstream commit 56a94f13 ]
      
      Whilst testing cpu hotplug events on kernel configured with
      DEBUG_PREEMPT and DEBUG_ATOMIC_SLEEP we get following BUG message,
      caused by calling request_irq() and free_irq() in the context of
      hotplug notification (which is in this case atomic context).
      
      [   40.785859] CPU1: Software reset
      [   40.786660] BUG: sleeping function called from invalid context at mm/slub.c:1241
      [   40.786668] in_atomic(): 1, irqs_disabled(): 128, pid: 0, name: swapper/1
      [   40.786678] Preemption disabled at:[<  (null)>]   (null)
      [   40.786681]
      [   40.786692] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 3.19.0-rc4-00024-g7dca860 #36
      [   40.786698] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
      [   40.786728] [<c0014a00>] (unwind_backtrace) from [<c0011980>] (show_stack+0x10/0x14)
      [   40.786747] [<c0011980>] (show_stack) from [<c0449ba0>] (dump_stack+0x70/0xbc)
      [   40.786767] [<c0449ba0>] (dump_stack) from [<c00c6124>] (kmem_cache_alloc+0xd8/0x170)
      [   40.786785] [<c00c6124>] (kmem_cache_alloc) from [<c005d6f8>] (request_threaded_irq+0x64/0x128)
      [   40.786804] [<c005d6f8>] (request_threaded_irq) from [<c0350b8c>] (exynos4_local_timer_setup+0xc0/0x13c)
      [   40.786820] [<c0350b8c>] (exynos4_local_timer_setup) from [<c0350ca8>] (exynos4_mct_cpu_notify+0x30/0xa8)
      [   40.786838] [<c0350ca8>] (exynos4_mct_cpu_notify) from [<c003b330>] (notifier_call_chain+0x44/0x84)
      [   40.786857] [<c003b330>] (notifier_call_chain) from [<c0022fd4>] (__cpu_notify+0x28/0x44)
      [   40.786873] [<c0022fd4>] (__cpu_notify) from [<c0013714>] (secondary_start_kernel+0xec/0x150)
      [   40.786886] [<c0013714>] (secondary_start_kernel) from [<40008764>] (0x40008764)
      
      Interrupts cannot be requested/freed in the CPU_STARTING/CPU_DYING
      notifications which run on the hotplugged cpu with interrupts and
      preemption disabled.
      
      To avoid the issue, request the interrupts for all possible cpus in
      the boot code. The interrupts are marked NO_AUTOENABLE to avoid a racy
      request_irq/disable_irq() sequence. The flag prevents the
      request_irq() code from enabling the interrupt immediately.
      
      The interrupt is then enabled in the CPU_STARTING notifier of the
      hotplugged cpu and again disabled with disable_irq_nosync() in the
      CPU_DYING notifier.
      
      [ tglx: Massaged changelog to match the patch ]
      
      Fixes: 7114cd74 ("clocksource: exynos_mct: use (request/free)_irq calls for local timer registration")
      Reported-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Reviewed-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Tested-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Tested-by: default avatarMarcin Jabrzyk <m.jabrzyk@samsung.com>
      Signed-off-by: default avatarDamian Eppel <d.eppel@samsung.com>
      Cc: m.szyprowski@samsung.com
      Cc: kyungmin.park@samsung.com
      Cc: daniel.lezcano@linaro.org
      Cc: kgene@kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Link: http://lkml.kernel.org/r/1435324984-7328-1-git-send-email-d.eppel@samsung.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      9d7754d5
    • Steven Rostedt (Red Hat)'s avatar
      tracing/filter: Do not allow infix to exceed end of string · 3341f6c1
      Steven Rostedt (Red Hat) authored
      [ Upstream commit 6b88f44e ]
      
      While debugging a WARN_ON() for filtering, I found that it is possible
      for the filter string to be referenced after its end. With the filter:
      
       # echo '>' > /sys/kernel/debug/events/ext4/ext4_truncate_exit/filter
      
      The filter_parse() function can call infix_get_op() which calls
      infix_advance() that updates the infix filter pointers for the cnt
      and tail without checking if the filter is already at the end, which
      will put the cnt to zero and the tail beyond the end. The loop then calls
      infix_next() that has
      
      	ps->infix.cnt--;
      	return ps->infix.string[ps->infix.tail++];
      
      The cnt will now be below zero, and the tail that is returned is
      already passed the end of the filter string. So far the allocation
      of the filter string usually has some buffer that is zeroed out, but
      if the filter string is of the exact size of the allocated buffer
      there's no guarantee that the charater after the nul terminating
      character will be zero.
      
      Luckily, only root can write to the filter.
      
      Cc: stable@vger.kernel.org # 2.6.33+
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      3341f6c1
    • Michael Holzheu's avatar
      s390/kdump: fix REGSET_VX_LOW vector register ELF notes · 701f26a0
      Michael Holzheu authored
      [ Upstream commit 3c8e5105 ]
      
      The REGSET_VX_LOW ELF notes should contain the lower 64 bit halfes of the
      first sixteen 128 bit vector registers. Unfortunately currently we copy
      the upper halfes.
      
      Fix this and correctly copy the lower halfes.
      
      Fixes: a62bc073 ("s390/kdump: add support for vector extension")
      Cc: stable@vger.kernel.org # 3.18+
      Signed-off-by: default avatarMichael Holzheu <holzheu@linux.vnet.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      701f26a0
    • Alex Deucher's avatar
      ALSA: hda - set proper caps for newer AMD hda audio in KB/KV · b0634d40
      Alex Deucher authored
      [ Upstream commit 650474fb ]
      
      Fixes audio problems on newer asics.
      
      Noticed by: Kelly Anderson <kelly@xilka.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      b0634d40
    • David Henningsson's avatar
      ALSA: hda - Fix Dock Headphone on Thinkpad X250 seen as a Line Out · 0a243057
      David Henningsson authored
      [ Upstream commit ec56af67 ]
      
      Thinkpad X250, when attached to a dock, has two headphone outs but
      no line out. Make sure we don't try to turn this into one headphone
      and one line out (since that disables the headphone amp on the dock).
      
      Alsa-info at http://www.alsa-project.org/db/?f=36f8764e1d782397928feec715d0ef90dfddd4c1
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarDavid Henningsson <david.henningsson@canonical.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      0a243057
    • Larry Finger's avatar
      mm: kmemleak_alloc_percpu() should follow the gfp from per_alloc() · 8d83667e
      Larry Finger authored
      [ Upstream commit 8a8c35fa ]
      
      Beginning at commit d52d3997 ("ipv6: Create percpu rt6_info"), the
      following INFO splat is logged:
      
        ===============================
        [ INFO: suspicious RCU usage. ]
        4.1.0-rc7-next-20150612 #1 Not tainted
        -------------------------------
        kernel/sched/core.c:7318 Illegal context switch in RCU-bh read-side critical section!
        other info that might help us debug this:
        rcu_scheduler_active = 1, debug_locks = 0
         3 locks held by systemd/1:
         #0:  (rtnl_mutex){+.+.+.}, at: [<ffffffff815f0c8f>] rtnetlink_rcv+0x1f/0x40
         #1:  (rcu_read_lock_bh){......}, at: [<ffffffff816a34e2>] ipv6_add_addr+0x62/0x540
         #2:  (addrconf_hash_lock){+...+.}, at: [<ffffffff816a3604>] ipv6_add_addr+0x184/0x540
        stack backtrace:
        CPU: 0 PID: 1 Comm: systemd Not tainted 4.1.0-rc7-next-20150612 #1
        Hardware name: TOSHIBA TECRA A50-A/TECRA A50-A, BIOS Version 4.20   04/17/2014
        Call Trace:
          dump_stack+0x4c/0x6e
          lockdep_rcu_suspicious+0xe7/0x120
          ___might_sleep+0x1d5/0x1f0
          __might_sleep+0x4d/0x90
          kmem_cache_alloc+0x47/0x250
          create_object+0x39/0x2e0
          kmemleak_alloc_percpu+0x61/0xe0
          pcpu_alloc+0x370/0x630
      
      Additional backtrace lines are truncated.  In addition, the above splat
      is followed by several "BUG: sleeping function called from invalid
      context at mm/slub.c:1268" outputs.  As suggested by Martin KaFai Lau,
      these are the clue to the fix.  Routine kmemleak_alloc_percpu() always
      uses GFP_KERNEL for its allocations, whereas it should follow the gfp
      from its callers.
      Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Reviewed-by: default avatarKamalesh Babulal <kamalesh@linux.vnet.ibm.com>
      Acked-by: default avatarMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Cc: Martin KaFai Lau <kafai@fb.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Christoph Lameter <cl@linux-foundation.org>
      Cc: <stable@vger.kernel.org>	[3.18+]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      8d83667e
    • Catalin Marinas's avatar
      mm: kmemleak: allow safe memory scanning during kmemleak disabling · 53109852
      Catalin Marinas authored
      [ Upstream commit c5f3b1a5 ]
      
      The kmemleak scanning thread can run for minutes.  Callbacks like
      kmemleak_free() are allowed during this time, the race being taken care
      of by the object->lock spinlock.  Such lock also prevents a memory block
      from being freed or unmapped while it is being scanned by blocking the
      kmemleak_free() -> ...  -> __delete_object() function until the lock is
      released in scan_object().
      
      When a kmemleak error occurs (e.g.  it fails to allocate its metadata),
      kmemleak_enabled is set and __delete_object() is no longer called on
      freed objects.  If kmemleak_scan is running at the same time,
      kmemleak_free() no longer waits for the object scanning to complete,
      allowing the corresponding memory block to be freed or unmapped (in the
      case of vfree()).  This leads to kmemleak_scan potentially triggering a
      page fault.
      
      This patch separates the kmemleak_free() enabling/disabling from the
      overall kmemleak_enabled nob so that we can defer the disabling of the
      object freeing tracking until the scanning thread completed.  The
      kmemleak_free_part() is deliberately ignored by this patch since this is
      only called during boot before the scanning thread started.
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Reported-by: default avatarVignesh Radhakrishnan <vigneshr@codeaurora.org>
      Tested-by: default avatarVignesh Radhakrishnan <vigneshr@codeaurora.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      53109852
    • Vineet Gupta's avatar
      ARC: add smp barriers around atomics per Documentation/atomic_ops.txt · e965e3a1
      Vineet Gupta authored
      [ Upstream commit 2576c28e ]
      
       - arch_spin_lock/unlock were lacking the ACQUIRE/RELEASE barriers
         Since ARCv2 only provides load/load, store/store and all/all, we need
         the full barrier
      
       - LLOCK/SCOND based atomics, bitops, cmpxchg, which return modified
         values were lacking the explicit smp barriers.
      
       - Non LLOCK/SCOND varaints don't need the explicit barriers since that
         is implicity provided by the spin locks used to implement the
         critical section (the spin lock barriers in turn are also fixed in
         this commit as explained above
      
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: stable@vger.kernel.org
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      e965e3a1
    • Vineet Gupta's avatar
      ARC: add compiler barrier to LLSC based cmpxchg · c71c2487
      Vineet Gupta authored
      [ Upstream commit d57f7272 ]
      
      When auditing cmpxchg call sites, Chuck noted that gcc was optimizing
      away some of the desired LDs.
      
      |	do {
      |		new = old = *ipi_data_ptr;
      |		new |= 1U << msg;
      |	} while (cmpxchg(ipi_data_ptr, old, new) != old);
      
      was generating to below
      
      | 8015cef8:	ld         r2,[r4,0]  <-- First LD
      | 8015cefc:	bset       r1,r2,r1
      |
      | 8015cf00:	llock      r3,[r4]  <-- atomic op
      | 8015cf04:	brne       r3,r2,8015cf10
      | 8015cf08:	scond      r1,[r4]
      | 8015cf0c:	bnz        8015cf00
      |
      | 8015cf10:	brne       r3,r2,8015cf00  <-- Branch doesn't go to orig LD
      
      Although this was fixed by adding a ACCESS_ONCE in this call site, it
      seems safer (for now at least) to add compiler barrier to LLSC based
      cmpxchg
      Reported-by: default avatarChuck Jordan <cjordan@synopsys,com>
      Cc: <stable@vger.kernel.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      c71c2487
    • Takashi Iwai's avatar
      PM / sleep: Increase default DPM watchdog timeout to 60 · 8e15f153
      Takashi Iwai authored
      [ Upstream commit fff3b16d ]
      
      Many harddisks (mostly WD ones) have firmware problems and take too
      long, more than 10 seconds, to resume from suspend.  And this often
      exceeds the default DPM watchdog timeout (12 seconds), resulting in a
      kernel panic out of sudden.
      
      Since most distros just take the default as is, we should give a bit
      more safer value.  This patch increases the default value from 12
      seconds to one minute, which has been confirmed to be long enough for
      such problematic disks.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=91921
      Fixes: 70fea60d (PM / Sleep: Detect device suspend/resume lockup and log event)
      Cc: 3.13+ <stable@vger.kernel.org> # 3.13+
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      8e15f153
    • Alexey Brodkin's avatar
      stmmac: troubleshoot unexpected bits in des0 & des1 · d89e99a3
      Alexey Brodkin authored
      [ Upstream commit f1590670 ]
      
      Current implementation of descriptor init procedure only takes
      care about setting/clearing ownership flag in "des0"/"des1"
      fields while it is perfectly possible to get unexpected bits
      set because of the following factors:
      
       [1] On driver probe underlying memory allocated with
           dma_alloc_coherent() might not be zeroed and so
           it will be filled with garbage.
      
       [2] During driver operation some bits could be set by SD/MMC
           controller (for example error flags etc).
      
      And unexpected and/or randomly set flags in "des0"/"des1"
      fields may lead to unpredictable behavior of GMAC DMA block.
      
      This change addresses both items above with:
      
       [1] Use of dma_zalloc_coherent() instead of simple
           dma_alloc_coherent() to make sure allocated memory is
           zeroed. That shouldn't affect performance because
           this allocation only happens once on driver probe.
      
       [2] Do explicit zeroing of both "des0" and "des1" fields
           of all buffer descriptors during initialization of
           DMA transfer.
      
      And while at it fixed identation of dma_free_coherent()
      counterpart as well.
      Signed-off-by: default avatarAlexey Brodkin <abrodkin@synopsys.com>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: arc-linux-dev@synopsys.com
      Cc: linux-kernel@vger.kernel.org
      Cc: stable@vger.kernel.org
      Cc: David Miller <davem@davemloft.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      d89e99a3
    • Jingoo Han's avatar
      of/address: use atomic allocation in pci_register_io_range() · d42b6b46
      Jingoo Han authored
      [ Upstream commit 294240ff ]
      
      When kzalloc() is called under spin_lock(), GFP_ATOMIC should be
      used to avoid sleeping allocation.
      The call tree is:
        of_pci_range_to_resource()
          --> pci_register_io_range() <-- takes spin_lock(&io_range_lock);
             --> kzalloc()
      Signed-off-by: default avatarJingoo Han <jingoohan1@gmail.com>
      Cc: stable@vger.kernel.org # 3.18+
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      d42b6b46
    • Eric W. Biederman's avatar
      netfilter: nf_qeueue: Drop queue entries on nf_unregister_hook · b396bdb5
      Eric W. Biederman authored
      [ Upstream commit 8405a8ff ]
      
      Add code to nf_unregister_hook to flush the nf_queue when a hook is
      unregistered.  This guarantees that the pointer that the nf_queue code
      retains into the nf_hook list will remain valid while a packet is
      queued.
      
      I tested what would happen if we do not flush queued packets and was
      trivially able to obtain the oops below.  All that was required was
      to stop the nf_queue listening process, to delete all of the nf_tables,
      and to awaken the nf_queue listening process.
      
      > BUG: unable to handle kernel paging request at 0000000100000001
      > IP: [<0000000100000001>] 0x100000001
      > PGD b9c35067 PUD 0
      > Oops: 0010 [#1] SMP
      > Modules linked in:
      > CPU: 0 PID: 519 Comm: lt-nfqnl_test Not tainted
      > task: ffff8800b9c8c050 ti: ffff8800ba9d8000 task.ti: ffff8800ba9d8000
      > RIP: 0010:[<0000000100000001>]  [<0000000100000001>] 0x100000001
      > RSP: 0018:ffff8800ba9dba40  EFLAGS: 00010a16
      > RAX: ffff8800bab48a00 RBX: ffff8800ba9dba90 RCX: ffff8800ba9dba90
      > RDX: ffff8800b9c10128 RSI: ffff8800ba940900 RDI: ffff8800bab48a00
      > RBP: ffff8800b9c10128 R08: ffffffff82976660 R09: ffff8800ba9dbb28
      > R10: dead000000100100 R11: dead000000200200 R12: ffff8800ba940900
      > R13: ffffffff8313fd50 R14: ffff8800b9c95200 R15: 0000000000000000
      > FS:  00007fb91fc34700(0000) GS:ffff8800bfa00000(0000) knlGS:0000000000000000
      > CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      > CR2: 0000000100000001 CR3: 00000000babfb000 CR4: 00000000000007f0
      > Stack:
      >  ffffffff8206ab0f ffffffff82982240 ffff8800bab48a00 ffff8800b9c100a8
      >  ffff8800b9c10100 0000000000000001 ffff8800ba940900 ffff8800b9c10128
      >  ffffffff8206bd65 ffff8800bfb0d5e0 ffff8800bab48a00 0000000000014dc0
      > Call Trace:
      >  [<ffffffff8206ab0f>] ? nf_iterate+0x4f/0xa0
      >  [<ffffffff8206bd65>] ? nf_reinject+0x125/0x190
      >  [<ffffffff8206dee5>] ? nfqnl_recv_verdict+0x255/0x360
      >  [<ffffffff81386290>] ? nla_parse+0x80/0xf0
      >  [<ffffffff8206c42c>] ? nfnetlink_rcv_msg+0x13c/0x240
      >  [<ffffffff811b2fec>] ? __memcg_kmem_get_cache+0x4c/0x150
      >  [<ffffffff8206c2f0>] ? nfnl_lock+0x20/0x20
      >  [<ffffffff82068159>] ? netlink_rcv_skb+0xa9/0xc0
      >  [<ffffffff820677bf>] ? netlink_unicast+0x12f/0x1c0
      >  [<ffffffff82067ade>] ? netlink_sendmsg+0x28e/0x650
      >  [<ffffffff81fdd814>] ? sock_sendmsg+0x44/0x50
      >  [<ffffffff81fde07b>] ? ___sys_sendmsg+0x2ab/0x2c0
      >  [<ffffffff810e8f73>] ? __wake_up+0x43/0x70
      >  [<ffffffff8141a134>] ? tty_write+0x1c4/0x2a0
      >  [<ffffffff81fde9f4>] ? __sys_sendmsg+0x44/0x80
      >  [<ffffffff823ff8d7>] ? system_call_fastpath+0x12/0x6a
      > Code:  Bad RIP value.
      > RIP  [<0000000100000001>] 0x100000001
      >  RSP <ffff8800ba9dba40>
      > CR2: 0000000100000001
      > ---[ end trace 08eb65d42362793f ]---
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      b396bdb5
    • Ralf Baechle's avatar
      NET: ROSE: Don't dereference NULL neighbour pointer. · d46c266a
      Ralf Baechle authored
      [ Upstream commit d496f784 ]
      
      A ROSE socket doesn't necessarily always have a neighbour pointer so check
      if the neighbour pointer is valid before dereferencing it.
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      Tested-by: default avatarBernard Pidoux <f6bvp@free.fr>
      Cc: stable@vger.kernel.org #2.6.11+
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      d46c266a
    • Dave Airlie's avatar
      drm/dp/mst: take lock around looking up the branch device on hpd irq · c44ed568
      Dave Airlie authored
      [ Upstream commit 9eb1e57f ]
      
      If we are doing an MST transaction and we've gotten HPD and we
      lookup the device from the incoming msg, we should take the mgr
      lock around it, so that mst_primary and mstb->ports are valid.
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      c44ed568
    • Daniel Vetter's avatar
      drm/dp/mst: make sure mst_primary mstb is valid in work function · 0e266aad
      Daniel Vetter authored
      [ Upstream commit 9254ec49 ]
      
      This validates the mst_primary under the lock, and then calls
      into the check and send function. This makes the code a lot
      easier to understand the locking rules in.
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      0e266aad
    • Darrick J. Wong's avatar
      ext4: don't retry file block mapping on bigalloc fs with non-extent file · 9b7da0c6
      Darrick J. Wong authored
      [ Upstream commit 292db1bc ]
      
      ext4 isn't willing to map clusters to a non-extent file.  Don't signal
      this with an out of space error, since the FS will retry the
      allocation (which didn't fail) forever.  Instead, return EUCLEAN so
      that the operation will fail immediately all the way back to userspace.
      
      (The fix is either to run e2fsck -E bmap2extent, or to chattr +e the file.)
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      9b7da0c6
    • Eric Sandeen's avatar
      xfs: fix remote symlinks on V5/CRC filesystems · c56932bd
      Eric Sandeen authored
      [ Upstream commit 2ac56d3d ]
      
      If we create a CRC filesystem, mount it, and create a symlink with
      a path long enough that it can't live in the inode, we get a very
      strange result upon remount:
      
      # ls -l mnt
      total 4
      lrwxrwxrwx. 1 root root 929 Jun 15 16:58 link -> XSLM
      
      XSLM is the V5 symlink block header magic (which happens to be
      followed by a NUL, so the string looks terminated).
      
      xfs_readlink_bmap() advanced cur_chunk by the size of the header
      for CRC filesystems, but never actually used that pointer; it
      kept reading from bp->b_addr, which is the start of the block,
      rather than the start of the symlink data after the header.
      
      Looks like this problem goes back to v3.10.
      
      Fixing this gets us reading the proper link target, again.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
      Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
      Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      c56932bd
    • James Hogan's avatar
      MIPS: Fix KVM guest fixmap address · 19194bca
      James Hogan authored
      [ Upstream commit 8e748c8d ]
      
      KVM guest kernels for trap & emulate run in user mode, with a modified
      set of kernel memory segments. However the fixmap address is still in
      the normal KSeg3 region at 0xfffe0000 regardless, causing problems when
      cache alias handling makes use of them when handling copy on write.
      
      Therefore define FIXADDR_TOP as 0x7ffe0000 in the guest kernel mapped
      region when CONFIG_KVM_GUEST is defined.
      Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: <stable@vger.kernel.org> # v3.10+
      Patchwork: https://patchwork.linux-mips.org/patch/9887/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      19194bca
  2. 04 Jul, 2015 10 commits