1. 04 Dec, 2020 26 commits
  2. 03 Dec, 2020 14 commits
    • Jakub Kicinski's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 55fd59b0
      Jakub Kicinski authored
      Conflicts:
      	drivers/net/ethernet/ibm/ibmvnic.c
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      55fd59b0
    • Linus Torvalds's avatar
      Merge tag 'net-5.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · bbe2ba04
      Linus Torvalds authored
      Pull networking fixes from Jakub Kicinski:
       "Networking fixes for 5.10-rc7, including fixes from bpf, netfilter,
        wireless drivers, wireless mesh and can.
      
        Current release - regressions:
      
         - mt76: usb: fix crash on device removal
      
        Current release - always broken:
      
         - xsk: Fix umem cleanup from wrong context in socket destruct
      
        Previous release - regressions:
      
         - net: ip6_gre: set dev->hard_header_len when using header_ops
      
         - ipv4: Fix TOS mask in inet_rtm_getroute()
      
         - net, xsk: Avoid taking multiple skbuff references
      
        Previous release - always broken:
      
         - net/x25: prevent a couple of overflows
      
         - netfilter: ipset: prevent uninit-value in hash_ip6_add
      
         - geneve: pull IP header before ECN decapsulation
      
         - mpls: ensure LSE is pullable in TC and openvswitch paths
      
         - vxlan: respect needed_headroom of lower device
      
         - batman-adv: Consider fragmentation for needed packet headroom
      
         - can: drivers: don't count arbitration loss as an error
      
         - netfilter: bridge: reset skb->pkt_type after POST_ROUTING traversal
      
         - inet_ecn: Fix endianness of checksum update when setting ECT(1)
      
         - ibmvnic: fix various corner cases around reset handling
      
         - net/mlx5: fix rejecting unsupported Connect-X6DX SW steering
      
         - net/mlx5: Enforce HW TX csum offload with kTLS"
      
      * tag 'net-5.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (62 commits)
        net/mlx5: DR, Proper handling of unsupported Connect-X6DX SW steering
        net/mlx5e: kTLS, Enforce HW TX csum offload with kTLS
        net: mlx5e: fix fs_tcp.c build when IPV6 is not enabled
        net/mlx5: Fix wrong address reclaim when command interface is down
        net/sched: act_mpls: ensure LSE is pullable before reading it
        net: openvswitch: ensure LSE is pullable before reading it
        net: skbuff: ensure LSE is pullable before decrementing the MPLS ttl
        net: mvpp2: Fix error return code in mvpp2_open()
        chelsio/chtls: fix a double free in chtls_setkey()
        rtw88: debug: Fix uninitialized memory in debugfs code
        vxlan: fix error return code in __vxlan_dev_create()
        net: pasemi: fix error return code in pasemi_mac_open()
        cxgb3: fix error return code in t3_sge_alloc_qset()
        net/x25: prevent a couple of overflows
        dpaa_eth: copy timestamp fields to new skb in A-050385 workaround
        net: ip6_gre: set dev->hard_header_len when using header_ops
        mt76: usb: fix crash on device removal
        iwlwifi: pcie: add some missing entries for AX210
        iwlwifi: pcie: invert values of NO_160 device config entries
        iwlwifi: pcie: add one missing entry for AX210
        ...
      bbe2ba04
    • Jakub Kicinski's avatar
      Merge branch 'mptcp-reject-invalid-mp_join-requests-right-away' · a4390e96
      Jakub Kicinski authored
      Florian Westphal says:
      
      ====================
      mptcp: reject invalid mp_join requests right away
      
      At the moment MPTCP can detect an invalid join request (invalid token,
      max number of subflows reached, and so on) right away but cannot reject
      the connection until the 3WHS has completed.
      Instead the connection will complete and the subflow is reset afterwards.
      
      To send the reset most information is already available, but we don't have
      good spot where the reset could be sent:
      
      1. The ->init_req callback is too early and also doesn't allow to return an
         error that could be used to inform the TCP stack that the SYN should be
         dropped.
      
      2. The ->route_req callback lacks the skb needed to send a reset.
      
      3. The ->send_synack callback is the best fit from the available hooks,
         but its called after the request socket has been inserted into the queue
         already. This means we'd have to remove it again right away.
      
      From a technical point of view, the second hook would be best:
       1. Its before insertion into listener queue.
       2. If it returns NULL TCP will drop the packet for us.
      
      Problem is that we'd have to pass the skb to the function just for MPTCP.
      
      Paolo suggested to merge init_req and route_req callbacks instead:
      This makes all info available to MPTCP -- a return value of NULL drops the
      packet and MPTCP can send the reset if needed.
      
      Because 'route_req' has a 'const struct sock *', this means either removal
      of const qualifier, or a bit of code churn to pass 'const' in security land.
      
      This does the latter; I did not find any spots that need write access to struct
      sock.
      
      To recap, the two alternatives are:
      1. Solve it entirely in MPTCP: use the ->send_synack callback to
         unlink the request socket from the listener & drop it.
      2. Avoid 'security' churn by removing the const qualifier.
      ====================
      
      Link: https://lore.kernel.org/r/20201130153631.21872-1-fw@strlen.deSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a4390e96
    • Florian Westphal's avatar
      mptcp: emit tcp reset when a join request fails · 3ecfbe3e
      Florian Westphal authored
      RFC 8684 says:
       If the token is unknown or the host wants to refuse subflow establishment
       (for example, due to a limit on the number of subflows it will permit),
       the receiver will send back a reset (RST) signal, analogous to an unknown
       port in TCP, containing an MP_TCPRST option (Section 3.6) with an
       "MPTCP specific error" reason code.
      
      mptcp-next doesn't support MP_TCPRST yet, this can be added in another
      change.
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Reviewed-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      3ecfbe3e
    • Florian Westphal's avatar
      tcp: merge 'init_req' and 'route_req' functions · 7ea851d1
      Florian Westphal authored
      The Multipath-TCP standard (RFC 8684) says that an MPTCP host should send
      a TCP reset if the token in a MP_JOIN request is unknown.
      
      At this time we don't do this, the 3whs completes and the 'new subflow'
      is reset afterwards.  There are two ways to allow MPTCP to send the
      reset.
      
      1. override 'send_synack' callback and emit the rst from there.
         The drawback is that the request socket gets inserted into the
         listeners queue just to get removed again right away.
      
      2. Send the reset from the 'route_req' function instead.
         This avoids the 'add&remove request socket', but route_req lacks the
         skb that is required to send the TCP reset.
      
      Instead of just adding the skb to that function for MPTCP sake alone,
      Paolo suggested to merge init_req and route_req functions.
      
      This saves one indirection from syn processing path and provides the skb
      to the merged function at the same time.
      
      'send reset on unknown mptcp join token' is added in next patch.
      Suggested-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Cc: Eric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      7ea851d1
    • Florian Westphal's avatar
      security: add const qualifier to struct sock in various places · 41dd9596
      Florian Westphal authored
      A followup change to tcp_request_sock_op would have to drop the 'const'
      qualifier from the 'route_req' function as the
      'security_inet_conn_request' call is moved there - and that function
      expects a 'struct sock *'.
      
      However, it turns out its also possible to add a const qualifier to
      security_inet_conn_request instead.
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Acked-by: default avatarJames Morris <jamorris@linux.microsoft.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      41dd9596
    • Colin Ian King's avatar
    • Brendan Jackman's avatar
      bpf: Fix cold build of test_progs-no_alu32 · 58c185b8
      Brendan Jackman authored
      This object lives inside the trunner output dir,
      i.e. tools/testing/selftests/bpf/no_alu32/btf_data.o
      
      At some point it gets copied into the parent directory during another
      part of the build, but that doesn't happen when building
      test_progs-no_alu32 from clean.
      Signed-off-by: default avatarBrendan Jackman <jackmanb@google.com>
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
      Link: https://lore.kernel.org/bpf/20201203120850.859170-1-jackmanb@google.com
      58c185b8
    • Stanislav Fomichev's avatar
      libbpf: Cap retries in sys_bpf_prog_load · d6d418bd
      Stanislav Fomichev authored
      I've seen a situation, where a process that's under pprof constantly
      generates SIGPROF which prevents program loading indefinitely.
      The right thing to do probably is to disable signals in the upper
      layers while loading, but it still would be nice to get some error from
      libbpf instead of an endless loop.
      
      Let's add some small retry limit to the program loading:
      try loading the program 5 (arbitrary) times and give up.
      
      v2:
      * 10 -> 5 retires (Andrii Nakryiko)
      Signed-off-by: default avatarStanislav Fomichev <sdf@google.com>
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      Acked-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      Link: https://lore.kernel.org/bpf/20201202231332.3923644-1-sdf@google.com
      d6d418bd
    • Linus Torvalds's avatar
      Merge tag 's390-5.10-6' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · fee5be18
      Linus Torvalds authored
      Pull s390 fixes from Heiko Carstens:
       "One commit is fixing lockdep irq state tracing which broke with -rc6.
      
        The other one fixes logical vs physical CPU address mixup in our PCI
        code.
      
        Summary:
      
         - fix lockdep irq state tracing
      
         - fix logical vs physical CPU address confusion in PCI code"
      
      * tag 's390-5.10-6' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390: fix irq state tracing
        s390/pci: fix CPU address in MSI for directed IRQ
      fee5be18
    • Toke Høiland-Jørgensen's avatar
      libbpf: Sanitise map names before pinning · 9cf309c5
      Toke Høiland-Jørgensen authored
      When we added sanitising of map names before loading programs to libbpf, we
      still allowed periods in the name. While the kernel will accept these for
      the map names themselves, they are not allowed in file names when pinning
      maps. This means that bpf_object__pin_maps() will fail if called on an
      object that contains internal maps (such as sections .rodata).
      
      Fix this by replacing periods with underscores when constructing map pin
      paths. This only affects the paths generated by libbpf when
      bpf_object__pin_maps() is called with a path argument. Any pin paths set
      by bpf_map__set_pin_path() are unaffected, and it will still be up to the
      caller to avoid invalid characters in those.
      
      Fixes: 113e6b7e ("libbpf: Sanitise internal map names so they are not rejected by the kernel")
      Signed-off-by: default avatarToke Høiland-Jørgensen <toke@redhat.com>
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      Link: https://lore.kernel.org/bpf/20201203093306.107676-1-toke@redhat.com
      9cf309c5
    • Linus Torvalds's avatar
      Merge tag '9p-for-5.10-rc7' of git://github.com/martinetd/linux · c82a505c
      Linus Torvalds authored
      Pull 9p fixes from Dominique Martinet:
       "Restore splice functionality for 9p"
      
      * tag '9p-for-5.10-rc7' of git://github.com/martinetd/linux:
        fs: 9p: add generic splice_write file operation
        fs: 9p: add generic splice_read file operations
      c82a505c
    • Andrei Matei's avatar
      libbpf: Fail early when loading programs with unspecified type · 80b2b5c3
      Andrei Matei authored
      Before this patch, a program with unspecified type
      (BPF_PROG_TYPE_UNSPEC) would be passed to the BPF syscall, only to have
      the kernel reject it with an opaque invalid argument error. This patch
      makes libbpf reject such programs with a nicer error message - in
      particular libbpf now tries to diagnose bad ELF section names at both
      open time and load time.
      Signed-off-by: default avatarAndrei Matei <andreimatei1@gmail.com>
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      Link: https://lore.kernel.org/bpf/20201203043410.59699-1-andreimatei1@gmail.com
      80b2b5c3
    • Andrii Nakryiko's avatar
      Merge branch 'Fixes for ima selftest' · a8b415c9
      Andrii Nakryiko authored
      KP Singh says:
      
      ====================
      
      From: KP Singh <kpsingh@google.com>
      
      # v3 -> v4
      
      * Fix typos.
      * Update commit message for the indentation patch.
      * Added Andrii's acks.
      
      # v2 -> v3
      
      * Added missing tags.
      * Indentation fixes + some other fixes suggested by Andrii.
      * Re-indent file to tabs.
      
      The selftest for the bpf_ima_inode_hash helper uses a shell script to
      setup the system for ima. While this worked without an issue on recent
      desktop distros, it failed on environments with stripped out shells like
      busybox which is also used by the bpf CI.
      
      This series fixes the assumptions made on the availablity of certain
      command line switches and the expectation that securityfs being mounted
      by default.
      
      It also adds the missing kernel config dependencies in
      tools/testing/selftests/bpf and, lastly, changes the indentation of
      ima_setup.sh to use tabs.
      ====================
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      a8b415c9