Skip to content
  1. Mar 23, 2021
  2. Mar 21, 2021
    • Bhaskar Chowdhury's avatar
      docs: networking: Fix a typo · 87d77e59
      Bhaskar Chowdhury authored
      
      
      s/subsytem/subsystem/
      
      Signed-off-by: default avatarBhaskar Chowdhury <unixbhaskar@gmail.com>
      Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      87d77e59
    • Heiner Kallweit's avatar
      r8169: fix DMA being used after buffer free if WoL is enabled · f658b909
      Heiner Kallweit authored
      IOMMU errors have been reported if WoL is enabled and interface is
      brought down. It turned out that the network chip triggers DMA
      transfers after the DMA buffers have been freed. For WoL to work we
      need to leave rx enabled, therefore simply stop the chip from being
      a DMA busmaster.
      
      Fixes: 567ca57f
      
       ("r8169: add rtl8169_up")
      Tested-by: default avatarPaul Blazejowski <paulb@blazebox.homeip.net>
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f658b909
    • David S. Miller's avatar
      Merge tag 'linux-can-fixes-for-5.12-20210320' of... · 49371a8a
      David S. Miller authored
      
      Merge tag 'linux-can-fixes-for-5.12-20210320' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
      
      Marc Kleine-Budde says:
      
      ====================
      pull-request: can 2021-03-20
      
      this is a pull request of 2 patches for net/master.
      
      The first patch is by Oliver Hartkopp. He fixes the TX-path in the
      ISO-TP protocol by properly initializing the outgoing CAN frames.
      
      The second patch is by me and reverts a patch from my previous pull
      request which added MODULE_SUPPORTED_DEVICE to the peak_usb driver. In
      the mean time in Linus's tree the entirely MODULE_SUPPORTED_DEVICE was
      removed. So this reverts the adding of the new MODULE_SUPPORTED_DEVICE
      to avoid the merge conflict.
      
      If you prefer to resolve the merge conflict by hand, I'll send a new
      pull request without that patch.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      49371a8a
    • David S. Miller's avatar
      Merge branch 'pa-fox-validation' · a05b0c8c
      David S. Miller authored
      
      
      Alex Elder says:
      
      ====================
      ipa: fix validation
      
      There is sanity checking code in the IPA driver that's meant to be
      enabled only during development.  This allows the driver to make
      certain assumptions, but not have to verify those assumptions are
      true at (operational) runtime.  This code is built conditional on
      IPA_VALIDATION, set (if desired) inside the IPA makefile.
      
      Unfortunately, this validation code has some errors.  First, there
      are some mismatched arguments supplied to some dev_err() calls in
      ipa_cmd_table_valid() and ipa_cmd_header_valid(), and these are
      exposed if validation is enabled.  Second, the tag that enables
      this conditional code isn't used consistently (it's IPA_VALIDATE
      in some spots and IPA_VALIDATION in others).
      
      This series fixes those two problems with the conditional validation
      code.
      
      Version 2 removes the two patches that introduced ipa_assert().  It
      also modifies the description in the first patch so that it mentions
      the changes made to ipa_cmd_table_valid().
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a05b0c8c
    • Alex Elder's avatar
      net: ipa: fix init header command validation · b4afd4b9
      Alex Elder authored
      
      
      We use ipa_cmd_header_valid() to ensure certain values we will
      program into hardware are within range, well in advance of when we
      actually program them.  This way we avoid having to check for errors
      when we actually program the hardware.
      
      Unfortunately the dev_err() call for a bad offset value does not
      supply the arguments to match the format specifiers properly.
      Fix this.
      
      There was also supposed to be a check to ensure the size to be
      programmed fits in the field that holds it.  Add this missing check.
      
      Rearrange the way we ensure the header table fits in overall IPA
      memory range.
      
      Finally, update ipa_cmd_table_valid() so the format of messages
      printed for errors matches what's done in ipa_cmd_header_valid().
      
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b4afd4b9
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · e56c53d1
      David S. Miller authored
      
      
      Alexei Starovoitov says:
      
      ====================
      pull-request: bpf 2021-03-20
      
      The following pull-request contains BPF updates for your *net* tree.
      
      We've added 5 non-merge commits during the last 3 day(s) which contain
      a total of 8 files changed, 155 insertions(+), 12 deletions(-).
      
      The main changes are:
      
      1) Use correct nops in fexit trampoline, from Stanislav.
      
      2) Fix BTF dump, from Jean-Philippe.
      
      3) Fix umd memory leak, from Zqiang.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e56c53d1
    • Marc Kleine-Budde's avatar
      can: peak_usb: Revert "can: peak_usb: add forgotten supported devices" · 5d7047ed
      Marc Kleine-Budde authored
      In commit 6417f031 ("module: remove never implemented
      MODULE_SUPPORTED_DEVICE") the MODULE_SUPPORTED_DEVICE macro was
      removed from the kerne entirely. Shortly before this patch was applied
      mainline the commit 59ec7b89 ("can: peak_usb: add forgotten
      supported devices") was added to net/master. As this would result in a
      merge conflict, let's revert this patch.
      
      Fixes: 59ec7b89
      
       ("can: peak_usb: add forgotten supported devices")
      Link: https://lore.kernel.org/r/20210320192649.341832-1-mkl@pengutronix.de
      Suggested-by: default avatarLeon Romanovsky <leon@kernel.org>
      Cc: Stephane Grosjean <s.grosjean@peak-system.com>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      5d7047ed
    • Oliver Hartkopp's avatar
      can: isotp: tx-path: zero initialize outgoing CAN frames · b5f020f8
      Oliver Hartkopp authored
      Commit d4eb538e ("can: isotp: TX-path: ensure that CAN frame flags are
      initialized") ensured the TX flags to be properly set for outgoing CAN
      frames.
      
      In fact the root cause of the issue results from a missing initialization
      of outgoing CAN frames created by isotp. This is no problem on the CAN bus
      as the CAN driver only picks the correctly defined content from the struct
      can(fd)_frame. But when the outgoing frames are monitored (e.g. with
      candump) we potentially leak some bytes in the unused content of
      struct can(fd)_frame.
      
      Fixes: e057dd3f
      
       ("can: add ISO 15765-2:2016 transport protocol")
      Cc: Marc Kleine-Budde <mkl@pengutronix.de>
      Link: https://lore.kernel.org/r/20210319100619.10858-1-socketcan@hartkopp.net
      Signed-off-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      b5f020f8
  3. Mar 20, 2021
    • Stanislav Fomichev's avatar
      bpf: Use NOP_ATOMIC5 instead of emit_nops(&prog, 5) for BPF_TRAMP_F_CALL_ORIG · b9082970
      Stanislav Fomichev authored
      __bpf_arch_text_poke does rewrite only for atomic nop5, emit_nops(xxx, 5)
      emits non-atomic one which breaks fentry/fexit with k8 atomics:
      
      P6_NOP5 == P6_NOP5_ATOMIC (0f1f440000 == 0f1f440000)
      K8_NOP5 != K8_NOP5_ATOMIC (6666906690 != 6666666690)
      
      Can be reproduced by doing "ideal_nops = k8_nops" in "arch_init_ideal_nops()
      and running fexit_bpf2bpf selftest.
      
      Fixes: e21aa341
      
       ("bpf: Fix fexit trampoline.")
      Signed-off-by: default avatarStanislav Fomichev <sdf@google.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/20210320000001.915366-1-sdf@google.com
      b9082970
    • Zqiang's avatar
      bpf: Fix umd memory leak in copy_process() · f60a85ca
      Zqiang authored
      The syzbot reported a memleak as follows:
      
      BUG: memory leak
      unreferenced object 0xffff888101b41d00 (size 120):
        comm "kworker/u4:0", pid 8, jiffies 4294944270 (age 12.780s)
        backtrace:
          [<ffffffff8125dc56>] alloc_pid+0x66/0x560
          [<ffffffff81226405>] copy_process+0x1465/0x25e0
          [<ffffffff81227943>] kernel_clone+0xf3/0x670
          [<ffffffff812281a1>] kernel_thread+0x61/0x80
          [<ffffffff81253464>] call_usermodehelper_exec_work
          [<ffffffff81253464>] call_usermodehelper_exec_work+0xc4/0x120
          [<ffffffff812591c9>] process_one_work+0x2c9/0x600
          [<ffffffff81259ab9>] worker_thread+0x59/0x5d0
          [<ffffffff812611c8>] kthread+0x178/0x1b0
          [<ffffffff8100227f>] ret_from_fork+0x1f/0x30
      
      unreferenced object 0xffff888110ef5c00 (size 232):
        comm "kworker/u4:0", pid 8414, jiffies 4294944270 (age 12.780s)
        backtrace:
          [<ffffffff8154a0cf>] kmem_cache_zalloc
          [<ffffffff8154a0cf>] __alloc_file+0x1f/0xf0
          [<ffffffff8154a809>] alloc_empty_file+0x69/0x120
          [<ffffffff8154a8f3>] alloc_file+0x33/0x1b0
          [<ffffffff8154ab22>] alloc_file_pseudo+0xb2/0x140
          [<ffffffff81559218>] create_pipe_files+0x138/0x2e0
          [<ffffffff8126c793>] umd_setup+0x33/0x220
          [<ffffffff81253574>] call_usermodehelper_exec_async+0xb4/0x1b0
          [<ffffffff8100227f>] ret_from_fork+0x1f/0x30
      
      After the UMD process exits, the pipe_to_umh/pipe_from_umh and
      tgid need to be released.
      
      Fixes: d71fa5c9
      
       ("bpf: Add kernel module with user mode driver that populates bpffs.")
      Reported-by: default avatar <syzbot+44908bb56d2bfe56b28e@syzkaller.appspotmail.com>
      Signed-off-by: default avatarZqiang <qiang.zhang@windriver.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Link: https://lore.kernel.org/bpf/20210317030915.2865-1-qiang.zhang@windriver.com
      f60a85ca
    • Andrii Nakryiko's avatar
      Merge branch 'libbpf: Fix BTF dump of pointer-to-array-of-struct' · e75b513e
      Andrii Nakryiko authored
      
      
      Jean-Philippe Brucker says:
      
      ====================
      
      Fix an issue with the libbpf BTF dump, see patch 1 for details.
      
      Since [v1] I added the selftest in patch 2, though I couldn't figure out
      a way to make it independent from the order in which debug info is
      issued by the compiler.
      
      [v1]: https://lore.kernel.org/bpf/20210318122700.396574-1-jean-philippe@linaro.org/
      ====================
      
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      e75b513e
    • Jean-Philippe Brucker's avatar
      selftests/bpf: Add selftest for pointer-to-array-of-struct BTF dump · f118aac6
      Jean-Philippe Brucker authored
      
      
      Bpftool used to issue forward declarations for a struct used as part of
      a pointer to array, which is invalid. Add a test to check that the
      struct is fully defined in this case:
      
      	@@ -134,9 +134,9 @@
      	 	};
      	 };
      
      	-struct struct_in_array {};
      	+struct struct_in_array;
      
      	-struct struct_in_array_typed {};
      	+struct struct_in_array_typed;
      
      	 typedef struct struct_in_array_typed struct_in_array_t[2];
      
      	@@ -189,3 +189,7 @@
      	 	struct struct_with_embedded_stuff _14;
      	 };
      
      	+struct struct_in_array {};
      	+
      	+struct struct_in_array_typed {};
      	+
      	...
      	#13/1 btf_dump: syntax:FAIL
      
      Suggested-by: default avatarAndrii Nakryiko <andrii.nakryiko@gmail.com>
      Signed-off-by: default avatarJean-Philippe Brucker <jean-philippe@linaro.org>
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      Link: https://lore.kernel.org/bpf/20210319112554.794552-3-jean-philippe@linaro.org
      f118aac6
    • Jean-Philippe Brucker's avatar
      libbpf: Fix BTF dump of pointer-to-array-of-struct · 901ee1d7
      Jean-Philippe Brucker authored
      The vmlinux.h generated from BTF is invalid when building
      drivers/phy/ti/phy-gmii-sel.c with clang:
      
      vmlinux.h:61702:27: error: array type has incomplete element type ‘struct reg_field’
      61702 |  const struct reg_field (*regfields)[3];
            |                           ^~~~~~~~~
      
      bpftool generates a forward declaration for this struct regfield, which
      compilers aren't happy about. Here's a simplified reproducer:
      
      	struct inner {
      		int val;
      	};
      	struct outer {
      		struct inner (*ptr_to_array)[2];
      	} A;
      
      After build with clang -> bpftool btf dump c -> clang/gcc:
      ./def-clang.h:11:23: error: array has incomplete element type 'struct inner'
              struct inner (*ptr_to_array)[2];
      
      Member ptr_to_array of struct outer is a pointer to an array of struct
      inner. In the DWARF generated by clang, struct outer appears before
      struct inner, so when converting BTF of struct outer into C, bpftool
      issues a forward declaration to struct inner. With GCC the DWARF info is
      reversed so struct inner gets fully defined.
      
      That forward declaration is not sufficient when compilers handle an
      array of the struct, even when it's only used through a pointer. Note
      that we can trigger the same issue with an intermediate typedef:
      
      	struct inner {
      	        int val;
      	};
      	typedef struct inner inner2_t[2];
      	struct outer {
      	        inner2_t *ptr_to_array;
      	} A;
      
      Becomes:
      
      	struct inner;
      	typedef struct inner inner2_t[2];
      
      And causes:
      
      ./def-clang.h:10:30: error: array has incomplete element type 'struct inner'
      	typedef struct inner inner2_t[2];
      
      To fix this, clear through_ptr whenever we encounter an intermediate
      array, to make the inner struct part of a strong link and force full
      declaration.
      
      Fixes: 351131b5
      
       ("libbpf: add btf_dump API for BTF-to-C conversion")
      Signed-off-by: default avatarJean-Philippe Brucker <jean-philippe@linaro.org>
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      Link: https://lore.kernel.org/bpf/20210319112554.794552-2-jean-philippe@linaro.org
      901ee1d7
    • Hangbin Liu's avatar
      selftests: forwarding: vxlan_bridge_1d: Fix vxlan ecn decapsulate value · 5aa3c334
      Hangbin Liu authored
      The ECN bit defines ECT(1) = 1, ECT(0) = 2. So inner 0x02 + outer 0x01
      should be inner ECT(0) + outer ECT(1). Based on the description of
      __INET_ECN_decapsulate, the final decapsulate value should be
      ECT(1). So fix the test expect value to 0x01.
      
      Before the fix:
      TEST: VXLAN: ECN decap: 01/02->0x02                                 [FAIL]
              Expected to capture 10 packets, got 0.
      
      After the fix:
      TEST: VXLAN: ECN decap: 01/02->0x01                                 [ OK ]
      
      Fixes: a0b61f3d
      
       ("selftests: forwarding: vxlan_bridge_1d: Add an ECN decap test")
      Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5aa3c334
    • Mat Martineau's avatar
      mptcp: Change mailing list address · ef2ef02c
      Mat Martineau authored
      
      
      The mailing list for MPTCP maintenance has moved to the
      kernel.org-supported mptcp@lists.linux.dev address.
      
      Complete, combined archives for both lists are now hosted at
      https://lore.kernel.org/mptcp
      
      Cc: Matthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Acked-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ef2ef02c
    • David S. Miller's avatar
      Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue · 3c16e398
      David S. Miller authored
      
      
      Tony Nguyen says:
      
      ====================
      Intel Wired LAN Driver Updates 2021-03-19
      
      This series contains updates to e1000e and igb drivers.
      
      Tom Seewald fixes duplicate guard issues by including the driver name in
      the guard for e1000e and igb.
      
      Jesse adds checks that timestamping is on and valid to avoid possible
      issues with a misinterpreted time stamp for igb.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3c16e398
    • David Brazdil's avatar
      selinux: vsock: Set SID for socket returned by accept() · 1f935e8e
      David Brazdil authored
      For AF_VSOCK, accept() currently returns sockets that are unlabelled.
      Other socket families derive the child's SID from the SID of the parent
      and the SID of the incoming packet. This is typically done as the
      connected socket is placed in the queue that accept() removes from.
      
      Reuse the existing 'security_sk_clone' hook to copy the SID from the
      parent (server) socket to the child. There is no packet SID in this
      case.
      
      Fixes: d021c344
      
       ("VSOCK: Introduce VM Sockets")
      Signed-off-by: default avatarDavid Brazdil <dbrazdil@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1f935e8e
    • Corentin Labbe's avatar
      net: stmmac: dwmac-sun8i: Provide TX and RX fifo sizes · 014dfa26
      Corentin Labbe authored
      MTU cannot be changed on dwmac-sun8i. (ip link set eth0 mtu xxx returning EINVAL)
      This is due to tx_fifo_size being 0, since this value is used to compute valid
      MTU range.
      Like dwmac-sunxi (with commit 806fd188 ("net: stmmac: dwmac-sunxi: Provide TX and RX fifo sizes"))
      dwmac-sun8i need to have tx and rx fifo sizes set.
      I have used values from datasheets.
      After this patch, setting a non-default MTU (like 1000) value works and network is still useable.
      
      Tested-on: sun8i-h3-orangepi-pc
      Tested-on: sun8i-r40-bananapi-m2-ultra
      Tested-on: sun50i-a64-bananapi-m64
      Tested-on: sun50i-h5-nanopi-neo-plus2
      Tested-on: sun50i-h6-pine-h64
      Fixes: 9f93ac8d
      
       ("net-next: stmmac: Add dwmac-sun8i")
      Reported-by: default avatarBelisko Marek <marek.belisko@gmail.com>
      Signed-off-by: default avatarCorentin Labbe <clabbe@baylibre.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      014dfa26
    • Hayes Wang's avatar
      r8152: limit the RX buffer size of RTL8153A for USB 2.0 · f91a50d8
      Hayes Wang authored
      If the USB host controller is EHCI, the throughput is reduced from
      300Mb/s to 60Mb/s, when the rx buffer size is modified from 16K to
      32K.
      
      According to the EHCI spec, the maximum size of the qTD is 20K.
      Therefore, when the driver uses more than 20K buffer, the latency
      time of EHCI would be increased. And, it let the RTL8153A get worse
      throughput.
      
      However, the driver uses alloc_pages() for rx buffer, so I limit
      the rx buffer to 16K rather than 20K.
      
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=205923
      Fixes: ec5791c2
      
       ("r8152: separate the rx buffer size")
      Reported-by: default avatarRobert Davies <robdavies1977@gmail.com>
      Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f91a50d8
    • Bhaskar Chowdhury's avatar
      sch_red: Fix a typo · 8a2dc6af
      Bhaskar Chowdhury authored
      
      
      s/recalcultion/recalculation/
      
      Signed-off-by: default avatarBhaskar Chowdhury <unixbhaskar@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8a2dc6af
    • Xin Long's avatar
      sctp: move sk_route_caps check and set into sctp_outq_flush_transports · 8ff0b1f0
      Xin Long authored
      
      
      The sk's sk_route_caps is set in sctp_packet_config, and later it
      only needs to change when traversing the transport_list in a loop,
      as the dst might be changed in the tx path.
      
      So move sk_route_caps check and set into sctp_outq_flush_transports
      from sctp_packet_transmit. This also fixes a dst leak reported by
      Chen Yi:
      
        https://bugzilla.kernel.org/show_bug.cgi?id=212227
      
      As calling sk_setup_caps() in sctp_packet_transmit may also set the
      sk_route_caps for the ctrl sock in a netns. When the netns is being
      deleted, the ctrl sock's releasing is later than dst dev's deleting,
      which will cause this dev's deleting to hang and dmesg error occurs:
      
        unregister_netdevice: waiting for xxx to become free. Usage count = 1
      
      Reported-by: default avatarChen Yi <yiche@redhat.com>
      Fixes: bcd623d8
      
       ("sctp: call sk_setup_caps in sctp_packet_transmit instead")
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8ff0b1f0
  4. Mar 19, 2021