1. 25 Feb, 2018 32 commits
    • Tony Lindgren's avatar
      ARM: dts: Fix omap4 hang with GPS connected to USB by using wakeupgen · ffb47e3a
      Tony Lindgren authored
      
      [ Upstream commit cf87634c ]
      
      There's been a reproducable USB OHCI/EHCI cpuidle related hang on omap4
      for a while that happens after about 20 - 40 minutes on an idle system
      with some data feeding device being connected, like a USB GPS device or
      a cellular modem.
      
      This issue happens in cpuidle states C2 and C3 and does not happen if
      cpuidle is limited to C1 state only. The symptoms are that the whole
      system hangs and never wakes up from idle, and if a watchdog is
      configured the system reboots after a while.
      
      Turns out that OHCI/EHCI devices on omap4 are trying to use the GIC
      interrupt controller directly as a parent instead of the WUGEN. We
      need to pass the interrupts through WUGEN to GIC to provide the wakeup
      events for the processor.
      
      Let's fix the issue by removing the gic interrupt-parent and use the
      default interrupt-parent wakeupgen instead. Note that omap5.dtsi had
      this already fixes earlier by commit 7136d457 ("ARM: omap: convert
      wakeupgen to stacked domains") but we somehow missed omap4 at that
      point.
      
      Fixes: 7136d457 ("ARM: omap: convert wakeupgen to stacked domains")
      Cc: Dave Gerlach <d-gerlach@ti.com>
      Cc: Nishanth Menon <nm@ti.com>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
      Reviewed-by: default avatarRoger Quadros <rogerq@ti.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ffb47e3a
    • Keerthy's avatar
      ARM: AM33xx: PRM: Remove am33xx_pwrdm_read_prev_pwrst function · 8d9fd11f
      Keerthy authored
      
      [ Upstream commit b6d6af72 ]
      
      Referring TRM Am335X series:
      http://www.ti.com/lit/ug/spruh73p/spruh73p.pdf
      
      The LastPowerStateEntered bitfield is present only for PM_CEFUSE
      domain. This is not present in any of the other power domains. Hence
      remove the generic am33xx_pwrdm_read_prev_pwrst hook which wrongly
      reads the reserved bit fields for all the other power domains.
      
      Reading the reserved bits leads to wrongly interpreting the low
      power transitions for various power domains that do not have the
      LastPowerStateEntered field. The pm debug counters values are wrong
      currently as we are incrementing them based on the reserved bits.
      Signed-off-by: default avatarKeerthy <j-keerthy@ti.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8d9fd11f
    • Tony Lindgren's avatar
      ARM: OMAP2+: Fix SRAM virt to phys translation for save_secure_ram_context · 7780d2af
      Tony Lindgren authored
      
      [ Upstream commit d09220a8 ]
      
      With the CMA changes from Joonsoo Kim <iamjoonsoo.kim@lge.com>, it
      was noticed that n900 stopped booting. After investigating it turned
      out that n900 save_secure_ram_context does some whacky virtual to
      physical address translation for the SRAM data address.
      
      As we now only have minimal parts of omap3 idle code copied to SRAM,
      running save_secure_ram_context() in SRAM is not needed. It only gets
      called on PM init. And it seems there's no need to ever call this from
      SRAM idle code.
      
      So let's just keep save_secure_ram_context() in DDR, and pass it the
      physical address of the parameters. We can do everything else in
      omap-secure.c like we already do for other secure code.
      
      And since we don't have any documentation, I still have no clue what
      the values for 0, 1 and 1 for the parameters might be. If somebody has
      figured it out, please do send a patch to add some comments.
      Debugged-by: default avatarJoonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7780d2af
    • Randy Dunlap's avatar
      usb: build drivers/usb/common/ when USB_SUPPORT is set · d0ee2dfa
      Randy Dunlap authored
      
      [ Upstream commit c9d24f78 ]
      
      PHY drivers can use ULPI interfaces when CONFIG_USB (which is host side
      support) is not enabled, so also build drivers/usb/ when CONFIG_USB_SUPPORT
      is enabled so that drivers/usb/common/ is built.
      
      ERROR: "ulpi_unregister_driver" [drivers/phy/ti/phy-tusb1210.ko] undefined!
      ERROR: "__ulpi_register_driver" [drivers/phy/ti/phy-tusb1210.ko] undefined!
      ERROR: "ulpi_read" [drivers/phy/ti/phy-tusb1210.ko] undefined!
      ERROR: "ulpi_write" [drivers/phy/ti/phy-tusb1210.ko] undefined!
      ERROR: "ulpi_unregister_driver" [drivers/phy/qualcomm/phy-qcom-usb-hs.ko] undefined!
      ERROR: "__ulpi_register_driver" [drivers/phy/qualcomm/phy-qcom-usb-hs.ko] undefined!
      ERROR: "ulpi_write" [drivers/phy/qualcomm/phy-qcom-usb-hs.ko] undefined!
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d0ee2dfa
    • Shuah Khan's avatar
      usbip: keep usbip_device sockfd state in sync with tcp_socket · a909d246
      Shuah Khan authored
      commit 009f41ae upstream.
      
      Keep usbip_device sockfd state in sync with tcp_socket. When tcp_socket
      is reset to null, reset sockfd to -1 to keep it in sync.
      Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a909d246
    • Alexandru Ardelean's avatar
      staging: iio: adc: ad7192: fix external frequency setting · 67315b2b
      Alexandru Ardelean authored
      commit e31b617d upstream.
      
      The external clock frequency was set only when selecting
      the internal clock, which is fixed at 4.9152 Mhz.
      
      This is incorrect, since it should be set when any of
      the external clock or crystal settings is selected.
      
      Added range validation for the external (crystal/clock)
      frequency setting.
      Valid values are between 2.4576 and 5.12 Mhz.
      Signed-off-by: default avatarAlexandru Ardelean <alexandru.ardelean@analog.com>
      Cc: <Stable@vger.kernel.org>
      Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      67315b2b
    • Eric Biggers's avatar
      binder: check for binder_thread allocation failure in binder_poll() · 83c76f2c
      Eric Biggers authored
      commit f8898267 upstream.
      
      If the kzalloc() in binder_get_thread() fails, binder_poll()
      dereferences the resulting NULL pointer.
      
      Fix it by returning POLLERR if the memory allocation failed.
      
      This bug was found by syzkaller using fault injection.
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Fixes: 457b9a6f ("Staging: android: add binder driver")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      83c76f2c
    • Ben Hutchings's avatar
      staging: android: ashmem: Fix a race condition in pin ioctls · 74d1cc27
      Ben Hutchings authored
      commit ce8a3a9e upstream.
      
      ashmem_pin_unpin() reads asma->file and asma->size before taking the
      ashmem_mutex, so it can race with other operations that modify them.
      
      Build-tested only.
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      74d1cc27
    • Paolo Abeni's avatar
      dn_getsockoptdecnet: move nf_{get/set}sockopt outside sock lock · 32faf7d6
      Paolo Abeni authored
      commit dfec0914 upstream.
      
      After commit 3f34cfae ("netfilter: on sockopt() acquire sock lock
      only in the required scope"), the caller of nf_{get/set}sockopt() must
      not hold any lock, but, in such changeset, I forgot to cope with DECnet.
      
      This commit addresses the issue moving the nf call outside the lock,
      in the dn_{get,set}sockopt() with the same schema currently used by
      ipv4 and ipv6. Also moves the unhandled sockopts of the end of the main
      switch statements, to improve code readability.
      Reported-by: default avatarPetr Vandrovec <petr@vandrovec.name>
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=198791#c2
      Fixes: 3f34cfae ("netfilter: on sockopt() acquire sock lock only in the required scope")
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      32faf7d6
    • Dave Jones's avatar
      Make DST_CACHE a silent config option · ecac3b72
      Dave Jones authored
      commit 9b246841 upstream.
      
      commit 911362c7 ("net: add dst_cache support") added a new
      kconfig option that gets selected by other networking options.
      It seems the intent wasn't to offer this as a user-selectable
      option given the lack of help text, so this patch converts it
      to a silent option.
      Signed-off-by: default avatarDave Jones <davej@codemonkey.org.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Cc: Paolo Abeni <pabeni@redhat.com>
      Cc: <manojboopathi@google.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ecac3b72
    • Arnd Bergmann's avatar
      arm64: dts: add #cooling-cells to CPU nodes · 5683797e
      Arnd Bergmann authored
      commit acbf76ee upstream.
      
      dtc complains about the lack of #coolin-cells properties for the
      CPU nodes that are referred to as "cooling-device":
      
      arch/arm64/boot/dts/mediatek/mt8173-evb.dtb: Warning (cooling_device_property): Missing property '#cooling-cells' in node /cpus/cpu@0 or bad phandle (referred from /thermal-zones/cpu_thermal/cooling-maps/map@0:cooling-device[0])
      arch/arm64/boot/dts/mediatek/mt8173-evb.dtb: Warning (cooling_device_property): Missing property '#cooling-cells' in node /cpus/cpu@100 or bad phandle (referred from /thermal-zones/cpu_thermal/cooling-maps/map@1:cooling-device[0])
      
      Apparently this property must be '<2>' to match the binding.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Tested-by: default avatarChunfeng Yun <chunfeng.yun@mediatek.com>
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      [arnd: backported to 4.15]
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5683797e
    • Arnd Bergmann's avatar
      video: fbdev/mmp: add MODULE_LICENSE · 1289a793
      Arnd Bergmann authored
      commit c1530ac5 upstream.
      
      Kbuild complains about the lack of a license tag in this driver:
      
      WARNING: modpost: missing MODULE_LICENSE() in drivers/video/fbdev/mmp/mmp_disp.o
      
      This adds the license, author and description tags.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1289a793
    • Arnd Bergmann's avatar
      ASoC: ux500: add MODULE_LICENSE tag · 33180fe1
      Arnd Bergmann authored
      commit 1783c9d7 upstream.
      
      This adds MODULE_LICENSE/AUTHOR/DESCRIPTION tags to the ux500
      platform drivers, to avoid these build warnings:
      
      WARNING: modpost: missing MODULE_LICENSE() in sound/soc/ux500/snd-soc-ux500-plat-dma.o
      WARNING: modpost: missing MODULE_LICENSE() in sound/soc/ux500/snd-soc-ux500-mach-mop500.o
      
      The company no longer exists, so the email addresses of the authors
      don't work any more, but I've added them anyway for consistency.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      33180fe1
    • Willem de Bruijn's avatar
      net: avoid skb_warn_bad_offload on IS_ERR · c1eb3874
      Willem de Bruijn authored
      commit 8d74e9f8 upstream.
      
      skb_warn_bad_offload warns when packets enter the GSO stack that
      require skb_checksum_help or vice versa. Do not warn on arbitrary
      bad packets. Packet sockets can craft many. Syzkaller was able to
      demonstrate another one with eth_type games.
      
      In particular, suppress the warning when segmentation returns an
      error, which is for reasons other than checksum offload.
      
      See also commit 36c92474 ("net: WARN if skb_checksum_help() is
      called on skb requiring segmentation") for context on this warning.
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c1eb3874
    • Cong Wang's avatar
      netfilter: xt_RATEEST: acquire xt_rateest_mutex for hash insert · 4b1932a1
      Cong Wang authored
      commit 7dc68e98 upstream.
      
      rateest_hash is supposed to be protected by xt_rateest_mutex,
      and, as suggested by Eric, lookup and insert should be atomic,
      so we should acquire the xt_rateest_mutex once for both.
      
      So introduce a non-locking helper for internal use and keep the
      locking one for external.
      
      Reported-by: <syzbot+5cb189720978275e4c75@syzkaller.appspotmail.com>
      Fixes: 5859034d ("[NETFILTER]: x_tables: add RATEEST target")
      Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Reviewed-by: default avatarFlorian Westphal <fw@strlen.de>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4b1932a1
    • Paolo Abeni's avatar
      netfilter: on sockopt() acquire sock lock only in the required scope · 622cdb9c
      Paolo Abeni authored
      commit 3f34cfae upstream.
      
      Syzbot reported several deadlocks in the netfilter area caused by
      rtnl lock and socket lock being acquired with a different order on
      different code paths, leading to backtraces like the following one:
      
      ======================================================
      WARNING: possible circular locking dependency detected
      4.15.0-rc9+ #212 Not tainted
      ------------------------------------------------------
      syzkaller041579/3682 is trying to acquire lock:
        (sk_lock-AF_INET6){+.+.}, at: [<000000008775e4dd>] lock_sock
      include/net/sock.h:1463 [inline]
        (sk_lock-AF_INET6){+.+.}, at: [<000000008775e4dd>]
      do_ipv6_setsockopt.isra.8+0x3c5/0x39d0 net/ipv6/ipv6_sockglue.c:167
      
      but task is already holding lock:
        (rtnl_mutex){+.+.}, at: [<000000004342eaa9>] rtnl_lock+0x17/0x20
      net/core/rtnetlink.c:74
      
      which lock already depends on the new lock.
      
      the existing dependency chain (in reverse order) is:
      
      -> #1 (rtnl_mutex){+.+.}:
              __mutex_lock_common kernel/locking/mutex.c:756 [inline]
              __mutex_lock+0x16f/0x1a80 kernel/locking/mutex.c:893
              mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908
              rtnl_lock+0x17/0x20 net/core/rtnetlink.c:74
              register_netdevice_notifier+0xad/0x860 net/core/dev.c:1607
              tee_tg_check+0x1a0/0x280 net/netfilter/xt_TEE.c:106
              xt_check_target+0x22c/0x7d0 net/netfilter/x_tables.c:845
              check_target net/ipv6/netfilter/ip6_tables.c:538 [inline]
              find_check_entry.isra.7+0x935/0xcf0
      net/ipv6/netfilter/ip6_tables.c:580
              translate_table+0xf52/0x1690 net/ipv6/netfilter/ip6_tables.c:749
              do_replace net/ipv6/netfilter/ip6_tables.c:1165 [inline]
              do_ip6t_set_ctl+0x370/0x5f0 net/ipv6/netfilter/ip6_tables.c:1691
              nf_sockopt net/netfilter/nf_sockopt.c:106 [inline]
              nf_setsockopt+0x67/0xc0 net/netfilter/nf_sockopt.c:115
              ipv6_setsockopt+0x115/0x150 net/ipv6/ipv6_sockglue.c:928
              udpv6_setsockopt+0x45/0x80 net/ipv6/udp.c:1422
              sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2978
              SYSC_setsockopt net/socket.c:1849 [inline]
              SyS_setsockopt+0x189/0x360 net/socket.c:1828
              entry_SYSCALL_64_fastpath+0x29/0xa0
      
      -> #0 (sk_lock-AF_INET6){+.+.}:
              lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3914
              lock_sock_nested+0xc2/0x110 net/core/sock.c:2780
              lock_sock include/net/sock.h:1463 [inline]
              do_ipv6_setsockopt.isra.8+0x3c5/0x39d0 net/ipv6/ipv6_sockglue.c:167
              ipv6_setsockopt+0xd7/0x150 net/ipv6/ipv6_sockglue.c:922
              udpv6_setsockopt+0x45/0x80 net/ipv6/udp.c:1422
              sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2978
              SYSC_setsockopt net/socket.c:1849 [inline]
              SyS_setsockopt+0x189/0x360 net/socket.c:1828
              entry_SYSCALL_64_fastpath+0x29/0xa0
      
      other info that might help us debug this:
      
        Possible unsafe locking scenario:
      
              CPU0                    CPU1
              ----                    ----
         lock(rtnl_mutex);
                                      lock(sk_lock-AF_INET6);
                                      lock(rtnl_mutex);
         lock(sk_lock-AF_INET6);
      
        *** DEADLOCK ***
      
      1 lock held by syzkaller041579/3682:
        #0:  (rtnl_mutex){+.+.}, at: [<000000004342eaa9>] rtnl_lock+0x17/0x20
      net/core/rtnetlink.c:74
      
      The problem, as Florian noted, is that nf_setsockopt() is always
      called with the socket held, even if the lock itself is required only
      for very tight scopes and only for some operation.
      
      This patch addresses the issues moving the lock_sock() call only
      where really needed, namely in ipv*_getorigdst(), so that nf_setsockopt()
      does not need anymore to acquire both locks.
      
      Fixes: 22265a5c ("netfilter: xt_TEE: resolve oif using netdevice notifiers")
      Reported-by: syzbot+a4c2dc980ac1af699b36@syzkaller.appspotmail.com
      Suggested-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      622cdb9c
    • Dmitry Vyukov's avatar
      netfilter: ipt_CLUSTERIP: fix out-of-bounds accesses in clusterip_tg_check() · 1eda32ca
      Dmitry Vyukov authored
      commit 1a38956c upstream.
      
      Commit 136e92bb switched local_nodes from an array to a bitmask
      but did not add proper bounds checks. As the result
      clusterip_config_init_nodelist() can both over-read
      ipt_clusterip_tgt_info.local_nodes and over-write
      clusterip_config.local_nodes.
      
      Add bounds checks for both.
      
      Fixes: 136e92bb ("[NETFILTER] CLUSTERIP: use a bitmap to store node responsibility data")
      Signed-off-by: default avatarDmitry Vyukov <dvyukov@google.com>
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1eda32ca
    • Eric Dumazet's avatar
      netfilter: x_tables: avoid out-of-bounds reads in xt_request_find_{match|target} · 4556b01a
      Eric Dumazet authored
      commit da17c73b upstream.
      
      It looks like syzbot found its way into netfilter territory.
      
      Issue here is that @name comes from user space and might
      not be null terminated.
      
      Out-of-bound reads happen, KASAN is not happy.
      
      v2 added similar fix for xt_request_find_target(),
      as Florian advised.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Acked-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4556b01a
    • Dmitry Vyukov's avatar
      netfilter: x_tables: fix int overflow in xt_alloc_table_info() · 9626ac65
      Dmitry Vyukov authored
      commit 889c604f upstream.
      
      syzkaller triggered OOM kills by passing ipt_replace.size = -1
      to IPT_SO_SET_REPLACE. The root cause is that SMP_ALIGN() in
      xt_alloc_table_info() causes int overflow and the size check passes
      when it should not. SMP_ALIGN() is no longer needed leftover.
      
      Remove SMP_ALIGN() call in xt_alloc_table_info().
      
      Reported-by: syzbot+4396883fa8c4f64e0175@syzkaller.appspotmail.com
      Signed-off-by: default avatarDmitry Vyukov <dvyukov@google.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9626ac65
    • Wanpeng Li's avatar
      KVM: x86: fix escape of guest dr6 to the host · 9435c32b
      Wanpeng Li authored
      commit efdab992 upstream.
      
      syzkaller reported:
      
         WARNING: CPU: 0 PID: 12927 at arch/x86/kernel/traps.c:780 do_debug+0x222/0x250
         CPU: 0 PID: 12927 Comm: syz-executor Tainted: G           OE    4.15.0-rc2+ #16
         RIP: 0010:do_debug+0x222/0x250
         Call Trace:
          <#DB>
          debug+0x3e/0x70
         RIP: 0010:copy_user_enhanced_fast_string+0x10/0x20
          </#DB>
          _copy_from_user+0x5b/0x90
          SyS_timer_create+0x33/0x80
          entry_SYSCALL_64_fastpath+0x23/0x9a
      
      The testcase sets a watchpoint (with perf_event_open) on a buffer that is
      passed to timer_create() as the struct sigevent argument.  In timer_create(),
      copy_from_user()'s rep movsb triggers the BP.  The testcase also sets
      the debug registers for the guest.
      
      However, KVM only restores host debug registers when the host has active
      watchpoints, which triggers a race condition when running the testcase with
      multiple threads.  The guest's DR6.BS bit can escape to the host before
      another thread invokes timer_create(), and do_debug() complains.
      
      The fix is to respect do_debug()'s dr6 invariant when leaving KVM.
      Reported-by: default avatarDmitry Vyukov <dvyukov@google.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
      Signed-off-by: default avatarWanpeng Li <wanpeng.li@hotmail.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9435c32b
    • Eric Biggers's avatar
      crypto: x86/twofish-3way - Fix %rbp usage · 6bfbf2aa
      Eric Biggers authored
      commit d8c7fe9f upstream.
      
      Using %rbp as a temporary register breaks frame pointer convention and
      breaks stack traces when unwinding from an interrupt in the crypto code.
      
      In twofish-3way, we can't simply replace %rbp with another register
      because there are none available.  Instead, we use the stack to hold the
      values that %rbp, %r11, and %r12 were holding previously.  Each of these
      values represents the half of the output from the previous Feistel round
      that is being passed on unchanged to the following round.  They are only
      used once per round, when they are exchanged with %rax, %rbx, and %rcx.
      
      As a result, we free up 3 registers (one per block) and can reassign
      them so that %rbp is not used, and additionally %r14 and %r15 are not
      used so they do not need to be saved/restored.
      
      There may be a small overhead caused by replacing 'xchg REG, REG' with
      the needed sequence 'mov MEM, REG; mov REG, MEM; mov REG, REG' once per
      round.  But, counterintuitively, when I tested "ctr-twofish-3way" on a
      Haswell processor, the new version was actually about 2% faster.
      (Perhaps 'xchg' is not as well optimized as plain moves.)
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Reviewed-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6bfbf2aa
    • Paul Moore's avatar
      selinux: skip bounded transition processing if the policy isn't loaded · 002924ab
      Paul Moore authored
      commit 4b14752e upstream.
      
      We can't do anything reasonable in security_bounded_transition() if we
      don't have a policy loaded, and in fact we could run into problems
      with some of the code inside expecting a policy.  Fix these problems
      like we do many others in security/selinux/ss/services.c by checking
      to see if the policy is loaded (ss_initialized) and returning quickly
      if it isn't.
      Reported-by: default avatarsyzbot <syzkaller-bugs@googlegroups.com>
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      Acked-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      Reviewed-by: default avatarJames Morris <james.l.morris@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      002924ab
    • Paul Moore's avatar
      selinux: ensure the context is NUL terminated in security_context_to_sid_core() · d6233121
      Paul Moore authored
      commit ef28df55 upstream.
      
      The syzbot/syzkaller automated tests found a problem in
      security_context_to_sid_core() during early boot (before we load the
      SELinux policy) where we could potentially feed context strings without
      NUL terminators into the strcmp() function.
      
      We already guard against this during normal operation (after the SELinux
      policy has been loaded) by making a copy of the context strings and
      explicitly adding a NUL terminator to the end.  The patch extends this
      protection to the early boot case (no loaded policy) by moving the context
      copy earlier in security_context_to_sid_core().
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      Reviewed-By: default avatarWilliam Roberts <william.c.roberts@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d6233121
    • David Howells's avatar
      Provide a function to create a NUL-terminated string from unterminated data · 4dbb8e38
      David Howells authored
      commit f3515741 upstream.
      
      Provide a function, kmemdup_nul(), that will create a NUL-terminated string
      from an unterminated character array where the length is known in advance.
      
      This is better than kstrndup() in situations where we already know the
      string length as the strnlen() in kstrndup() is superfluous.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4dbb8e38
    • Chris Wilson's avatar
      drm: Require __GFP_NOFAIL for the legacy drm_modeset_lock_all · 016cf65f
      Chris Wilson authored
      commit d18d1a5a upstream.
      
      To acquire all modeset locks requires a ww_ctx to be allocated. As this
      is the legacy path and the allocation small, to reduce the changes
      required (and complex untested error handling) to the legacy drivers, we
      simply assume that the allocation succeeds. At present, it relies on the
      too-small-to-fail rule, but syzbot found that by injecting a failure
      here we would hit the WARN. Document that this allocation must succeed
      with __GFP_NOFAIL.
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171031115535.15166-1-chris@chris-wilson.co.ukSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      016cf65f
    • Jens Axboe's avatar
      blktrace: fix unlocked registration of tracepoints · 28de9389
      Jens Axboe authored
      commit a6da0024 upstream.
      
      We need to ensure that tracepoints are registered and unregistered
      with the users of them. The existing atomic count isn't enough for
      that. Add a lock around the tracepoints, so we serialize access
      to them.
      
      This fixes cases where we have multiple users setting up and
      tearing down tracepoints, like this:
      
      CPU: 0 PID: 2995 Comm: syzkaller857118 Not tainted
      4.14.0-rc5-next-20171018+ #36
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
      Google 01/01/2011
      Call Trace:
        __dump_stack lib/dump_stack.c:16 [inline]
        dump_stack+0x194/0x257 lib/dump_stack.c:52
        panic+0x1e4/0x41c kernel/panic.c:183
        __warn+0x1c4/0x1e0 kernel/panic.c:546
        report_bug+0x211/0x2d0 lib/bug.c:183
        fixup_bug+0x40/0x90 arch/x86/kernel/traps.c:177
        do_trap_no_signal arch/x86/kernel/traps.c:211 [inline]
        do_trap+0x260/0x390 arch/x86/kernel/traps.c:260
        do_error_trap+0x120/0x390 arch/x86/kernel/traps.c:297
        do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:310
        invalid_op+0x18/0x20 arch/x86/entry/entry_64.S:905
      RIP: 0010:tracepoint_add_func kernel/tracepoint.c:210 [inline]
      RIP: 0010:tracepoint_probe_register_prio+0x397/0x9a0 kernel/tracepoint.c:283
      RSP: 0018:ffff8801d1d1f6c0 EFLAGS: 00010293
      RAX: ffff8801d22e8540 RBX: 00000000ffffffef RCX: ffffffff81710f07
      RDX: 0000000000000000 RSI: ffffffff85b679c0 RDI: ffff8801d5f19818
      RBP: ffff8801d1d1f7c8 R08: ffffffff81710c10 R09: 0000000000000004
      R10: ffff8801d1d1f6b0 R11: 0000000000000003 R12: ffffffff817597f0
      R13: 0000000000000000 R14: 00000000ffffffff R15: ffff8801d1d1f7a0
        tracepoint_probe_register+0x2a/0x40 kernel/tracepoint.c:304
        register_trace_block_rq_insert include/trace/events/block.h:191 [inline]
        blk_register_tracepoints+0x1e/0x2f0 kernel/trace/blktrace.c:1043
        do_blk_trace_setup+0xa10/0xcf0 kernel/trace/blktrace.c:542
        blk_trace_setup+0xbd/0x180 kernel/trace/blktrace.c:564
        sg_ioctl+0xc71/0x2d90 drivers/scsi/sg.c:1089
        vfs_ioctl fs/ioctl.c:45 [inline]
        do_vfs_ioctl+0x1b1/0x1520 fs/ioctl.c:685
        SYSC_ioctl fs/ioctl.c:700 [inline]
        SyS_ioctl+0x8f/0xc0 fs/ioctl.c:691
        entry_SYSCALL_64_fastpath+0x1f/0xbe
      RIP: 0033:0x444339
      RSP: 002b:00007ffe05bb5b18 EFLAGS: 00000206 ORIG_RAX: 0000000000000010
      RAX: ffffffffffffffda RBX: 00000000006d66c0 RCX: 0000000000444339
      RDX: 000000002084cf90 RSI: 00000000c0481273 RDI: 0000000000000009
      RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000206 R12: ffffffffffffffff
      R13: 00000000c0481273 R14: 0000000000000000 R15: 0000000000000000
      
      since we can now run these in parallel. Ensure that the exported helpers
      for doing this are grabbing the queue trace mutex.
      Reported-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Tested-by: default avatarDmitry Vyukov <dvyukov@google.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      28de9389
    • Cong Wang's avatar
      xfrm: check id proto in validate_tmpl() · 40cda9b7
      Cong Wang authored
      commit 6a53b759 upstream.
      
      syzbot reported a kernel warning in xfrm_state_fini(), which
      indicates that we have entries left in the list
      net->xfrm.state_all whose proto is zero. And
      xfrm_id_proto_match() doesn't consider them as a match with
      IPSEC_PROTO_ANY in this case.
      
      Proto with value 0 is probably not a valid value, at least
      verify_newsa_info() doesn't consider it valid either.
      
      This patch fixes it by checking the proto value in
      validate_tmpl() and rejecting invalid ones, like what iproute2
      does in xfrm_xfrmproto_getbyname().
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Cc: Steffen Klassert <steffen.klassert@secunet.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      40cda9b7
    • Steffen Klassert's avatar
      xfrm: Fix stack-out-of-bounds read on socket policy lookup. · 7800c76f
      Steffen Klassert authored
      commit ddc47e44 upstream.
      
      When we do tunnel or beet mode, we pass saddr and daddr from the
      template to xfrm_state_find(), this is ok. On transport mode,
      we pass the addresses from the flowi, assuming that the IP
      addresses (and address family) don't change during transformation.
      This assumption is wrong in the IPv4 mapped IPv6 case, packet
      is IPv4 and template is IPv6.
      
      Fix this by catching address family missmatches of the policy
      and the flow already before we do the lookup.
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7800c76f
    • Tetsuo Handa's avatar
      mm,vmscan: Make unregister_shrinker() no-op if register_shrinker() failed. · 0de023ab
      Tetsuo Handa authored
      commit bb422a73 upstream.
      
      Syzbot caught an oops at unregister_shrinker() because combination of
      commit 1d3d4437 ("vmscan: per-node deferred work") and fault
      injection made register_shrinker() fail and the caller of
      register_shrinker() did not check for failure.
      
      ----------
      [  554.881422] FAULT_INJECTION: forcing a failure.
      [  554.881422] name failslab, interval 1, probability 0, space 0, times 0
      [  554.881438] CPU: 1 PID: 13231 Comm: syz-executor1 Not tainted 4.14.0-rc8+ #82
      [  554.881443] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      [  554.881445] Call Trace:
      [  554.881459]  dump_stack+0x194/0x257
      [  554.881474]  ? arch_local_irq_restore+0x53/0x53
      [  554.881486]  ? find_held_lock+0x35/0x1d0
      [  554.881507]  should_fail+0x8c0/0xa40
      [  554.881522]  ? fault_create_debugfs_attr+0x1f0/0x1f0
      [  554.881537]  ? check_noncircular+0x20/0x20
      [  554.881546]  ? find_next_zero_bit+0x2c/0x40
      [  554.881560]  ? ida_get_new_above+0x421/0x9d0
      [  554.881577]  ? find_held_lock+0x35/0x1d0
      [  554.881594]  ? __lock_is_held+0xb6/0x140
      [  554.881628]  ? check_same_owner+0x320/0x320
      [  554.881634]  ? lock_downgrade+0x990/0x990
      [  554.881649]  ? find_held_lock+0x35/0x1d0
      [  554.881672]  should_failslab+0xec/0x120
      [  554.881684]  __kmalloc+0x63/0x760
      [  554.881692]  ? lock_downgrade+0x990/0x990
      [  554.881712]  ? register_shrinker+0x10e/0x2d0
      [  554.881721]  ? trace_event_raw_event_module_request+0x320/0x320
      [  554.881737]  register_shrinker+0x10e/0x2d0
      [  554.881747]  ? prepare_kswapd_sleep+0x1f0/0x1f0
      [  554.881755]  ? _down_write_nest_lock+0x120/0x120
      [  554.881765]  ? memcpy+0x45/0x50
      [  554.881785]  sget_userns+0xbcd/0xe20
      (...snipped...)
      [  554.898693] kasan: CONFIG_KASAN_INLINE enabled
      [  554.898724] kasan: GPF could be caused by NULL-ptr deref or user memory access
      [  554.898732] general protection fault: 0000 [#1] SMP KASAN
      [  554.898737] Dumping ftrace buffer:
      [  554.898741]    (ftrace buffer empty)
      [  554.898743] Modules linked in:
      [  554.898752] CPU: 1 PID: 13231 Comm: syz-executor1 Not tainted 4.14.0-rc8+ #82
      [  554.898755] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      [  554.898760] task: ffff8801d1dbe5c0 task.stack: ffff8801c9e38000
      [  554.898772] RIP: 0010:__list_del_entry_valid+0x7e/0x150
      [  554.898775] RSP: 0018:ffff8801c9e3f108 EFLAGS: 00010246
      [  554.898780] RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
      [  554.898784] RDX: 0000000000000000 RSI: ffff8801c53c6f98 RDI: ffff8801c53c6fa0
      [  554.898788] RBP: ffff8801c9e3f120 R08: 1ffff100393c7d55 R09: 0000000000000004
      [  554.898791] R10: ffff8801c9e3ef70 R11: 0000000000000000 R12: 0000000000000000
      [  554.898795] R13: dffffc0000000000 R14: 1ffff100393c7e45 R15: ffff8801c53c6f98
      [  554.898800] FS:  0000000000000000(0000) GS:ffff8801db300000(0000) knlGS:0000000000000000
      [  554.898804] CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
      [  554.898807] CR2: 00000000dbc23000 CR3: 00000001c7269000 CR4: 00000000001406e0
      [  554.898813] DR0: 0000000020000000 DR1: 0000000020000000 DR2: 0000000000000000
      [  554.898816] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600
      [  554.898818] Call Trace:
      [  554.898828]  unregister_shrinker+0x79/0x300
      [  554.898837]  ? perf_trace_mm_vmscan_writepage+0x750/0x750
      [  554.898844]  ? down_write+0x87/0x120
      [  554.898851]  ? deactivate_super+0x139/0x1b0
      [  554.898857]  ? down_read+0x150/0x150
      [  554.898864]  ? check_same_owner+0x320/0x320
      [  554.898875]  deactivate_locked_super+0x64/0xd0
      [  554.898883]  deactivate_super+0x141/0x1b0
      ----------
      
      Since allowing register_shrinker() callers to call unregister_shrinker()
      when register_shrinker() failed can simplify error recovery path, this
      patch makes unregister_shrinker() no-op when register_shrinker() failed.
      Also, reset shrinker->nr_deferred in case unregister_shrinker() was
      by error called twice.
      Signed-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Signed-off-by: default avatarAliaksei Karaliou <akaraliou.dev@gmail.com>
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Cc: Glauber Costa <glauber@scylladb.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0de023ab
    • Johannes Berg's avatar
      cfg80211: check dev_set_name() return value · 941095c5
      Johannes Berg authored
      commit 59b179b4 upstream.
      
      syzbot reported a warning from rfkill_alloc(), and after a while
      I think that the reason is that it was doing fault injection and
      the dev_set_name() failed, leaving the name NULL, and we didn't
      check the return value and got to rfkill_alloc() with a NULL name.
      Since we really don't want a NULL name, we ought to check the
      return value.
      
      Fixes: fb28ad35 ("net: struct device - replace bus_id with dev_name(), dev_set_name()")
      Reported-by: syzbot+1ddfb3357e1d7bb5b5d3@syzkaller.appspotmail.com
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      941095c5
    • Paolo Abeni's avatar
      net: replace dst_cache ip6_tunnel implementation with the generic one · b8c7f80c
      Paolo Abeni authored
      commit 607f725f upstream.
      
      This also fix a potential race into the existing tunnel code, which
      could lead to the wrong dst to be permanenty cached:
      
      CPU1:					CPU2:
        <xmit on ip6_tunnel>
        <cache lookup fails>
        dst = ip6_route_output(...)
      					<tunnel params are changed via nl>
      					dst_cache_reset() // no effect,
      							// the cache is empty
        dst_cache_set() // the wrong dst
      	// is permanenty stored
      	// into the cache
      
      With the new dst implementation the above race is not possible
      since the first cache lookup after dst_cache_reset will fail due
      to the timestamp check
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Suggested-and-acked-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarManoj Boopathi Raj <manojboopathi@google.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b8c7f80c
    • Paolo Abeni's avatar
      net: add dst_cache support · d365b297
      Paolo Abeni authored
      commit 911362c7 upstream.
      
      This patch add a generic, lockless dst cache implementation.
      The need for lock is avoided updating the dst cache fields
      only in per cpu scope, and requiring that the cache manipulation
      functions are invoked with the local bh disabled.
      
      The refresh_ts and reset_ts fields are used to ensure the cache
      consistency in case of cuncurrent cache update (dst_cache_set*) and
      reset operation (dst_cache_reset).
      
      Consider the following scenario:
      
      CPU1:                                   	CPU2:
        <cache lookup with emtpy cache: it fails>
        <get dst via uncached route lookup>
      						<related configuration changes>
                                              	dst_cache_reset()
        dst_cache_set()
      
      The dst entry set passed to dst_cache_set() should not be used
      for later dst cache lookup, because it's obtained using old
      configuration values.
      
      Since the refresh_ts is updated only on dst_cache lookup, the
      cached value in the above scenario will be discarded on the next
      lookup.
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Suggested-and-acked-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarManoj Boopathi Raj <manojboopathi@google.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d365b297
  2. 22 Feb, 2018 8 commits
    • Greg Kroah-Hartman's avatar
      Linux 4.4.117 · e9fd3d16
      Greg Kroah-Hartman authored
      e9fd3d16
    • Arnd Bergmann's avatar
      media: r820t: fix r820t_write_reg for KASAN · c4fd9c8d
      Arnd Bergmann authored
      commit 16c3ada8 upstream.
      
      With CONFIG_KASAN, we get an overly long stack frame due to inlining
      the register access functions:
      
      drivers/media/tuners/r820t.c: In function 'generic_set_freq.isra.7':
      drivers/media/tuners/r820t.c:1334:1: error: the frame size of 2880 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
      
      This is caused by a gcc bug that has now been fixed in gcc-8.
      To work around the problem, we can pass the register data
      through a local variable that older gcc versions can optimize
      out as well.
      
      Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c4fd9c8d
    • Arnd Bergmann's avatar
      ARM: dts: s5pv210: add interrupt-parent for ohci · 193cfa76
      Arnd Bergmann authored
      commit 5c103719 upstream.
      
      The ohci-hcd node has an interrupt number but no interrupt-parent,
      leading to a warning with current dtc versions:
      
      arch/arm/boot/dts/s5pv210-aquila.dtb: Warning (interrupts_property): Missing interrupt-parent for /soc/ohci@ec300000
      arch/arm/boot/dts/s5pv210-goni.dtb: Warning (interrupts_property): Missing interrupt-parent for /soc/ohci@ec300000
      arch/arm/boot/dts/s5pv210-smdkc110.dtb: Warning (interrupts_property): Missing interrupt-parent for /soc/ohci@ec300000
      arch/arm/boot/dts/s5pv210-smdkv210.dtb: Warning (interrupts_property): Missing interrupt-parent for /soc/ohci@ec300000
      arch/arm/boot/dts/s5pv210-torbreck.dtb: Warning (interrupts_property): Missing interrupt-parent for /soc/ohci@ec300000
      
      As seen from the related exynos dts files, the ohci and ehci controllers
      always share one interrupt number, and the number is the same here as
      well, so setting the same interrupt-parent is the reasonable solution
      here.
      Reviewed-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      193cfa76
    • Arnd Bergmann's avatar
      ARM: pxa/tosa-bt: add MODULE_LICENSE tag · 4bdee1ef
      Arnd Bergmann authored
      commit 33436478 upstream.
      
      Without this tag, we get a build warning:
      
      WARNING: modpost: missing MODULE_LICENSE() in arch/arm/mach-pxa/tosa-bt.o
      
      For completeness, I'm also adding author and description fields.
      Acked-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4bdee1ef
    • Linus Torvalds's avatar
      vfs: don't do RCU lookup of empty pathnames · 42e9b08a
      Linus Torvalds authored
      commit c0eb027e upstream.
      
      Normal pathname lookup doesn't allow empty pathnames, but using
      AT_EMPTY_PATH (with name_to_handle_at() or fstatat(), for example) you
      can trigger an empty pathname lookup.
      
      And not only is the RCU lookup in that case entirely unnecessary
      (because we'll obviously immediately finalize the end result), it is
      actively wrong.
      
      Why? An empth path is a special case that will return the original
      'dirfd' dentry - and that dentry may not actually be RCU-free'd,
      resulting in a potential use-after-free if we were to initialize the
      path lazily under the RCU read lock and depend on complete_walk()
      finalizing the dentry.
      
      Found by syzkaller and KASAN.
      Reported-by: default avatarDmitry Vyukov <dvyukov@google.com>
      Reported-by: default avatarVegard Nossum <vegard.nossum@gmail.com>
      Acked-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Eric Biggers <ebiggers3@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      42e9b08a
    • Arnd Bergmann's avatar
      x86: fix build warnign with 32-bit PAE · 4b35dcb5
      Arnd Bergmann authored
      I ran into a 4.9 build warning in randconfig testing, starting with the
      KAISER patches:
      
      arch/x86/kernel/ldt.c: In function 'alloc_ldt_struct':
      arch/x86/include/asm/pgtable_types.h:208:24: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
       #define __PAGE_KERNEL  (__PAGE_KERNEL_EXEC | _PAGE_NX)
                              ^
      arch/x86/kernel/ldt.c:81:6: note: in expansion of macro '__PAGE_KERNEL'
            __PAGE_KERNEL);
            ^~~~~~~~~~~~~
      
      I originally ran into this last year when the patches were part of linux-next,
      and tried to work around it by using the proper 'pteval_t' types consistently,
      but that caused additional problems.
      
      This takes a much simpler approach, and makes the argument type of the dummy
      helper always 64-bit, which is wide enough for any page table layout and
      won't hurt since this call is just an empty stub anyway.
      
      Fixes: 8f0baadf ("kaiser: merged update")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarKees Cook <keescook@chromium.org>
      Acked-by: default avatarHugh Dickins <hughd@google.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4b35dcb5
    • NeilBrown's avatar
      dm: correctly handle chained bios in dec_pending() · bb185128
      NeilBrown authored
      commit 8dd601fa upstream.
      
      dec_pending() is given an error status (possibly 0) to be recorded
      against a bio.  It can be called several times on the one 'struct
      dm_io', and it is careful to only assign a non-zero error to
      io->status.  However when it then assigned io->status to bio->bi_status,
      it is not careful and could overwrite a genuine error status with 0.
      
      This can happen when chained bios are in use.  If a bio is chained
      beneath the bio that this dm_io is handling, the child bio might
      complete and set bio->bi_status before the dm_io completes.
      
      This has been possible since chained bios were introduced in 3.14, and
      has become a lot easier to trigger with commit 18a25da8 ("dm: ensure
      bio submission follows a depth-first tree walk") as that commit caused
      dm to start using chained bios itself.
      
      A particular failure mode is that if a bio spans an 'error' target and a
      working target, the 'error' fragment will complete instantly and set the
      ->bi_status, and the other fragment will normally complete a little
      later, and will clear ->bi_status.
      
      The fix is simply to only assign io_error to bio->bi_status when
      io_error is not zero.
      Reported-and-tested-by: default avatarMilan Broz <gmazyland@gmail.com>
      Cc: stable@vger.kernel.org (v3.14+)
      Signed-off-by: default avatarNeilBrown <neilb@suse.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bb185128
    • Mikulas Patocka's avatar
      mvpp2: fix multicast address filter · 94abb492
      Mikulas Patocka authored
      commit 7ac8ff95 upstream.
      
      IPv6 doesn't work on the MacchiatoBIN board. It is caused by broken
      multicast address filter in the mvpp2 driver.
      
      The driver loads doesn't load any multicast entries if "allmulti" is not
      set. This condition should be reversed.
      
      The condition !netdev_mc_empty(dev) is useless (because
      netdev_for_each_mc_addr is nop if the list is empty).
      
      This patch also fixes a possible overflow of the multicast list - if
      mvpp2_prs_mac_da_accept fails, we set the allmulti flag and retry.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      94abb492