Skip to content
  1. May 08, 2021
  2. May 07, 2021
    • Arjun Roy's avatar
      tcp: Specify cmsgbuf is user pointer for receive zerocopy. · a6f8ee58
      Arjun Roy authored
      A prior change (1f466e1f) introduces separate handling for
      ->msg_control depending on whether the pointer is a kernel or user
      pointer. However, while tcp receive zerocopy is using this field, it
      is not properly annotating that the buffer in this case is a user
      pointer. This can cause faults when the improper mechanism is used
      within put_cmsg().
      
      This patch simply annotates tcp receive zerocopy's use as explicitly
      being a user pointer.
      
      Fixes: 7eeba170
      
       ("tcp: Add receive timestamp support for receive zerocopy.")
      Signed-off-by: default avatarArjun Roy <arjunroy@google.com>
      Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Link: https://lore.kernel.org/r/20210506223530.2266456-1-arjunroy.kdev@gmail.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a6f8ee58
    • Ido Schimmel's avatar
      mlxsw: spectrum_mr: Update egress RIF list before route's action · cbaf3f6a
      Ido Schimmel authored
      Each multicast route that is forwarding packets (as opposed to trapping
      them) points to a list of egress router interfaces (RIFs) through which
      packets are replicated.
      
      A route's action can transition from trap to forward when a RIF is
      created for one of the route's egress virtual interfaces (eVIF). When
      this happens, the route's action is first updated and only later the
      list of egress RIFs is committed to the device.
      
      This results in the route pointing to an invalid list. In case the list
      pointer is out of range (due to uninitialized memory), the device will
      complain:
      
      mlxsw_spectrum2 0000:06:00.0: EMAD reg access failed (tid=5733bf490000905c,reg_id=300f(pefa),type=write,status=7(bad parameter))
      
      Fix this by first committing the list of egress RIFs to the device and
      only later update the route's action.
      
      Note that a fix is not needed in the reverse function (i.e.,
      mlxsw_sp_mr_route_evif_unresolve()), as there the route's action is
      first updated and only later the RIF is removed from the list.
      
      Cc: stable@vger.kernel.org
      Fixes: c011ec1b
      
       ("mlxsw: spectrum: Add the multicast routing offloading logic")
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
      Link: https://lore.kernel.org/r/20210506072308.3834303-1-idosch@idosch.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      cbaf3f6a
    • Alex Elder's avatar
      net: ipa: fix inter-EE IRQ register definitions · 6a780f51
      Alex Elder authored
      In gsi_irq_setup(), two registers are written with the intention of
      disabling inter-EE channel and event IRQs.
      
      But the wrong registers are used (and defined); the ones used are
      read-only registers that indicate whether the interrupt condition is
      present.
      
      Define the mask registers instead of the status registers, and use
      them to disable the inter-EE interrupt types.
      
      Fixes: 46f748cc
      
       ("net: ipa: explicitly disallow inter-EE interrupts")
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Link: https://lore.kernel.org/r/20210505223636.232527-1-elder@linaro.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      6a780f51
    • Jakub Kicinski's avatar
      Merge tag 'linux-can-fixes-for-5.13-20210506' of... · 9f3c3b42
      Jakub Kicinski authored
      
      Merge tag 'linux-can-fixes-for-5.13-20210506' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
      
      Marc Kleine-Budde says:
      
      ====================
      pull-request: can 2021-05-06
      
      The first two patches target the mcp251xfd driver. Dan Carpenter's
      patch fixes a NULL pointer dereference in the probe function's error
      path. A patch by me adds the missing can_rx_offload_del() in error
      path of the probe function.
      
      Frieder Schrempf contributes a patch for the mcp251x driver, the patch
      fixes the resume from sleep before interface was brought up.
      
      The last patch is by me and fixes a race condition in the TX path of
      the m_can driver for peripheral (SPI) based m_can cores.
      
      * tag 'linux-can-fixes-for-5.13-20210506' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can:
        can: m_can: m_can_tx_work_queue(): fix tx_skb race condition
        can: mcp251x: fix resume from sleep before interface was brought up
        can: mcp251xfd: mcp251xfd_probe(): add missing can_rx_offload_del() in error path
        can: mcp251xfd: mcp251xfd_probe(): fix an error pointer dereference in probe
      ====================
      
      Link: https://lore.kernel.org/r/20210506074015.1300591-1-mkl@pengutronix.de
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      9f3c3b42
  3. May 06, 2021
  4. May 05, 2021
  5. May 04, 2021
  6. May 03, 2021
    • Daniel Borkmann's avatar
      bpf: Fix leakage of uninitialized bpf stack under speculation · 801c6058
      Daniel Borkmann authored
      The current implemented mechanisms to mitigate data disclosure under
      speculation mainly address stack and map value oob access from the
      speculative domain. However, Piotr discovered that uninitialized BPF
      stack is not protected yet, and thus old data from the kernel stack,
      potentially including addresses of kernel structures, could still be
      extracted from that 512 bytes large window. The BPF stack is special
      compared to map values since it's not zero initialized for every
      program invocation, whereas map values /are/ zero initialized upon
      their initial allocation and thus cannot leak any prior data in either
      domain. In the non-speculative domain, the verifier ensures that every
      stack slot read must have a prior stack slot write by the BPF program
      to avoid such data leaking issue.
      
      However, this is not enough: for example, when the pointer arithmetic
      operation moves the stack pointer from the last valid stack offset to
      the first valid offset, the sanitation logic allows for any intermediate
      offsets during speculative execution, which could then be used to
      extract any restricted stack content via side-channel.
      
      Given for unprivileged stack pointer arithmetic the use of unknown
      but bounded scalars is generally forbidden, we can simply turn the
      register-based arithmetic operation into an immediate-based arithmetic
      operation without the need for masking. This also gives the benefit
      of reducing the needed instructions for the operation. Given after
      the work in 7fedb63a
      
       ("bpf: Tighten speculative pointer arithmetic
      mask"), the aux->alu_limit already holds the final immediate value for
      the offset register with the known scalar. Thus, a simple mov of the
      immediate to AX register with using AX as the source for the original
      instruction is sufficient and possible now in this case.
      
      Reported-by: default avatarPiotr Krysiuk <piotras@gmail.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Tested-by: default avatarPiotr Krysiuk <piotras@gmail.com>
      Reviewed-by: default avatarPiotr Krysiuk <piotras@gmail.com>
      Reviewed-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      801c6058
    • Daniel Borkmann's avatar
      bpf: Fix masking negation logic upon negative dst register · b9b34ddb
      Daniel Borkmann authored
      The negation logic for the case where the off_reg is sitting in the
      dst register is not correct given then we cannot just invert the add
      to a sub or vice versa. As a fix, perform the final bitwise and-op
      unconditionally into AX from the off_reg, then move the pointer from
      the src to dst and finally use AX as the source for the original
      pointer arithmetic operation such that the inversion yields a correct
      result. The single non-AX mov in between is possible given constant
      blinding is retaining it as it's not an immediate based operation.
      
      Fixes: 979d63d5
      
       ("bpf: prevent out of bounds speculation on pointer arithmetic")
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Tested-by: default avatarPiotr Krysiuk <piotras@gmail.com>
      Reviewed-by: default avatarPiotr Krysiuk <piotras@gmail.com>
      Reviewed-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      b9b34ddb
  7. May 01, 2021