1. 08 Apr, 2018 19 commits
    • Leon Romanovsky's avatar
      RDMA/ucma: Check AF family prior resolving address · 123f9f89
      Leon Romanovsky authored
      commit 2975d5de upstream.
      
      Garbage supplied by user will cause to UCMA module provide zero
      memory size for memcpy(), because it wasn't checked, it will
      produce unpredictable results in rdma_resolve_addr().
      
      [   42.873814] BUG: KASAN: null-ptr-deref in rdma_resolve_addr+0xc8/0xfb0
      [   42.874816] Write of size 28 at addr 00000000000000a0 by task resaddr/1044
      [   42.876765]
      [   42.876960] CPU: 1 PID: 1044 Comm: resaddr Not tainted 4.16.0-rc1-00057-gaa56a5293d7e #34
      [   42.877840] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.11.0-0-g63451fca13-prebuilt.qemu-project.org 04/01/2014
      [   42.879691] Call Trace:
      [   42.880236]  dump_stack+0x5c/0x77
      [   42.880664]  kasan_report+0x163/0x380
      [   42.881354]  ? rdma_resolve_addr+0xc8/0xfb0
      [   42.881864]  memcpy+0x34/0x50
      [   42.882692]  rdma_resolve_addr+0xc8/0xfb0
      [   42.883366]  ? deref_stack_reg+0x88/0xd0
      [   42.883856]  ? vsnprintf+0x31a/0x770
      [   42.884686]  ? rdma_bind_addr+0xc40/0xc40
      [   42.885327]  ? num_to_str+0x130/0x130
      [   42.885773]  ? deref_stack_reg+0x88/0xd0
      [   42.886217]  ? __read_once_size_nocheck.constprop.6+0x10/0x10
      [   42.887698]  ? unwind_get_return_address_ptr+0x50/0x50
      [   42.888302]  ? replace_slot+0x147/0x170
      [   42.889176]  ? delete_node+0x12c/0x340
      [   42.890223]  ? __radix_tree_lookup+0xa9/0x160
      [   42.891196]  ? ucma_resolve_ip+0xb7/0x110
      [   42.891917]  ucma_resolve_ip+0xb7/0x110
      [   42.893003]  ? ucma_resolve_addr+0x190/0x190
      [   42.893531]  ? _copy_from_user+0x5e/0x90
      [   42.894204]  ucma_write+0x174/0x1f0
      [   42.895162]  ? ucma_resolve_route+0xf0/0xf0
      [   42.896309]  ? dequeue_task_fair+0x67e/0xd90
      [   42.897192]  ? put_prev_entity+0x7d/0x170
      [   42.897870]  ? ring_buffer_record_is_on+0xd/0x20
      [   42.898439]  ? tracing_record_taskinfo_skip+0x20/0x50
      [   42.899686]  __vfs_write+0xc4/0x350
      [   42.900142]  ? kernel_read+0xa0/0xa0
      [   42.900602]  ? firmware_map_remove+0xdf/0xdf
      [   42.901135]  ? do_task_dead+0x5d/0x60
      [   42.901598]  ? do_exit+0xcc6/0x1220
      [   42.902789]  ? __fget+0xa8/0xf0
      [   42.903190]  vfs_write+0xf7/0x280
      [   42.903600]  SyS_write+0xa1/0x120
      [   42.904206]  ? SyS_read+0x120/0x120
      [   42.905710]  ? compat_start_thread+0x60/0x60
      [   42.906423]  ? SyS_read+0x120/0x120
      [   42.908716]  do_syscall_64+0xeb/0x250
      [   42.910760]  entry_SYSCALL_64_after_hwframe+0x21/0x86
      [   42.912735] RIP: 0033:0x7f138b0afe99
      [   42.914734] RSP: 002b:00007f138b799e98 EFLAGS: 00000287 ORIG_RAX: 0000000000000001
      [   42.917134] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f138b0afe99
      [   42.919487] RDX: 000000000000002e RSI: 0000000020000c40 RDI: 0000000000000004
      [   42.922393] RBP: 00007f138b799ec0 R08: 00007f138b79a700 R09: 0000000000000000
      [   42.925266] R10: 00007f138b79a700 R11: 0000000000000287 R12: 00007f138b799fc0
      [   42.927570] R13: 0000000000000000 R14: 00007ffdbae757c0 R15: 00007f138b79a9c0
      [   42.930047]
      [   42.932681] Disabling lock debugging due to kernel taint
      [   42.934795] BUG: unable to handle kernel NULL pointer dereference at 00000000000000a0
      [   42.936939] IP: memcpy_erms+0x6/0x10
      [   42.938864] PGD 80000001bea92067 P4D 80000001bea92067 PUD 1bea96067 PMD 0
      [   42.941576] Oops: 0002 [#1] SMP KASAN PTI
      [   42.943952] CPU: 1 PID: 1044 Comm: resaddr Tainted: G    B 4.16.0-rc1-00057-gaa56a5293d7e #34
      [   42.946964] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.11.0-0-g63451fca13-prebuilt.qemu-project.org 04/01/2014
      [   42.952336] RIP: 0010:memcpy_erms+0x6/0x10
      [   42.954707] RSP: 0018:ffff8801c8b479c8 EFLAGS: 00010286
      [   42.957227] RAX: 00000000000000a0 RBX: ffff8801c8b47ba0 RCX: 000000000000001c
      [   42.960543] RDX: 000000000000001c RSI: ffff8801c8b47bbc RDI: 00000000000000a0
      [   42.963867] RBP: ffff8801c8b47b60 R08: 0000000000000000 R09: ffffed0039168ed1
      [   42.967303] R10: 0000000000000001 R11: ffffed0039168ed0 R12: ffff8801c8b47bbc
      [   42.970685] R13: 00000000000000a0 R14: 1ffff10039168f4a R15: 0000000000000000
      [   42.973631] FS:  00007f138b79a700(0000) GS:ffff8801e5d00000(0000) knlGS:0000000000000000
      [   42.976831] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   42.979239] CR2: 00000000000000a0 CR3: 00000001be908002 CR4: 00000000003606a0
      [   42.982060] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [   42.984877] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [   42.988033] Call Trace:
      [   42.990487]  rdma_resolve_addr+0xc8/0xfb0
      [   42.993202]  ? deref_stack_reg+0x88/0xd0
      [   42.996055]  ? vsnprintf+0x31a/0x770
      [   42.998707]  ? rdma_bind_addr+0xc40/0xc40
      [   43.000985]  ? num_to_str+0x130/0x130
      [   43.003410]  ? deref_stack_reg+0x88/0xd0
      [   43.006302]  ? __read_once_size_nocheck.constprop.6+0x10/0x10
      [   43.008780]  ? unwind_get_return_address_ptr+0x50/0x50
      [   43.011178]  ? replace_slot+0x147/0x170
      [   43.013517]  ? delete_node+0x12c/0x340
      [   43.016019]  ? __radix_tree_lookup+0xa9/0x160
      [   43.018755]  ? ucma_resolve_ip+0xb7/0x110
      [   43.021270]  ucma_resolve_ip+0xb7/0x110
      [   43.023968]  ? ucma_resolve_addr+0x190/0x190
      [   43.026312]  ? _copy_from_user+0x5e/0x90
      [   43.029384]  ucma_write+0x174/0x1f0
      [   43.031861]  ? ucma_resolve_route+0xf0/0xf0
      [   43.034782]  ? dequeue_task_fair+0x67e/0xd90
      [   43.037483]  ? put_prev_entity+0x7d/0x170
      [   43.040215]  ? ring_buffer_record_is_on+0xd/0x20
      [   43.042990]  ? tracing_record_taskinfo_skip+0x20/0x50
      [   43.045595]  __vfs_write+0xc4/0x350
      [   43.048624]  ? kernel_read+0xa0/0xa0
      [   43.051604]  ? firmware_map_remove+0xdf/0xdf
      [   43.055379]  ? do_task_dead+0x5d/0x60
      [   43.058000]  ? do_exit+0xcc6/0x1220
      [   43.060783]  ? __fget+0xa8/0xf0
      [   43.063133]  vfs_write+0xf7/0x280
      [   43.065677]  SyS_write+0xa1/0x120
      [   43.068647]  ? SyS_read+0x120/0x120
      [   43.071179]  ? compat_start_thread+0x60/0x60
      [   43.074025]  ? SyS_read+0x120/0x120
      [   43.076705]  do_syscall_64+0xeb/0x250
      [   43.079006]  entry_SYSCALL_64_after_hwframe+0x21/0x86
      [   43.081606] RIP: 0033:0x7f138b0afe99
      [   43.083679] RSP: 002b:00007f138b799e98 EFLAGS: 00000287 ORIG_RAX: 0000000000000001
      [   43.086802] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f138b0afe99
      [   43.089989] RDX: 000000000000002e RSI: 0000000020000c40 RDI: 0000000000000004
      [   43.092866] RBP: 00007f138b799ec0 R08: 00007f138b79a700 R09: 0000000000000000
      [   43.096233] R10: 00007f138b79a700 R11: 0000000000000287 R12: 00007f138b799fc0
      [   43.098913] R13: 0000000000000000 R14: 00007ffdbae757c0 R15: 00007f138b79a9c0
      [   43.101809] Code: 90 90 90 90 90 eb 1e 0f 1f 00 48 89 f8 48 89 d1 48
      c1 e9 03 83 e2 07 f3 48 a5 89 d1 f3 a4 c3 66 0f 1f 44 00 00 48 89 f8 48
      89 d1 <f3> a4 c3 0f 1f 80 00 00 00 00 48 89 f8 48 83 fa 20 72 7e 40 38
      [   43.107950] RIP: memcpy_erms+0x6/0x10 RSP: ffff8801c8b479c8
      
      Reported-by: <syzbot+1d8c43206853b369d00c@syzkaller.appspotmail.com>
      Fixes: 75216638 ("RDMA/cma: Export rdma cm interface to userspace")
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Reviewed-by: default avatarSean Hefty <sean.hefty@intel.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      123f9f89
    • Florian Westphal's avatar
      xfrm_user: uncoditionally validate esn replay attribute struct · 25fd02ea
      Florian Westphal authored
      commit d97ca5d7 upstream.
      
      The sanity test added in ecd79187 can be bypassed, validation
      only occurs if XFRM_STATE_ESN flag is set, but rest of code doesn't care
      and just checks if the attribute itself is present.
      
      So always validate.  Alternative is to reject if we have the attribute
      without the flag but that would change abi.
      
      Reported-by: syzbot+0ab777c27d2bb7588f73@syzkaller.appspotmail.com
      Cc: Mathias Krause <minipli@googlemail.com>
      Fixes: ecd79187 ("xfrm_user: ensure user supplied esn replay window is valid")
      Fixes: d8647b79 ("xfrm: Add user interface for esn and big anti-replay windows")
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      25fd02ea
    • Richard Narron's avatar
      partitions/msdos: Unable to mount UFS 44bsd partitions · ac2cb9f3
      Richard Narron authored
      commit 5f15684b upstream.
      
      UFS partitions from newer versions of FreeBSD 10 and 11 use relative
      addressing for their subpartitions. But older versions of FreeBSD still
      use absolute addressing just like OpenBSD and NetBSD.
      
      Instead of simply testing for a FreeBSD partition, the code needs to
      also test if the starting offset of the C subpartition is zero.
      
      https://bugzilla.kernel.org/show_bug.cgi?id=197733Signed-off-by: default avatarRichard Narron <comet.berkeley@gmail.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ac2cb9f3
    • Nicholas Piggin's avatar
      powerpc/64s: Fix i-side SLB miss bad address handler saving nonvolatile GPRs · 0726ba04
      Nicholas Piggin authored
      commit 52396500 upstream.
      
      The SLB bad address handler's trap number fixup does not preserve the
      low bit that indicates nonvolatile GPRs have not been saved. This
      leads save_nvgprs to skip saving them, and subsequent functions and
      return from interrupt will think they are saved.
      
      This causes kernel branch-to-garbage debugging to not have correct
      registers, can also cause userspace to have its registers clobbered
      after a segfault.
      
      Fixes: f0f558b1 ("powerpc/mm: Preserve CFAR value on SLB miss caused by access to bogus address")
      Cc: stable@vger.kernel.org # v4.9+
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0726ba04
    • Nicholas Piggin's avatar
      powerpc/64s: Fix lost pending interrupt due to race causing lost update to irq_happened · 4c6d2518
      Nicholas Piggin authored
      commit ff6781fd upstream.
      
      force_external_irq_replay() can be called in the do_IRQ path with
      interrupts hard enabled and soft disabled if may_hard_irq_enable() set
      MSR[EE]=1. It updates local_paca->irq_happened with a load, modify,
      store sequence. If a maskable interrupt hits during this sequence, it
      will go to the masked handler to be marked pending in irq_happened.
      This update will be lost when the interrupt returns and the store
      instruction executes. This can result in unpredictable latencies,
      timeouts, lockups, etc.
      
      Fix this by ensuring hard interrupts are disabled before modifying
      irq_happened.
      
      This could cause any maskable asynchronous interrupt to get lost, but
      it was noticed on P9 SMP system doing RDMA NVMe target over 100GbE,
      so very high external interrupt rate and high IPI rate. The hang was
      bisected down to enabling doorbell interrupts for IPIs. These provided
      an interrupt type that could run at high rates in the do_IRQ path,
      stressing the race.
      
      Fixes: 1d607bb3 ("powerpc/irq: Add mechanism to force a replay of interrupts")
      Cc: stable@vger.kernel.org # v4.8+
      Reported-by: default avatarCarol L. Soto <clsoto@us.ibm.com>
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4c6d2518
    • Pierre-Yves MORDRET's avatar
      i2c: i2c-stm32f7: fix no check on returned setup · 834a06e5
      Pierre-Yves MORDRET authored
      commit 771b7bf0 upstream.
      
      Before assigning returned setup structure check if not null
      
      Fixes: 463a9215 ("i2c: stm32f7: fix setup structure")
      Signed-off-by: default avatarPierre-Yves MORDRET <pierre-yves.mordret@st.com>
      Acked-by: default avatarAlexandre TORGUE <alexandre.torgue@st.com>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      Cc: stable@kernel.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      834a06e5
    • Mike Kravetz's avatar
      ipc/shm.c: add split function to shm_vm_ops · f025072c
      Mike Kravetz authored
      commit 3d942ee0 upstream.
      
      If System V shmget/shmat operations are used to create a hugetlbfs
      backed mapping, it is possible to munmap part of the mapping and split
      the underlying vma such that it is not huge page aligned.  This will
      untimately result in the following BUG:
      
        kernel BUG at /build/linux-jWa1Fv/linux-4.15.0/mm/hugetlb.c:3310!
        Oops: Exception in kernel mode, sig: 5 [#1]
        LE SMP NR_CPUS=2048 NUMA PowerNV
        Modules linked in: kcm nfc af_alg caif_socket caif phonet fcrypt
        CPU: 18 PID: 43243 Comm: trinity-subchil Tainted: G         C  E 4.15.0-10-generic #11-Ubuntu
        NIP:  c00000000036e764 LR: c00000000036ee48 CTR: 0000000000000009
        REGS: c000003fbcdcf810 TRAP: 0700   Tainted: G         C  E (4.15.0-10-generic)
        MSR:  9000000000029033 <SF,HV,EE,ME,IR,DR,RI,LE>  CR: 24002222  XER: 20040000
        CFAR: c00000000036ee44 SOFTE: 1
        NIP __unmap_hugepage_range+0xa4/0x760
        LR __unmap_hugepage_range_final+0x28/0x50
        Call Trace:
          0x7115e4e00000 (unreliable)
          __unmap_hugepage_range_final+0x28/0x50
          unmap_single_vma+0x11c/0x190
          unmap_vmas+0x94/0x140
          exit_mmap+0x9c/0x1d0
          mmput+0xa8/0x1d0
          do_exit+0x360/0xc80
          do_group_exit+0x60/0x100
          SyS_exit_group+0x24/0x30
          system_call+0x58/0x6c
        ---[ end trace ee88f958a1c62605 ]---
      
      This bug was introduced by commit 31383c68 ("mm, hugetlbfs:
      introduce ->split() to vm_operations_struct").  A split function was
      added to vm_operations_struct to determine if a mapping can be split.
      This was mostly for device-dax and hugetlbfs mappings which have
      specific alignment constraints.
      
      Mappings initiated via shmget/shmat have their original vm_ops
      overwritten with shm_vm_ops.  shm_vm_ops functions will call back to the
      original vm_ops if needed.  Add such a split function to shm_vm_ops.
      
      Link: http://lkml.kernel.org/r/20180321161314.7711-1-mike.kravetz@oracle.com
      Fixes: 31383c68 ("mm, hugetlbfs: introduce ->split() to vm_operations_struct")
      Signed-off-by: default avatarMike Kravetz <mike.kravetz@oracle.com>
      Reported-by: default avatarLaurent Dufour <ldufour@linux.vnet.ibm.com>
      Reviewed-by: default avatarLaurent Dufour <ldufour@linux.vnet.ibm.com>
      Tested-by: default avatarLaurent Dufour <ldufour@linux.vnet.ibm.com>
      Reviewed-by: default avatarDan Williams <dan.j.williams@intel.com>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Manfred Spraul <manfred@colorfullife.com>
      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 avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f025072c
    • Yan, Zheng's avatar
      ceph: only dirty ITER_IOVEC pages for direct read · f00a3447
      Yan, Zheng authored
      commit 85784f93 upstream.
      
      If a page is already locked, attempting to dirty it leads to a deadlock
      in lock_page().  This is what currently happens to ITER_BVEC pages when
      a dio-enabled loop device is backed by ceph:
      
        $ losetup --direct-io /dev/loop0 /mnt/cephfs/img
        $ xfs_io -c 'pread 0 4k' /dev/loop0
      
      Follow other file systems and only dirty ITER_IOVEC pages.
      
      Cc: stable@kernel.org
      Signed-off-by: default avatar"Yan, Zheng" <zyan@redhat.com>
      Reviewed-by: default avatarIlya Dryomov <idryomov@gmail.com>
      Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f00a3447
    • Linus Torvalds's avatar
      perf/hwbp: Simplify the perf-hwbp code, fix documentation · ca04476d
      Linus Torvalds authored
      commit f67b1503 upstream.
      
      Annoyingly, modify_user_hw_breakpoint() unnecessarily complicates the
      modification of a breakpoint - simplify it and remove the pointless
      local variables.
      
      Also update the stale Docbook while at it.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: <stable@vger.kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ca04476d
    • Andrew Banman's avatar
      x86/platform/uv/BAU: Add APIC idt entry · b276b346
      Andrew Banman authored
      commit 151ad17f upstream.
      
      BAU uses the old alloc_initr_gate90 method to setup its interrupt. This
      fails silently as the BAU vector is in the range of APIC vectors that are
      registered to the spurious interrupt handler. As a consequence BAU
      broadcasts are not handled, and the broadcast source CPU hangs.
      
      Update BAU to use new idt structure.
      
      Fixes: dc20b2d5 ("x86/idt: Move interrupt gate initialization to IDT code")
      Signed-off-by: default avatarAndrew Banman <abanman@hpe.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Acked-by: default avatarMike Travis <mike.travis@hpe.com>
      Cc: Dimitri Sivanich <sivanich@hpe.com>
      Cc: Russ Anderson <rja@hpe.com>
      Cc: stable@vger.kernel.org
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Link: https://lkml.kernel.org/r/1522188546-196177-1-git-send-email-abanman@hpe.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b276b346
    • Dan Carpenter's avatar
      ALSA: pcm: potential uninitialized return values · 58eaa556
      Dan Carpenter authored
      commit 5607dddb upstream.
      
      Smatch complains that "tmp" can be uninitialized if we do a zero size
      write.
      
      Fixes: 02a5d692 ("ALSA: pcm: Avoid potential races between OSS ioctls and read/write")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      58eaa556
    • Stefan Roese's avatar
      ALSA: pcm: Use dma_bytes as size parameter in dma_mmap_coherent() · 17c9ea37
      Stefan Roese authored
      commit 9066ae7f upstream.
      
      When trying to use the driver (e.g. aplay *.wav), the 4MiB DMA buffer
      will get mmapp'ed in 16KiB chunks. But this fails with the 2nd 16KiB
      area, as the page offset is outside of the VMA range (size), which is
      currently used as size parameter in snd_pcm_lib_default_mmap(). By
      using the DMA buffer size (dma_bytes) instead, the complete DMA buffer
      can be mmapp'ed and the issue is fixed.
      
      This issue was detected on an ARM platform (TI AM57xx) using the RME
      HDSP MADI PCIe soundcard.
      
      Fixes: 657b1989 ("ALSA: pcm - Use dma_mmap_coherent() if available")
      Signed-off-by: default avatarStefan Roese <sr@denx.de>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      17c9ea37
    • Nobutaka Okabe's avatar
      ALSA: usb-audio: Add native DSD support for TEAC UD-301 · ba0b1c77
      Nobutaka Okabe authored
      commit b0021486 upstream.
      
      Add native DSD support quirk for TEAC UD-301 DAC,
      by adding the PID/VID 0644:804a.
      Signed-off-by: default avatarNobutaka Okabe <nob77413@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ba0b1c77
    • Boris Brezillon's avatar
      mtd: nand: atmel: Fix get_sectorsize() function · be0fdc48
      Boris Brezillon authored
      commit 2b1b1b4a upstream.
      
      get_sectorsize() was not using the appropriate macro to extract the
      ECC sector size from the config cache, which led to buggy ECC when
      using 1024 byte sectors.
      
      Fixes: f88fc122 ("mtd: nand: Cleanup/rework the atmel_nand driver")
      Cc: <stable@vger.kernel.org>
      Reported-by: default avatarOlivier Schonken <olivier.schonken@gmail.com>
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
      Reviewed-by: default avatarRichard Weinberger <richard@nod.at>
      Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
      Tested-by: default avatarOlivier Schonken <olivier.schonken@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      be0fdc48
    • Linus Walleij's avatar
      mtd: jedec_probe: Fix crash in jedec_read_mfr() · e9eddb70
      Linus Walleij authored
      commit 87a73eb5 upstream.
      
      It turns out that the loop where we read manufacturer
      jedec_read_mfd() can under some circumstances get a
      CFI_MFR_CONTINUATION repeatedly, making the loop go
      over all banks and eventually hit the end of the
      map and crash because of an access violation:
      
      Unable to handle kernel paging request at virtual address c4980000
      pgd = (ptrval)
      [c4980000] *pgd=03808811, *pte=00000000, *ppte=00000000
      Internal error: Oops: 7 [#1] PREEMPT ARM
      CPU: 0 PID: 1 Comm: swapper Not tainted 4.16.0-rc1+ #150
      Hardware name: Gemini (Device Tree)
      PC is at jedec_probe_chip+0x6ec/0xcd0
      LR is at 0x4
      pc : [<c03a2bf4>]    lr : [<00000004>]    psr: 60000013
      sp : c382dd18  ip : 0000ffff  fp : 00000000
      r10: c0626388  r9 : 00020000  r8 : c0626340
      r7 : 00000000  r6 : 00000001  r5 : c3a71afc  r4 : c382dd70
      r3 : 00000001  r2 : c4900000  r1 : 00000002  r0 : 00080000
      Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
      Control: 0000397f  Table: 00004000  DAC: 00000053
      Process swapper (pid: 1, stack limit = 0x(ptrval))
      
      Fix this by breaking the loop with a return 0 if
      the offset exceeds the map size.
      
      Fixes: 5c9c11e1 ("[MTD] [NOR] Add support for flash chips with ID in bank other than 0")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e9eddb70
    • Philipp Rossak's avatar
      ARM: dts: sun6i: a31s: bpi-m2: add missing regulators · 67356ab6
      Philipp Rossak authored
      commit 70b8d214 upstream.
      
      This patch fixes a bootproblem with the Bananapi M2 board. Since there
      are some regulators missing we add them right now. Those values come
      from the schematic, below you can find a small overview:
      
      * reg_aldo1:  3,3V, powers the wifi
      * reg_aldo2:  2,5V, powers the IO of the RTL8211E
      * reg_aldo3:  3,3V, powers the audio
      
      * reg_dldo1:  3,0V, powers the RTL8211E
      * reg_dldo2:  2,8V, powers the analog part of the csi
      * reg_dldo3:  3,3V, powers misc
      * reg_eldo1:  1,8V, powers the csi
      * reg_ldo_io1:1,8V, powers the gpio
      
      * reg_dc5ldo: needs to be always on
      
      This patch updates also the vmmc-supply properties on the mmc0 and mmc2
      node to use the allready existent regulators.
      We can now remove the sunxi-common-regulators.dtsi include since we
      don't need it anymore.
      
      Fixes: 7daa2137 ("ARM: dts: sunxi: Add regulators for Sinovoip BPI-M2")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarPhilipp Rossak <embed3d@gmail.com>
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@bootlin.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      67356ab6
    • Philipp Rossak's avatar
      ARM: dts: sun6i: a31s: bpi-m2: improve pmic properties · 46e10c38
      Philipp Rossak authored
      commit b23af6ad upstream.
      
      The eldoin is supplied from the dcdc1 regulator. The N_VBUSEN pin is
      connected to an external power regulator (SY6280AAC).
      With this commit we update the pmic binding properties to support
      those features.
      
      Fixes: 7daa2137 ("ARM: dts: sunxi: Add regulators for Sinovoip BPI-M2")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarPhilipp Rossak <embed3d@gmail.com>
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@bootlin.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      46e10c38
    • Fabio Estevam's avatar
      ARM: 8746/1: vfp: Go back to clearing vfp_current_hw_state[] · d377d3d0
      Fabio Estevam authored
      commit 1328f020 upstream.
      
      Commit 384b38b6 ("ARM: 7873/1: vfp: clear vfp_current_hw_state
      for dying cpu") fixed the cpu dying notifier by clearing
      vfp_current_hw_state[]. However commit e5b61baf ("arm: Convert VFP
      hotplug notifiers to state machine") incorrectly used the original
      vfp_force_reload() function in the cpu dying notifier.
      
      Fix it by going back to clearing vfp_current_hw_state[].
      
      Fixes: e5b61baf ("arm: Convert VFP hotplug notifiers to state machine")
      Cc: linux-stable <stable@vger.kernel.org>
      Reported-by: default avatarKohji Okuno <okuno.kohji@jp.panasonic.com>
      Signed-off-by: default avatarFabio Estevam <fabio.estevam@nxp.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d377d3d0
    • Tony Lindgren's avatar
      ARM: OMAP: Fix SRAM W+X mapping · a4941a5f
      Tony Lindgren authored
      commit eb85a355 upstream.
      
      We are still using custom SRAM code for some SoCs and are not marking
      the PM code mapped to SRAM as read-only and executable after we're
      done. With CONFIG_DEBUG_WX=y, we will get "Found insecure W+X mapping
      at address" warning.
      
      Let's fix this issue the same way as commit 728bbe75 ("misc: sram:
      Introduce support code for protect-exec sram type") is doing for
      drivers/misc/sram-exec.c.
      
      On omap3, we need to restore SRAM when returning from off mode after
      idle, so init time configuration is not enough.
      
      And as we no longer have users for omap_sram_push_address() we can
      make it static while at it.
      
      Note that eventually we should be using sram-exec.c for all SoCs.
      
      Cc: stable@vger.kernel.org	# v4.12+
      Cc: Dave Gerlach <d-gerlach@ti.com>
      Reported-by: default avatarPavel Machek <pavel@ucw.cz>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a4941a5f
  2. 31 Mar, 2018 21 commits