1. 03 2月, 2021 13 次提交
  2. 02 2月, 2021 17 次提交
  3. 01 2月, 2021 1 次提交
  4. 31 1月, 2021 1 次提交
    • C
      neighbour: Prevent a dead entry from updating gc_list · eb4e8fac
      Chinmay Agarwal 提交于
      Following race condition was detected:
      <CPU A, t0> - neigh_flush_dev() is under execution and calls
      neigh_mark_dead(n) marking the neighbour entry 'n' as dead.
      
      <CPU B, t1> - Executing: __netif_receive_skb() ->
      __netif_receive_skb_core() -> arp_rcv() -> arp_process().arp_process()
      calls __neigh_lookup() which takes a reference on neighbour entry 'n'.
      
      <CPU A, t2> - Moves further along neigh_flush_dev() and calls
      neigh_cleanup_and_release(n), but since reference count increased in t2,
      'n' couldn't be destroyed.
      
      <CPU B, t3> - Moves further along, arp_process() and calls
      neigh_update()-> __neigh_update() -> neigh_update_gc_list(), which adds
      the neighbour entry back in gc_list(neigh_mark_dead(), removed it
      earlier in t0 from gc_list)
      
      <CPU B, t4> - arp_process() finally calls neigh_release(n), destroying
      the neighbour entry.
      
      This leads to 'n' still being part of gc_list, but the actual
      neighbour structure has been freed.
      
      The situation can be prevented from happening if we disallow a dead
      entry to have any possibility of updating gc_list. This is what the
      patch intends to achieve.
      
      Fixes: 9c29a2f5 ("neighbor: Fix locking order for gc_list changes")
      Signed-off-by: NChinmay Agarwal <chinagar@codeaurora.org>
      Reviewed-by: NCong Wang <xiyou.wangcong@gmail.com>
      Reviewed-by: NDavid Ahern <dsahern@kernel.org>
      Link: https://lore.kernel.org/r/20210127165453.GA20514@chinagar-linux.qualcomm.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      eb4e8fac
  5. 30 1月, 2021 3 次提交
  6. 29 1月, 2021 5 次提交
    • J
      Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · 06cc6e5d
      Jakub Kicinski 提交于
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf 2021-01-29
      
      1) Fix two copy_{from,to}_user() warn_on_once splats for BPF cgroup getsockopt
         infra when user space is trying to race against optlen, from Loris Reiff.
      
      2) Fix a missing fput() in BPF inode storage map update helper, from Pan Bian.
      
      3) Fix a build error on unresolved symbols on disabled networking / keys LSM
         hooks, from Mikko Ylinen.
      
      4) Fix preload BPF prog build when the output directory from make points to a
         relative path, from Quentin Monnet.
      
      * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf:
        bpf, preload: Fix build when $(O) points to a relative path
        bpf: Drop disabled LSM hooks from the sleepable set
        bpf, inode_storage: Put file handler if no storage was found
        bpf, cgroup: Fix problematic bounds check
        bpf, cgroup: Fix optlen WARN_ON_ONCE toctou
      ====================
      
      Link: https://lore.kernel.org/r/20210129001556.6648-1-daniel@iogearbox.netSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      06cc6e5d
    • L
      Merge tag 'net-5.11-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 909b447d
      Linus Torvalds 提交于
      Pull networking fixes from Jakub Kicinski:
       "Networking fixes including fixes from can, xfrm, wireless,
        wireless-drivers and netfilter trees. Nothing scary, Intel
        WiFi-related fixes seemed most notable to the users.
      
        Current release - regressions:
      
         - dsa: microchip: ksz8795: fix KSZ8794 port map again to program the
           CPU port correctly
      
        Current release - new code bugs:
      
         - iwlwifi: pcie: reschedule in long-running memory reads
      
        Previous releases - regressions:
      
         - iwlwifi: dbg: don't try to overwrite read-only FW data
      
         - iwlwifi: provide gso_type to GSO packets
      
         - octeontx2: make sure the buffer is 128 byte aligned
      
         - tcp: make TCP_USER_TIMEOUT accurate for zero window probes
      
         - xfrm: fix wraparound in xfrm_policy_addr_delta()
      
         - xfrm: fix oops in xfrm_replay_advance_bmp due to a race between
           CPUs in presence of packet reorder
      
         - tcp: fix TLP timer not set when CA_STATE changes from DISORDER to
           OPEN
      
         - wext: fix NULL-ptr-dereference with cfg80211's lack of commit()
      
        Previous releases - always broken:
      
         - igc: fix link speed advertising
      
         - stmmac: configure EHL PSE0 GbE and PSE1 GbE to 32 bits DMA
           addressing
      
         - team: protect features update by RCU to avoid deadlock
      
         - xfrm: fix disable_xfrm sysctl when used on xfrm interfaces
           themselves
      
         - fec: fix temporary RMII clock reset on link up
      
         - can: dev: prevent potential information leak in can_fill_info()
      
        Misc:
      
         - mrp: fix bad packing of MRP test packet structures
      
         - uapi: fix big endian definition of ipv6_rpl_sr_hdr
      
         - add David Ahern to IPv4/IPv6 maintainers"
      
      * tag 'net-5.11-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (86 commits)
        rxrpc: Fix memory leak in rxrpc_lookup_local
        mlxsw: spectrum_span: Do not overwrite policer configuration
        selftests: forwarding: Specify interface when invoking mausezahn
        stmmac: intel: Configure EHL PSE0 GbE and PSE1 GbE to 32 bits DMA addressing
        net: usb: cdc_ether: added support for Thales Cinterion PLSx3 modem family.
        ibmvnic: Ensure that CRQ entry read are correctly ordered
        MAINTAINERS: add missing header for bonding
        net: decnet: fix netdev refcount leaking on error path
        net: switchdev: don't set port_obj_info->handled true when -EOPNOTSUPP
        can: dev: prevent potential information leak in can_fill_info()
        net: fec: Fix temporary RMII clock reset on link up
        net: lapb: Add locking to the lapb module
        team: protect features update by RCU to avoid deadlock
        MAINTAINERS: add David Ahern to IPv4/IPv6 maintainers
        net/mlx5: CT: Fix incorrect removal of tuple_nat_node from nat rhashtable
        net/mlx5e: Revert parameters on errors when changing MTU and LRO state without reset
        net/mlx5e: Revert parameters on errors when changing trust state without reset
        net/mlx5e: Correctly handle changing the number of queues when the interface is down
        net/mlx5e: Fix CT rule + encap slow path offload and deletion
        net/mlx5e: Disable hw-tc-offload when MLX5_CLS_ACT config is disabled
        ...
      909b447d
    • T
      rxrpc: Fix memory leak in rxrpc_lookup_local · b8323f72
      Takeshi Misawa 提交于
      Commit 9ebeddef ("rxrpc: rxrpc_peer needs to hold a ref on the rxrpc_local record")
      Then release ref in __rxrpc_put_peer and rxrpc_put_peer_locked.
      
      	struct rxrpc_peer *rxrpc_alloc_peer(struct rxrpc_local *local, gfp_t gfp)
      	-               peer->local = local;
      	+               peer->local = rxrpc_get_local(local);
      
      rxrpc_discard_prealloc also need ref release in discarding.
      
      syzbot report:
      BUG: memory leak
      unreferenced object 0xffff8881080ddc00 (size 256):
        comm "syz-executor339", pid 8462, jiffies 4294942238 (age 12.350s)
        hex dump (first 32 bytes):
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
          00 00 00 00 0a 00 00 00 00 c0 00 08 81 88 ff ff  ................
        backtrace:
          [<000000002b6e495f>] kmalloc include/linux/slab.h:552 [inline]
          [<000000002b6e495f>] kzalloc include/linux/slab.h:682 [inline]
          [<000000002b6e495f>] rxrpc_alloc_local net/rxrpc/local_object.c:79 [inline]
          [<000000002b6e495f>] rxrpc_lookup_local+0x1c1/0x760 net/rxrpc/local_object.c:244
          [<000000006b43a77b>] rxrpc_bind+0x174/0x240 net/rxrpc/af_rxrpc.c:149
          [<00000000fd447a55>] afs_open_socket+0xdb/0x200 fs/afs/rxrpc.c:64
          [<000000007fd8867c>] afs_net_init+0x2b4/0x340 fs/afs/main.c:126
          [<0000000063d80ec1>] ops_init+0x4e/0x190 net/core/net_namespace.c:152
          [<00000000073c5efa>] setup_net+0xde/0x2d0 net/core/net_namespace.c:342
          [<00000000a6744d5b>] copy_net_ns+0x19f/0x3e0 net/core/net_namespace.c:483
          [<0000000017d3aec3>] create_new_namespaces+0x199/0x4f0 kernel/nsproxy.c:110
          [<00000000186271ef>] unshare_nsproxy_namespaces+0x9b/0x120 kernel/nsproxy.c:226
          [<000000002de7bac4>] ksys_unshare+0x2fe/0x5c0 kernel/fork.c:2957
          [<00000000349b12ba>] __do_sys_unshare kernel/fork.c:3025 [inline]
          [<00000000349b12ba>] __se_sys_unshare kernel/fork.c:3023 [inline]
          [<00000000349b12ba>] __x64_sys_unshare+0x12/0x20 kernel/fork.c:3023
          [<000000006d178ef7>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
          [<00000000637076d4>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      Fixes: 9ebeddef ("rxrpc: rxrpc_peer needs to hold a ref on the rxrpc_local record")
      Signed-off-by: NTakeshi Misawa <jeliantsurux@gmail.com>
      Reported-and-tested-by: syzbot+305326672fed51b205f7@syzkaller.appspotmail.com
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Link: https://lore.kernel.org/r/161183091692.3506637.3206605651502458810.stgit@warthog.procyon.org.ukSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      b8323f72
    • J
      Merge branch 'mlxsw-various-fixes' · 924b171c
      Jakub Kicinski 提交于
      Ido Schimmel says:
      
      ====================
      mlxsw: Various fixes
      
      Patch #1 fixes wrong invocation of mausezahn in a couple of selftests.
      The tests started failing after Fedora updated their libnet package from
      version 1.1.6 to 1.2.1. With the fix the tests pass regardless of libnet
      version.
      
      Patch #2 fixes an issue in the mirroring to CPU code that results in
      policer configuration being overwritten.
      ====================
      
      Link: https://lore.kernel.org/r/20210128144820.3280295-1-idosch@idosch.orgSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      924b171c
    • I
      mlxsw: spectrum_span: Do not overwrite policer configuration · b6f6881a
      Ido Schimmel 提交于
      The purpose of the delayed work in the SPAN module is to potentially
      update the destination port and various encapsulation parameters of SPAN
      agents that point to a VLAN device or a GRE tap. The destination port
      can change following the insertion of a new route, for example.
      
      SPAN agents that point to a physical port or the CPU port are static and
      never change throughout the lifetime of the SPAN agent. Therefore, skip
      over them in the delayed work.
      
      This fixes an issue where the delayed work overwrites the policer
      that was set on a SPAN agent pointing to the CPU. Modifying the delayed
      work to inherit the original policer configuration is error-prone, as
      the same will be needed for any new parameter.
      
      Fixes: 4039504e ("mlxsw: spectrum_span: Allow setting policer on a SPAN agent")
      Reviewed-by: NPetr Machata <petrm@nvidia.com>
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      b6f6881a