Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  1. Dec 17, 2021
  2. Dec 16, 2021
    • George Kennedy's avatar
      libata: if T_LENGTH is zero, dma direction should be DMA_NONE · 5da5231b
      George Kennedy authored
      
      Avoid data corruption by rejecting pass-through commands where
      T_LENGTH is zero (No data is transferred) and the dma direction
      is not DMA_NONE.
      
      Cc: <stable@vger.kernel.org>
      Reported-by: default avatar <syzkaller&lt;syzkaller@googlegroups.com>
      Signed-off-by: default avatarGeorge <Kennedy&lt;george.kennedy@oracle.com>
      Signed-off-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
      5da5231b
    • Florian Fainelli's avatar
      net: systemport: Add global locking for descriptor lifecycle · 8b8e6e78
      Florian Fainelli authored
      The descriptor list is a shared resource across all of the transmit queues, and
      the locking mechanism used today only protects concurrency across a given
      transmit queue between the transmit and reclaiming. This creates an opportunity
      for the SYSTEMPORT hardware to work on corrupted descriptors if we have
      multiple producers at once which is the case when using multiple transmit
      queues.
      
      This was particularly noticeable when using multiple flows/transmit queues and
      it showed up in interesting ways in that UDP packets would get a correct UDP
      header checksum being calculated over an incorrect packet length. Similarly TCP
      packets would get an equally correct checksum computed by the hardware over an
      incorrect packet length.
      
      The SYSTEMPORT hardware maintains an internal descriptor list that it re-arranges
      when the driver produces a new descriptor anytime it writes to the
      WRITE_PORT_{HI,LO} registers, there is however some delay in the hardware to
      re-organize its descriptors and it is possible that concurrent TX queues
      eventually break this internal allocation scheme to the point where the
      length/status part of the descriptor gets used for an incorrect data buffer.
      
      The fix is to impose a global serialization for all TX queues in the short
      section where we are writing to the WRITE_PORT_{HI,LO} registers which solves
      the corruption even with multiple concurrent TX queues being used.
      
      Fixes: 80105bef
      
       ("net: systemport: add Broadcom SYSTEMPORT Ethernet MAC driver")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Link: https://lore.kernel.org/r/20211215202450.4086240-1-f.fainelli@gmail.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      8b8e6e78
    • Wenliang Wang's avatar
      virtio_net: fix rx_drops stat for small pkts · 053c9e18
      Wenliang Wang authored
      
      We found the stat of rx drops for small pkts does not increment when
      build_skb fail, it's not coherent with other mode's rx drops stat.
      
      Signed-off-by: default avatarWenliang Wang <wangwenliang.1995@bytedance.com>
      Acked-by: default avatarJason Wang <jasowang@redhat.com>
      Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      053c9e18
    • Andrey Eremeev's avatar
      dsa: mv88e6xxx: fix debug print for SPEED_UNFORCED · e08cdf63
      Andrey Eremeev authored
      
      Debug print uses invalid check to detect if speed is unforced:
      (speed != SPEED_UNFORCED) should be used instead of (!speed).
      
      Found by Linux Verification Center (linuxtesting.org) with SVACE.
      
      Signed-off-by: default avatarAndrey Eremeev <Axtone4all@yandex.ru>
      Fixes: 96a2b40c
      
       ("net: dsa: mv88e6xxx: add port's MAC speed setter")
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e08cdf63
    • Jiasheng Jiang's avatar
      sfc_ef100: potential dereference of null pointer · 407ecd1b
      Jiasheng Jiang authored
      The return value of kmalloc() needs to be checked.
      To avoid use in efx_nic_update_stats() in case of the failure of alloc.
      
      Fixes: b593b6f1
      
       ("sfc_ef100: statistics gathering")
      Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      407ecd1b
    • John Keeping's avatar
      net: stmmac: dwmac-rk: fix oob read in rk_gmac_setup · 0546b224
      John Keeping authored
      KASAN reports an out-of-bounds read in rk_gmac_setup on the line:
      
      	while (ops->regs[i]) {
      
      This happens for most platforms since the regs flexible array member is
      empty, so the memory after the ops structure is being read here.  It
      seems that mostly this happens to contain zero anyway, so we get lucky
      and everything still works.
      
      To avoid adding redundant data to nearly all the ops structures, add a
      new flag to indicate whether the regs field is valid and avoid this loop
      when it is not.
      
      Fixes: 3bb3d6b1
      
       ("net: stmmac: Add RK3566/RK3568 SoC support")
      Signed-off-by: default avatarJohn Keeping <john@metanate.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0546b224
    • Juergen Gross's avatar
      xen/netback: don't queue unlimited number of packages · be81992f
      Juergen Gross authored
      In case a guest isn't consuming incoming network traffic as fast as it
      is coming in, xen-netback is buffering network packages in unlimited
      numbers today. This can result in host OOM situations.
      
      Commit f48da8b1 ("xen-netback: fix unlimited guest Rx internal
      queue and carrier flapping") meant to introduce a mechanism to limit
      the amount of buffered data by stopping the Tx queue when reaching the
      data limit, but this doesn't work for cases like UDP.
      
      When hitting the limit don't queue further SKBs, but drop them instead.
      In order to be able to tell Rx packages have been dropped increment the
      rx_dropped statistics counter in this case.
      
      It should be noted that the old solution to continue queueing SKBs had
      the additional problem of an overflow of the 32-bit rx_queue_len value
      would result in intermittent Tx queue enabling.
      
      This is part of XSA-392
      
      Fixes: f48da8b1
      
       ("xen-netback: fix unlimited guest Rx internal queue and carrier flapping")
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Reviewed-by: default avatarJan Beulich <jbeulich@suse.com>
      be81992f
    • Juergen Gross's avatar
      xen/netback: fix rx queue stall detection · 6032046e
      Juergen Gross authored
      Commit 1d5d4852 ("xen-netback: require fewer guest Rx slots when
      not using GSO") introduced a security problem in netback, as an
      interface would only be regarded to be stalled if no slot is available
      in the rx queue ring page. In case the SKB at the head of the queued
      requests will need more than one rx slot and only one slot is free the
      stall detection logic will never trigger, as the test for that is only
      looking for at least one slot to be free.
      
      Fix that by testing for the needed number of slots instead of only one
      slot being available.
      
      In order to not have to take the rx queue lock that often, store the
      number of needed slots in the queue data. As all SKB dequeue operations
      happen in the rx queue kernel thread this is safe, as long as the
      number of needed slots is accessed via READ/WRITE_ONCE() only and
      updates are always done with the rx queue lock held.
      
      Add a small helper for obtaining the number of free slots.
      
      This is part of XSA-392
      
      Fixes: 1d5d4852
      
       ("xen-netback: require fewer guest Rx slots when not using GSO")
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Reviewed-by: default avatarJan Beulich <jbeulich@suse.com>
      6032046e
    • Juergen Gross's avatar
      xen/console: harden hvc_xen against event channel storms · fe415186
      Juergen Gross authored
      
      The Xen console driver is still vulnerable for an attack via excessive
      number of events sent by the backend. Fix that by using a lateeoi event
      channel.
      
      For the normal domU initial console this requires the introduction of
      bind_evtchn_to_irq_lateeoi() as there is no xenbus device available
      at the time the event channel is bound to the irq.
      
      As the decision whether an interrupt was spurious or not requires to
      test for bytes having been read from the backend, move sending the
      event into the if statement, as sending an event without having found
      any bytes to be read is making no sense at all.
      
      This is part of XSA-391
      
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Reviewed-by: default avatarJan Beulich <jbeulich@suse.com>
      ---
      V2:
      - slightly adapt spurious irq detection (Jan Beulich)
      V3:
      - fix spurious irq detection (Jan Beulich)
      fe415186
    • Juergen Gross's avatar
      xen/netfront: harden netfront against event channel storms · b27d4795
      Juergen Gross authored
      
      The Xen netfront driver is still vulnerable for an attack via excessive
      number of events sent by the backend. Fix that by using lateeoi event
      channels.
      
      For being able to detect the case of no rx responses being added while
      the carrier is down a new lock is needed in order to update and test
      rsp_cons and the number of seen unconsumed responses atomically.
      
      This is part of XSA-391
      
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Reviewed-by: default avatarJan Beulich <jbeulich@suse.com>
      ---
      V2:
      - don't eoi irq in case of interface set broken (Jan Beulich)
      - handle carrier off + no new responses added (Jan Beulich)
      V3:
      - add rx_ prefix to rsp_unconsumed (Jan Beulich)
      - correct xennet_set_rx_rsp_cons() spelling (Jan Beulich)
      b27d4795
    • Juergen Gross's avatar
      xen/blkfront: harden blkfront against event channel storms · 0fd08a34
      Juergen Gross authored
      
      The Xen blkfront driver is still vulnerable for an attack via excessive
      number of events sent by the backend. Fix that by using lateeoi event
      channels.
      
      This is part of XSA-391
      
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Reviewed-by: default avatarJan Beulich <jbeulich@suse.com>
      0fd08a34
  3. Dec 15, 2021
  4. Dec 14, 2021