1. 04 5月, 2019 26 次提交
  2. 02 5月, 2019 14 次提交
    • G
      Linux 4.19.38 · a03957ab
      Greg Kroah-Hartman 提交于
      a03957ab
    • D
      powerpc/fsl: Add FSL_PPC_BOOK3E as supported arch for nospectre_v2 boot arg · 5cb299c8
      Diana Craciun 提交于
      commit e59f5bd759b7dee57593c5b6c0441609bda5d530 upstream.
      Signed-off-by: NDiana Craciun <diana.craciun@nxp.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5cb299c8
    • J
      net/tls: don't leak IV and record seq when offload fails · 53db6523
      Jakub Kicinski 提交于
      [ Upstream commit 12c7686111326148b4b5db189130522a4ad1be4a ]
      
      When device refuses the offload in tls_set_device_offload_rx()
      it calls tls_sw_free_resources_rx() to clean up software context
      state.
      
      Unfortunately, tls_sw_free_resources_rx() does not free all
      the state tls_set_sw_offload() allocated - it leaks IV and
      sequence number buffers.  All other code paths which lead to
      tls_sw_release_resources_rx() (which tls_sw_free_resources_rx()
      calls) free those right before the call.
      
      Avoid the leak by moving freeing of iv and rec_seq into
      tls_sw_release_resources_rx().
      
      Fixes: 4799ac81 ("tls: Add rx inline crypto offload")
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Reviewed-by: NDirk van der Merwe <dirk.vandermerwe@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      53db6523
    • J
      net/tls: avoid potential deadlock in tls_set_device_offload_rx() · d3bdd359
      Jakub Kicinski 提交于
      [ Upstream commit 62ef81d5632634d5e310ed25b9b940b2b6612b46 ]
      
      If device supports offload, but offload fails tls_set_device_offload_rx()
      will call tls_sw_free_resources_rx() which (unhelpfully) releases
      and reacquires the socket lock.
      
      For a small fix release and reacquire the device_offload_lock.
      
      Fixes: 4799ac81 ("tls: Add rx inline crypto offload")
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Reviewed-by: NDirk van der Merwe <dirk.vandermerwe@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d3bdd359
    • M
      net/mlx5e: Fix use-after-free after xdp_return_frame · 041b3224
      Maxim Mikityanskiy 提交于
      [ Upstream commit 12fc512f5741443a03adde2ead20724da8ad550a ]
      
      xdp_return_frame releases the frame. It leads to releasing the page, so
      it's not allowed to access xdpi.xdpf->len after that, because xdpi.xdpf
      is at xdp->data_hard_start after convert_to_xdp_frame. This patch moves
      the memory access to precede the return of the frame.
      
      Fixes: 58b99ee3 ("net/mlx5e: Add support for XDP_REDIRECT in device-out side")
      Signed-off-by: NMaxim Mikityanskiy <maximmi@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      041b3224
    • M
      net/mlx5e: Fix the max MTU check in case of XDP · ae6b0710
      Maxim Mikityanskiy 提交于
      [ Upstream commit d460c2718906252a2a69bc6f89b537071f792e6e ]
      
      MLX5E_XDP_MAX_MTU was calculated incorrectly. It didn't account for
      NET_IP_ALIGN and MLX5E_HW2SW_MTU, and it also misused MLX5_SKB_FRAG_SZ.
      This commit fixes the calculations and adds a brief explanation for the
      formula used.
      
      Fixes: a26a5bdf ("net/mlx5e: Restrict the combination of large MTU and XDP")
      Signed-off-by: NMaxim Mikityanskiy <maximmi@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ae6b0710
    • P
      mlxsw: spectrum: Put MC TCs into DWRR mode · b08774d3
      Petr Machata 提交于
      [ Upstream commit f476b3f809fa02f47af6333ed63715058c3fc348 ]
      
      Both Spectrum-1 and Spectrum-2 chips are currently configured such that
      pairs of TC n (which is used for UC traffic) and TC n+8 (which is used
      for MC traffic) are feeding into the same subgroup. Strict
      prioritization is configured between the two TCs, and by enabling
      MC-aware mode on the switch, the lower-numbered (UC) TCs are favored
      over the higher-numbered (MC) TCs.
      
      On Spectrum-2 however, there is an issue in configuration of the
      MC-aware mode. As a result, MC traffic is prioritized over UC traffic.
      To work around the issue, configure the MC TCs with DWRR mode (while
      keeping the UC TCs in strict mode).
      
      With this patch, the multicast-unicast arbitration results in the same
      behavior on both Spectrum-1 and Spectrum-2 chips.
      
      Fixes: 7b819530 ("mlxsw: spectrum: Configure MC-aware mode on mlxsw ports")
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b08774d3
    • I
      mlxsw: pci: Reincrease PCI reset timeout · 21e47998
      Ido Schimmel 提交于
      [ Upstream commit 1ab3030193d25878b3b1409060e1e0a879800c95 ]
      
      During driver initialization the driver sends a reset to the device and
      waits for the firmware to signal that it is ready to continue.
      
      Commit d2f372ba0914 ("mlxsw: pci: Increase PCI SW reset timeout")
      increased the timeout to 13 seconds due to longer PHY calibration in
      Spectrum-2 compared to Spectrum-1.
      
      Recently it became apparent that this timeout is too short and therefore
      this patch increases it again to a safer limit that will be reduced in
      the future.
      
      Fixes: c3ab4354 ("mlxsw: spectrum: Extend to support Spectrum-2 ASIC")
      Fixes: d2f372ba0914 ("mlxsw: pci: Increase PCI SW reset timeout")
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      21e47998
    • J
      net: hns: Fix WARNING when hns modules installed · e875a409
      Jun Xiao 提交于
      Commit dfdf26babc98 upstream
      
      this patch need merge to 4.19.y stable kernel
      
      Fix Conflict:already fixed the confilct dfdf26babc98 with Yonglong Liu
      
      stable candidate:user cannot connect to the internet via hns dev
      by default setting without this patch
      
      we have already verified this patch on kunpeng916 platform,
      and it works well.
      Signed-off-by: NYonglong Liu <liuyonglong@huawei.com>
      Signed-off-by: NJun Xiao <xiaojun2@hisilicon.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e875a409
    • H
      team: fix possible recursive locking when add slaves · 7ce836e8
      Hangbin Liu 提交于
      [ Upstream commit 925b0c841e066b488cc3a60272472b2c56300704 ]
      
      If we add a bond device which is already the master of the team interface,
      we will hold the team->lock in team_add_slave() first and then request the
      lock in team_set_mac_address() again. The functions are called like:
      
      - team_add_slave()
       - team_port_add()
         - team_port_enter()
           - team_modeop_port_enter()
             - __set_port_dev_addr()
               - dev_set_mac_address()
                 - bond_set_mac_address()
                   - dev_set_mac_address()
        	       - team_set_mac_address
      
      Although team_upper_dev_link() would check the upper devices but it is
      called too late. Fix it by adding a checking before processing the slave.
      
      v2: Do not split the string in netdev_err()
      
      Fixes: 3d249d4c ("net: introduce ethernet teaming device")
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NHangbin Liu <liuhangbin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7ce836e8
    • S
      stmmac: pci: Adjust IOT2000 matching · 1f78e75e
      Su Bao Cheng 提交于
      [ Upstream commit e0c1d14a1a3211dccf0540a6703ffbd5d2a75bdb ]
      
      Since there are more IOT2040 variants with identical hardware but
      different asset tags, the asset tag matching should be adjusted to
      support them.
      
      For the board name "SIMATIC IOT2000", currently there are 2 types of
      hardware, IOT2020 and IOT2040. The IOT2020 is identified by its unique
      asset tag. Match on it first. If we then match on the board name only,
      we will catch all IOT2040 variants. In the future there will be no other
      devices with the "SIMATIC IOT2000" DMI board name but different
      hardware.
      Signed-off-by: NSu Bao Cheng <baocheng.su@siemens.com>
      Reviewed-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1f78e75e
    • J
      net/tls: fix refcount adjustment in fallback · e97f0bc7
      Jakub Kicinski 提交于
      [ Upstream commit 9188d5ca454fd665145904267e726e9e8d122f5c ]
      
      Unlike atomic_add(), refcount_add() does not deal well
      with a negative argument.  TLS fallback code reallocates
      the skb and is very likely to shrink the truesize, leading to:
      
      [  189.513254] WARNING: CPU: 5 PID: 0 at lib/refcount.c:81 refcount_add_not_zero_checked+0x15c/0x180
       Call Trace:
        refcount_add_checked+0x6/0x40
        tls_enc_skb+0xb93/0x13e0 [tls]
      
      Once wmem_allocated count saturates the application can no longer
      send data on the socket.  This is similar to Eric's fixes for GSO,
      TCP:
      commit 7ec318fe ("tcp: gso: avoid refcount_t warning from tcp_gso_segment()")
      and UDP:
      commit 575b65bc ("udp: avoid refcount_t saturation in __udp_gso_segment()").
      
      Unlike the GSO case, for TLS fallback it's likely that the skb has
      shrunk, so the "likely" annotation is the other way around (likely
      branch being "sub").
      
      Fixes: e8f69799 ("net/tls: Add generic NIC offload infrastructure")
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Reviewed-by: NJohn Hurley <john.hurley@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e97f0bc7
    • V
      net: stmmac: move stmmac_check_ether_addr() to driver probe · b02f8aa8
      Vinod Koul 提交于
      [ Upstream commit b561af36b1841088552464cdc3f6371d92f17710 ]
      
      stmmac_check_ether_addr() checks the MAC address and assigns one in
      driver open(). In many cases when we create slave netdevice, the dev
      addr is inherited from master but the master dev addr maybe NULL at
      that time, so move this call to driver probe so that address is
      always valid.
      Signed-off-by: NXiaofei Shen <xiaofeis@codeaurora.org>
      Tested-by: NXiaofei Shen <xiaofeis@codeaurora.org>
      Signed-off-by: NSneh Shah <snehshah@codeaurora.org>
      Signed-off-by: NVinod Koul <vkoul@kernel.org>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b02f8aa8
    • E
      net/rose: fix unbound loop in rose_loopback_timer() · d7b10dfe
      Eric Dumazet 提交于
      [ Upstream commit 0453c682459583910d611a96de928f4442205493 ]
      
      This patch adds a limit on the number of skbs that fuzzers can queue
      into loopback_queue. 1000 packets for rose loopback seems more than enough.
      
      Then, since we now have multiple cpus in most linux hosts,
      we also need to limit the number of skbs rose_loopback_timer()
      can dequeue at each round.
      
      rose_loopback_queue() can be drop-monitor friendly, calling
      consume_skb() or kfree_skb() appropriately.
      
      Finally, use mod_timer() instead of del_timer() + add_timer()
      
      syzbot report was :
      
      rcu: INFO: rcu_preempt self-detected stall on CPU
      rcu:    0-...!: (10499 ticks this GP) idle=536/1/0x4000000000000002 softirq=103291/103291 fqs=34
      rcu:     (t=10500 jiffies g=140321 q=323)
      rcu: rcu_preempt kthread starved for 10426 jiffies! g140321 f0x0 RCU_GP_WAIT_FQS(5) ->state=0x402 ->cpu=1
      rcu: RCU grace-period kthread stack dump:
      rcu_preempt     I29168    10      2 0x80000000
      Call Trace:
       context_switch kernel/sched/core.c:2877 [inline]
       __schedule+0x813/0x1cc0 kernel/sched/core.c:3518
       schedule+0x92/0x180 kernel/sched/core.c:3562
       schedule_timeout+0x4db/0xfd0 kernel/time/timer.c:1803
       rcu_gp_fqs_loop kernel/rcu/tree.c:1971 [inline]
       rcu_gp_kthread+0x962/0x17b0 kernel/rcu/tree.c:2128
       kthread+0x357/0x430 kernel/kthread.c:253
       ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352
      NMI backtrace for cpu 0
      CPU: 0 PID: 7632 Comm: kworker/0:4 Not tainted 5.1.0-rc5+ #172
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Workqueue: events iterate_cleanup_work
      Call Trace:
       <IRQ>
       __dump_stack lib/dump_stack.c:77 [inline]
       dump_stack+0x172/0x1f0 lib/dump_stack.c:113
       nmi_cpu_backtrace.cold+0x63/0xa4 lib/nmi_backtrace.c:101
       nmi_trigger_cpumask_backtrace+0x1be/0x236 lib/nmi_backtrace.c:62
       arch_trigger_cpumask_backtrace+0x14/0x20 arch/x86/kernel/apic/hw_nmi.c:38
       trigger_single_cpu_backtrace include/linux/nmi.h:164 [inline]
       rcu_dump_cpu_stacks+0x183/0x1cf kernel/rcu/tree.c:1223
       print_cpu_stall kernel/rcu/tree.c:1360 [inline]
       check_cpu_stall kernel/rcu/tree.c:1434 [inline]
       rcu_pending kernel/rcu/tree.c:3103 [inline]
       rcu_sched_clock_irq.cold+0x500/0xa4a kernel/rcu/tree.c:2544
       update_process_times+0x32/0x80 kernel/time/timer.c:1635
       tick_sched_handle+0xa2/0x190 kernel/time/tick-sched.c:161
       tick_sched_timer+0x47/0x130 kernel/time/tick-sched.c:1271
       __run_hrtimer kernel/time/hrtimer.c:1389 [inline]
       __hrtimer_run_queues+0x33e/0xde0 kernel/time/hrtimer.c:1451
       hrtimer_interrupt+0x314/0x770 kernel/time/hrtimer.c:1509
       local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1035 [inline]
       smp_apic_timer_interrupt+0x120/0x570 arch/x86/kernel/apic/apic.c:1060
       apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:807
      RIP: 0010:__sanitizer_cov_trace_pc+0x0/0x50 kernel/kcov.c:95
      Code: 89 25 b4 6e ec 08 41 bc f4 ff ff ff e8 cd 5d ea ff 48 c7 05 9e 6e ec 08 00 00 00 00 e9 a4 e9 ff ff 90 90 90 90 90 90 90 90 90 <55> 48 89 e5 48 8b 75 08 65 48 8b 04 25 00 ee 01 00 65 8b 15 c8 60
      RSP: 0018:ffff8880ae807ce0 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13
      RAX: ffff88806fd40640 RBX: dffffc0000000000 RCX: ffffffff863fbc56
      RDX: 0000000000000100 RSI: ffffffff863fbc1d RDI: ffff88808cf94228
      RBP: ffff8880ae807d10 R08: ffff88806fd40640 R09: ffffed1015d00f8b
      R10: ffffed1015d00f8a R11: 0000000000000003 R12: ffff88808cf941c0
      R13: 00000000fffff034 R14: ffff8882166cd840 R15: 0000000000000000
       rose_loopback_timer+0x30d/0x3f0 net/rose/rose_loopback.c:91
       call_timer_fn+0x190/0x720 kernel/time/timer.c:1325
       expire_timers kernel/time/timer.c:1362 [inline]
       __run_timers kernel/time/timer.c:1681 [inline]
       __run_timers kernel/time/timer.c:1649 [inline]
       run_timer_softirq+0x652/0x1700 kernel/time/timer.c:1694
       __do_softirq+0x266/0x95a kernel/softirq.c:293
       do_softirq_own_stack+0x2a/0x40 arch/x86/entry/entry_64.S:1027
      
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Reported-by: Nsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d7b10dfe