1. 24 4月, 2021 2 次提交
  2. 23 4月, 2021 21 次提交
  3. 22 4月, 2021 10 次提交
  4. 21 4月, 2021 7 次提交
    • L
      net: wwan: mhi_wwan_ctrl: Fix RX buffer starvation · a926c025
      Loic Poulain 提交于
      The mhi_wwan_rx_budget_dec function is supposed to return true if
      RX buffer budget has been successfully decremented, allowing to queue
      a new RX buffer for transfer. However the current implementation is
      broken when RX budget is '1', in which case budget is decremented but
      false is returned, preventing to requeue one buffer, and leading to
      RX buffer starvation.
      
      Fixes: fa588eba ("net: Add Qcom WWAN control driver")
      Signed-off-by: NLoic Poulain <loic.poulain@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a926c025
    • M
      net: phy: at803x: fix probe error if copper page is selected · 8f7e8762
      Michael Walle 提交于
      The commit c329e5af ("net: phy: at803x: select correct page on
      config init") selects the copper page during probe. This fails if the
      copper page was already selected. In this case, the value of the copper
      page (which is 1) is propagated through phy_restore_page() and is
      finally returned for at803x_probe(). Fix it, by just using the
      at803x_page_write() directly.
      
      Also in case of an error, the regulator is not disabled and leads to a
      WARN_ON() when the probe fails. This couldn't happen before, because
      at803x_parse_dt() was the last call in at803x_probe(). It is hard to
      see, that the parse_dt() actually enables the regulator. Thus move the
      regulator_enable() to the probe function and undo it in case of an
      error.
      
      Fixes: c329e5af ("net: phy: at803x: select correct page on config init")
      Signed-off-by: NMichael Walle <michael@walle.cc>
      Reviewed-by: NDavid Bauer <mail@david-bauer.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8f7e8762
    • C
      net: mana: remove redundant initialization of variable err · 55cdc26a
      Colin Ian King 提交于
      The variable err is being initialized with a value that is
      never read and it is being updated later with a new value.  The
      initialization is redundant and can be removed
      
      Addresses-Coverity: ("Unused value")
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      55cdc26a
    • E
      virtio-net: fix use-after-free in page_to_skb() · af39c8f7
      Eric Dumazet 提交于
      KASAN/syzbot had 4 reports, one of them being:
      
      BUG: KASAN: slab-out-of-bounds in memcpy include/linux/fortify-string.h:191 [inline]
      BUG: KASAN: slab-out-of-bounds in page_to_skb+0x5cf/0xb70 drivers/net/virtio_net.c:480
      Read of size 12 at addr ffff888014a5f800 by task systemd-udevd/8445
      
      CPU: 0 PID: 8445 Comm: systemd-udevd Not tainted 5.12.0-rc8-next-20210419-syzkaller #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Call Trace:
       <IRQ>
       __dump_stack lib/dump_stack.c:79 [inline]
       dump_stack+0x141/0x1d7 lib/dump_stack.c:120
       print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:233
       __kasan_report mm/kasan/report.c:419 [inline]
       kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:436
       check_region_inline mm/kasan/generic.c:180 [inline]
       kasan_check_range+0x13d/0x180 mm/kasan/generic.c:186
       memcpy+0x20/0x60 mm/kasan/shadow.c:65
       memcpy include/linux/fortify-string.h:191 [inline]
       page_to_skb+0x5cf/0xb70 drivers/net/virtio_net.c:480
       receive_mergeable drivers/net/virtio_net.c:1009 [inline]
       receive_buf+0x2bc0/0x6250 drivers/net/virtio_net.c:1119
       virtnet_receive drivers/net/virtio_net.c:1411 [inline]
       virtnet_poll+0x568/0x10b0 drivers/net/virtio_net.c:1516
       __napi_poll+0xaf/0x440 net/core/dev.c:6962
       napi_poll net/core/dev.c:7029 [inline]
       net_rx_action+0x801/0xb40 net/core/dev.c:7116
       __do_softirq+0x29b/0x9fe kernel/softirq.c:559
       invoke_softirq kernel/softirq.c:433 [inline]
       __irq_exit_rcu+0x136/0x200 kernel/softirq.c:637
       irq_exit_rcu+0x5/0x20 kernel/softirq.c:649
       common_interrupt+0xa4/0xd0 arch/x86/kernel/irq.c:240
      
      Fixes: fb32856b ("virtio-net: page_to_skb() use build_skb when there's sufficient tailroom")
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Reported-by: Nsyzbot <syzkaller@googlegroups.com>
      Reported-by: NGuenter Roeck <linux@roeck-us.net>
      Reported-by: NMat Martineau <mathew.j.martineau@linux.intel.com>
      Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: virtualization@lists.linux-foundation.org
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      af39c8f7
    • R
      phy: nxp-c45-tja11xx: fix phase offset calculation · 6b3a6310
      Radu Pirea (NXP OSS) 提交于
      Fix phase offset calculation.
      Signed-off-by: NRadu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6b3a6310
    • M
      net: enetc: automatically select IERB module · 1b8caefa
      Michael Walle 提交于
      Now that enetc supports flow control we have to make sure the settings in
      the IERB are correct. Therefore, we actually depend on the enetc-ierb
      module. Previously it was possible that this module was disabled while the
      enetc was enabled. Fix it by automatically select the enetc-ierb module.
      
      Fixes: e7d48e5f ("net: enetc: add a mini driver for the Integrated Endpoint Register Block")
      Signed-off-by: NMichael Walle <michael@walle.cc>
      Acked-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1b8caefa
    • E
      virtio-net: restrict build_skb() use to some arches · f5d7872a
      Eric Dumazet 提交于
      build_skb() is supposed to be followed by
      skb_reserve(skb, NET_IP_ALIGN), so that IP headers are word-aligned.
      (Best practice is to reserve NET_IP_ALIGN+NET_SKB_PAD, but the NET_SKB_PAD
      part is only a performance optimization if tunnel encaps are added.)
      
      Unfortunately virtio_net has not provisioned this reserve.
      We can only use build_skb() for arches where NET_IP_ALIGN == 0
      
      We might refine this later, with enough testing.
      
      Fixes: fb32856b ("virtio-net: page_to_skb() use build_skb when there's sufficient tailroom")
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Reported-by: NGuenter Roeck <linux@roeck-us.net>
      Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: virtualization@lists.linux-foundation.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f5d7872a