1. 30 Apr, 2020 3 commits
    • Parav Pandit's avatar
      net/mlx5: E-switch, Fix mutex init order · f8d1edda
      Parav Pandit authored
      In cited patch mutex is initialized after its used.
      Below call trace is observed.
      Fix the order to initialize the mutex early enough.
      Similarly follow mirror sequence during cleanup.
      
      kernel: DEBUG_LOCKS_WARN_ON(lock->magic != lock)
      kernel: WARNING: CPU: 5 PID: 45916 at kernel/locking/mutex.c:938
      __mutex_lock+0x7d6/0x8a0
      kernel: Call Trace:
      kernel: ? esw_vport_tbl_get+0x3b/0x250 [mlx5_core]
      kernel: ? mark_held_locks+0x55/0x70
      kernel: ? __slab_free+0x274/0x400
      kernel: ? lockdep_hardirqs_on+0x140/0x1d0
      kernel: esw_vport_tbl_get+0x3b/0x250 [mlx5_core]
      kernel: ? mlx5_esw_chains_create_fdb_prio+0xa57/0xc20 [mlx5_core]
      kernel: mlx5_esw_vport_tbl_get+0x88/0xf0 [mlx5_core]
      kernel: mlx5_esw_chains_create+0x2f3/0x3e0 [mlx5_core]
      kernel: esw_create_offloads_fdb_tables+0x11d/0x580 [mlx5_core]
      kernel: esw_offloads_enable+0x26d/0x540 [mlx5_core]
      kernel: mlx5_eswitch_enable_locked+0x155/0x860 [mlx5_core]
      kernel: mlx5_devlink_eswitch_mode_set+0x1af/0x320 [mlx5_core]
      kernel: devlink_nl_cmd_eswitch_set_doit+0x41/0xb0
      
      Fixes: 96e32687 ("net/mlx5e: Eswitch, Use per vport tables for mirroring")
      Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
      Reviewed-by: default avatarRoi Dayan <roid@mellanox.com>
      Reviewed-by: default avatarEli Cohen <eli@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      f8d1edda
    • Parav Pandit's avatar
      net/mlx5: E-switch, Fix printing wrong error value · e9864539
      Parav Pandit authored
      When mlx5_modify_header_alloc() fails, instead of printing the error
      value returned, current error log prints 0.
      
      Fix by printing correct error value returned by
      mlx5_modify_header_alloc().
      
      Fixes: 6724e66b ("net/mlx5: E-Switch, Get reg_c1 value on miss")
      Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
      Reviewed-by: default avatarRoi Dayan <roid@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      e9864539
    • Parav Pandit's avatar
      net/mlx5: E-switch, Fix error unwinding flow for steering init failure · 79949985
      Parav Pandit authored
      Error unwinding is done incorrectly in the cited commit.
      When steering init fails, there is no need to perform steering cleanup.
      When vport error exists, error cleanup should be mirror of the setup
      routine, i.e. to perform steering cleanup before metadata cleanup.
      
      This avoids the call trace in accessing uninitialized objects which are
      skipped during steering_init() due to failure in steering_init().
      
      Call trace:
      mlx5_cmd_modify_header_alloc:805:(pid 21128): too many modify header
      actions 1, max supported 0
      E-Switch: Failed to create restore mod header
      
      BUG: kernel NULL pointer dereference, address: 00000000000000d0
      [  677.263079]  mlx5_destroy_flow_group+0x13/0x80 [mlx5_core]
      [  677.268921]  esw_offloads_steering_cleanup+0x51/0xf0 [mlx5_core]
      [  677.275281]  esw_offloads_enable+0x1a5/0x800 [mlx5_core]
      [  677.280949]  mlx5_eswitch_enable_locked+0x155/0x860 [mlx5_core]
      [  677.287227]  mlx5_devlink_eswitch_mode_set+0x1af/0x320
      [  677.293741]  devlink_nl_cmd_eswitch_set_doit+0x41/0xb0
      [  677.299217]  genl_rcv_msg+0x1eb/0x430
      
      Fixes: 7983a675 ("net/mlx5: E-Switch, Enable chains only if regs loopback is enabled")
      Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
      Reviewed-by: default avatarRoi Dayan <roid@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      79949985
  2. 29 Apr, 2020 6 commits
  3. 28 Apr, 2020 2 commits
    • YueHaibing's avatar
      net/x25: Fix null-ptr-deref in x25_disconnect · 8999dc89
      YueHaibing authored
      We should check null before do x25_neigh_put in x25_disconnect,
      otherwise may cause null-ptr-deref like this:
      
       #include <sys/socket.h>
       #include <linux/x25.h>
      
       int main() {
          int sck_x25;
          sck_x25 = socket(AF_X25, SOCK_SEQPACKET, 0);
          close(sck_x25);
          return 0;
       }
      
      BUG: kernel NULL pointer dereference, address: 00000000000000d8
      CPU: 0 PID: 4817 Comm: t2 Not tainted 5.7.0-rc3+ #159
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.3-
      RIP: 0010:x25_disconnect+0x91/0xe0
      Call Trace:
       x25_release+0x18a/0x1b0
       __sock_release+0x3d/0xc0
       sock_close+0x13/0x20
       __fput+0x107/0x270
       ____fput+0x9/0x10
       task_work_run+0x6d/0xb0
       exit_to_usermode_loop+0x102/0x110
       do_syscall_64+0x23c/0x260
       entry_SYSCALL_64_after_hwframe+0x49/0xb3
      
      Reported-by: syzbot+6db548b615e5aeefdce2@syzkaller.appspotmail.com
      Fixes: 4becb7ee ("net/x25: Fix x25_neigh refcnt leak when x25 disconnect")
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8999dc89
    • Gavin Shan's avatar
      net/ena: Fix build warning in ena_xdp_set() · caec6619
      Gavin Shan authored
      This fixes the following build warning in ena_xdp_set(), which is
      observed on aarch64 with 64KB page size.
      
         In file included from ./include/net/inet_sock.h:19,
            from ./include/net/ip.h:27,
            from drivers/net/ethernet/amazon/ena/ena_netdev.c:46:
         drivers/net/ethernet/amazon/ena/ena_netdev.c: In function         \
         ‘ena_xdp_set’:                                                    \
         drivers/net/ethernet/amazon/ena/ena_netdev.c:557:6: warning:      \
         format ‘%lu’                                                      \
         expects argument of type ‘long unsigned int’, but argument 4      \
         has type ‘int’                                                    \
         [-Wformat=] "Failed to set xdp program, the current MTU (%d) is   \
         larger than the maximum allowed MTU (%lu) while xdp is on",
      Signed-off-by: default avatarGavin Shan <gshan@redhat.com>
      Acked-by: default avatarShay Agroskin <shayagr@amazon.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      caec6619
  4. 27 Apr, 2020 20 commits
  5. 26 Apr, 2020 2 commits
  6. 25 Apr, 2020 7 commits
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace · b2768df2
      Linus Torvalds authored
      Pull pid leak fix from Eric Biederman:
       "Oleg noticed that put_pid(thread_pid) was not getting called when proc
        was not compiled in.
      
        Let's get that fixed before 5.7 is released and causes problems for
        anyone"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
        proc: Put thread_pid in release_task not proc_flush_pid
      b2768df2
    • Linus Torvalds's avatar
      Merge tag 'timers-urgent-2020-04-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · acd62944
      Linus Torvalds authored
      Pull timer fixlet from Ingo Molnar:
       "A single fix for a comment that may show up in DocBook output"
      
      * tag 'timers-urgent-2020-04-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        vdso/datapage: Use correct clock mode name in comment
      acd62944
    • Linus Torvalds's avatar
      Merge tag 'sched-urgent-2020-04-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 05db498a
      Linus Torvalds authored
      Pull scheduler fixes from Ingo Molnar:
       "Misc fixes:
      
         - an uclamp accounting fix
      
         - three frequency invariance fixes and a readability improvement"
      
      * tag 'sched-urgent-2020-04-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/core: Fix reset-on-fork from RT with uclamp
        x86, sched: Move check for CPU type to caller function
        x86, sched: Don't enable static key when starting secondary CPUs
        x86, sched: Account for CPUs with less than 4 cores in freq. invariance
        x86, sched: Bail out of frequency invariance if base frequency is unknown
      05db498a
    • Linus Torvalds's avatar
      Merge tag 'perf-urgent-2020-04-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · e1858800
      Linus Torvalds authored
      Pull perf fixes from Ingo Molnar:
       "Two changes:
      
         - fix exit event records
      
         - extend x86 PMU driver enumeration to add Intel Jasper Lake CPU
           support"
      
      * tag 'perf-urgent-2020-04-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/core: fix parent pid/tid in task exit events
        perf/x86/cstate: Add Jasper Lake CPU support
      e1858800
    • Linus Torvalds's avatar
      Merge tag 'objtool-urgent-2020-04-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 9b3e59e3
      Linus Torvalds authored
      Pull objtool fixes from Ingo Molnar:
       "Two fixes: fix an off-by-one bug, and fix 32-bit builds on 64-bit
        systems"
      
      * tag 'objtool-urgent-2020-04-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        objtool: Fix off-by-one in symbol_by_offset()
        objtool: Fix 32bit cross builds
      9b3e59e3
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · ab51cac0
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix memory leak in netfilter flowtable, from Roi Dayan.
      
       2) Ref-count leaks in netrom and tipc, from Xiyu Yang.
      
       3) Fix warning when mptcp socket is never accepted before close, from
          Florian Westphal.
      
       4) Missed locking in ovs_ct_exit(), from Tonghao Zhang.
      
       5) Fix large delays during PTP synchornization in cxgb4, from Rahul
          Lakkireddy.
      
       6) team_mode_get() can hang, from Taehee Yoo.
      
       7) Need to use kvzalloc() when allocating fw tracer in mlx5 driver,
          from Niklas Schnelle.
      
       8) Fix handling of bpf XADD on BTF memory, from Jann Horn.
      
       9) Fix BPF_STX/BPF_B encoding in x86 bpf jit, from Luke Nelson.
      
      10) Missing queue memory release in iwlwifi pcie code, from Johannes
          Berg.
      
      11) Fix NULL deref in macvlan device event, from Taehee Yoo.
      
      12) Initialize lan87xx phy correctly, from Yuiko Oshino.
      
      13) Fix looping between VRF and XFRM lookups, from David Ahern.
      
      14) etf packet scheduler assumes all sockets are full sockets, which is
          not necessarily true. From Eric Dumazet.
      
      15) Fix mptcp data_fin handling in RX path, from Paolo Abeni.
      
      16) fib_select_default() needs to handle nexthop objects, from David
          Ahern.
      
      17) Use GFP_ATOMIC under spinlock in mac80211_hwsim, from Wei Yongjun.
      
      18) vxlan and geneve use wrong nlattr array, from Sabrina Dubroca.
      
      19) Correct rx/tx stats in bcmgenet driver, from Doug Berger.
      
      20) BPF_LDX zero-extension is encoded improperly in x86_32 bpf jit, fix
          from Luke Nelson.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (100 commits)
        selftests/bpf: Fix a couple of broken test_btf cases
        tools/runqslower: Ensure own vmlinux.h is picked up first
        bpf: Make bpf_link_fops static
        bpftool: Respect the -d option in struct_ops cmd
        selftests/bpf: Add test for freplace program with expected_attach_type
        bpf: Propagate expected_attach_type when verifying freplace programs
        bpf: Fix leak in LINK_UPDATE and enforce empty old_prog_fd
        bpf, x86_32: Fix logic error in BPF_LDX zero-extension
        bpf, x86_32: Fix clobbering of dst for BPF_JSET
        bpf, x86_32: Fix incorrect encoding in BPF_LDX zero-extension
        bpf: Fix reStructuredText markup
        net: systemport: suppress warnings on failed Rx SKB allocations
        net: bcmgenet: suppress warnings on failed Rx SKB allocations
        macsec: avoid to set wrong mtu
        mac80211: sta_info: Add lockdep condition for RCU list usage
        mac80211: populate debugfs only after cfg80211 init
        net: bcmgenet: correct per TX/RX ring statistics
        net: meth: remove spurious copyright text
        net: phy: bcm84881: clear settings on link down
        chcr: Fix CPU hard lockup
        ...
      ab51cac0
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · 167ff131
      David S. Miller authored
      Alexei Starovoitov says:
      
      ====================
      pull-request: bpf 2020-04-24
      
      The following pull-request contains BPF updates for your *net* tree.
      
      We've added 17 non-merge commits during the last 5 day(s) which contain
      a total of 19 files changed, 203 insertions(+), 85 deletions(-).
      
      The main changes are:
      
      1) link_update fix, from Andrii.
      
      2) libbpf get_xdp_id fix, from David.
      
      3) xadd verifier fix, from Jann.
      
      4) x86-32 JIT fixes, from Luke and Wang.
      
      5) test_btf fix, from Stanislav.
      
      6) freplace verifier fix, from Toke.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      167ff131