1. 09 11月, 2021 4 次提交
    • D
      gve: Fix off by one in gve_tx_timeout() · 1c360cc1
      Dan Carpenter 提交于
      The priv->ntfy_blocks[] has "priv->num_ntfy_blks" elements so this >
      needs to be >= to prevent an off by one bug.  The priv->ntfy_blocks[]
      array is allocated in gve_alloc_notify_blocks().
      
      Fixes: 87a7f321 ("gve: Recover from queue stall due to missed IRQ")
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1c360cc1
    • L
      hamradio: defer 6pack kfree after unregister_netdev · 0b911192
      Lin Ma 提交于
      There is a possible race condition (use-after-free) like below
      
       (USE)                       |  (FREE)
        dev_queue_xmit             |
         __dev_queue_xmit          |
          __dev_xmit_skb           |
           sch_direct_xmit         | ...
            xmit_one               |
             netdev_start_xmit     | tty_ldisc_kill
              __netdev_start_xmit  |  6pack_close
               sp_xmit             |   kfree
                sp_encaps          |
                                   |
      
      According to the patch "defer ax25 kfree after unregister_netdev", this
      patch reorder the kfree after the unregister_netdev to avoid the possible
      UAF as the unregister_netdev() is well synchronized and won't return if
      there is a running routine.
      Signed-off-by: NLin Ma <linma@zju.edu.cn>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0b911192
    • L
      hamradio: defer ax25 kfree after unregister_netdev · 3e0588c2
      Lin Ma 提交于
      There is a possible race condition (use-after-free) like below
      
       (USE)                       |  (FREE)
      ax25_sendmsg                 |
       ax25_queue_xmit             |
        dev_queue_xmit             |
         __dev_queue_xmit          |
          __dev_xmit_skb           |
           sch_direct_xmit         | ...
            xmit_one               |
             netdev_start_xmit     | tty_ldisc_kill
              __netdev_start_xmit  |  mkiss_close
               ax_xmit             |   kfree
                ax_encaps          |
                                   |
      
      Even though there are two synchronization primitives before the kfree:
      1. wait_for_completion(&ax->dead). This can prevent the race with
      routines from mkiss_ioctl. However, it cannot stop the routine coming
      from upper layer, i.e., the ax25_sendmsg.
      
      2. netif_stop_queue(ax->dev). It seems that this line of code aims to
      halt the transmit queue but it fails to stop the routine that already
      being xmit.
      
      This patch reorder the kfree after the unregister_netdev to avoid the
      possible UAF as the unregister_netdev() is well synchronized and won't
      return if there is a running routine.
      Signed-off-by: NLin Ma <linma@zju.edu.cn>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3e0588c2
    • J
      net: sungem_phy: fix code indentation · 54f0bad6
      Jean Sacren 提交于
      Remove extra space in front of the return statement.
      
      Fixes: eb5b5b2f ("sungem_phy: support bcm5461 phy, autoneg.")
      Signed-off-by: NJean Sacren <sakiwit@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      54f0bad6
  2. 08 11月, 2021 9 次提交
  3. 07 11月, 2021 8 次提交
  4. 06 11月, 2021 2 次提交
    • N
      ipv6: remove useless assignment to newinet in tcp_v6_syn_recv_sock() · 70bf363d
      Nghia Le 提交于
      The newinet value is initialized with inet_sk() in a block code to
      handle sockets for the ETH_P_IP protocol. Along this code path,
      newinet is never read. Thus, assignment to newinet is needless and
      can be removed.
      Signed-off-by: NNghia Le <nghialm78@gmail.com>
      Reviewed-by: NEric Dumazet <edumazet@google.com>
      Link: https://lore.kernel.org/r/20211104143740.32446-1-nghialm78@gmail.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      70bf363d
    • J
      Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · 9bea6aa4
      Jakub Kicinski 提交于
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf 2021-11-05
      
      We've added 15 non-merge commits during the last 3 day(s) which contain
      a total of 14 files changed, 199 insertions(+), 90 deletions(-).
      
      The main changes are:
      
      1) Fix regression from stack spill/fill of <8 byte scalars, from Martin KaFai Lau.
      
      2) Fix perf's build of bpftool's bootstrap version due to missing libbpf
         headers, from Quentin Monnet.
      
      3) Fix riscv{32,64} BPF exception tables build errors and warnings, from Björn Töpel.
      
      4) Fix bpf fs to allow RENAME_EXCHANGE support for atomic upgrades on sk_lookup
         control planes, from Lorenz Bauer.
      
      5) Fix libbpf's error reporting in bpf_map_lookup_and_delete_elem_flags() due to
         missing libbpf_err_errno(), from Mehrdad Arshad Rad.
      
      6) Various fixes to make xdp_redirect_multi selftest more reliable, from Hangbin Liu.
      
      7) Fix netcnt selftest to make it run serial and thus avoid conflicts with other
         cgroup/skb selftests run in parallel that could cause flakes, from Andrii Nakryiko.
      
      8) Fix reuseport_bpf_numa networking selftest to skip unavailable NUMA nodes,
         from Kleber Sacilotto de Souza.
      
      * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf:
        riscv, bpf: Fix RV32 broken build, and silence RV64 warning
        selftests/bpf/xdp_redirect_multi: Limit the tests in netns
        selftests/bpf/xdp_redirect_multi: Give tcpdump a chance to terminate cleanly
        selftests/bpf/xdp_redirect_multi: Use arping to accurate the arp number
        selftests/bpf/xdp_redirect_multi: Put the logs to tmp folder
        libbpf: Fix lookup_and_delete_elem_flags error reporting
        bpftool: Install libbpf headers for the bootstrap version, too
        selftests/net: Fix reuseport_bpf_numa by skipping unavailable nodes
        selftests/bpf: Verifier test on refill from a smaller spill
        bpf: Do not reject when the stack read size is different from the tracked scalar size
        selftests/bpf: Make netcnt selftests serial to avoid spurious failures
        selftests/bpf: Test RENAME_EXCHANGE and RENAME_NOREPLACE on bpffs
        selftests/bpf: Convert test_bpffs to ASSERT macros
        libfs: Support RENAME_EXCHANGE in simple_rename()
        libfs: Move shmem_exchange to simple_rename_exchange
      ====================
      
      Link: https://lore.kernel.org/r/20211105165803.29372-1-daniel@iogearbox.netSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      9bea6aa4
  5. 05 11月, 2021 17 次提交