1. 25 8月, 2021 6 次提交
  2. 24 8月, 2021 1 次提交
  3. 19 8月, 2021 2 次提交
  4. 18 8月, 2021 1 次提交
    • P
      net: asix: fix uninit value bugs · a786e319
      Pavel Skripkin 提交于
      Syzbot reported uninit-value in asix_mdio_read(). The problem was in
      missing error handling. asix_read_cmd() should initialize passed stack
      variable smsr, but it can fail in some cases. Then while condidition
      checks possibly uninit smsr variable.
      
      Since smsr is uninitialized stack variable, driver can misbehave,
      because smsr will be random in case of asix_read_cmd() failure.
      Fix it by adding error handling and just continue the loop instead of
      checking uninit value.
      
      Added helper function for checking Host_En bit, since wrong loop was used
      in 4 functions and there is no need in copy-pasting code parts.
      
      Cc: Robert Foss <robert.foss@collabora.com>
      Fixes: d9fe64e5 ("net: asix: Add in_pm parameter")
      Reported-by: syzbot+a631ec9e717fb0423053@syzkaller.appspotmail.com
      Signed-off-by: NPavel Skripkin <paskripkin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a786e319
  5. 14 8月, 2021 1 次提交
  6. 05 8月, 2021 1 次提交
    • P
      net: pegasus: fix uninit-value in get_interrupt_interval · af35fc37
      Pavel Skripkin 提交于
      Syzbot reported uninit value pegasus_probe(). The problem was in missing
      error handling.
      
      get_interrupt_interval() internally calls read_eprom_word() which can
      fail in some cases. For example: failed to receive usb control message.
      These cases should be handled to prevent uninit value bug, since
      read_eprom_word() will not initialize passed stack variable in case of
      internal failure.
      
      Fail log:
      
      BUG: KMSAN: uninit-value in get_interrupt_interval drivers/net/usb/pegasus.c:746 [inline]
      BUG: KMSAN: uninit-value in pegasus_probe+0x10e7/0x4080 drivers/net/usb/pegasus.c:1152
      CPU: 1 PID: 825 Comm: kworker/1:1 Not tainted 5.12.0-rc6-syzkaller #0
      ...
      Workqueue: usb_hub_wq hub_event
      Call Trace:
       __dump_stack lib/dump_stack.c:79 [inline]
       dump_stack+0x24c/0x2e0 lib/dump_stack.c:120
       kmsan_report+0xfb/0x1e0 mm/kmsan/kmsan_report.c:118
       __msan_warning+0x5c/0xa0 mm/kmsan/kmsan_instr.c:197
       get_interrupt_interval drivers/net/usb/pegasus.c:746 [inline]
       pegasus_probe+0x10e7/0x4080 drivers/net/usb/pegasus.c:1152
      ....
      
      Local variable ----data.i@pegasus_probe created at:
       get_interrupt_interval drivers/net/usb/pegasus.c:1151 [inline]
       pegasus_probe+0xe57/0x4080 drivers/net/usb/pegasus.c:1152
       get_interrupt_interval drivers/net/usb/pegasus.c:1151 [inline]
       pegasus_probe+0xe57/0x4080 drivers/net/usb/pegasus.c:1152
      
      Reported-and-tested-by: syzbot+02c9f70f3afae308464a@syzkaller.appspotmail.com
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Signed-off-by: NPavel Skripkin <paskripkin@gmail.com>
      Link: https://lore.kernel.org/r/20210804143005.439-1-paskripkin@gmail.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      af35fc37
  7. 04 8月, 2021 3 次提交
  8. 03 8月, 2021 1 次提交
  9. 28 7月, 2021 3 次提交
    • A
      dev_ioctl: split out ndo_eth_ioctl · a7605370
      Arnd Bergmann 提交于
      Most users of ndo_do_ioctl are ethernet drivers that implement
      the MII commands SIOCGMIIPHY/SIOCGMIIREG/SIOCSMIIREG, or hardware
      timestamping with SIOCSHWTSTAMP/SIOCGHWTSTAMP.
      
      Separate these from the few drivers that use ndo_do_ioctl to
      implement SIOCBOND, SIOCBR and SIOCWANDEV commands.
      
      This is a purely cosmetic change intended to help readers find
      their way through the implementation.
      
      Cc: Doug Ledford <dledford@redhat.com>
      Cc: Jason Gunthorpe <jgg@ziepe.ca>
      Cc: Jay Vosburgh <j.vosburgh@gmail.com>
      Cc: Veaceslav Falico <vfalico@gmail.com>
      Cc: Andy Gospodarek <andy@greyhouse.net>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Vivien Didelot <vivien.didelot@gmail.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Vladimir Oltean <olteanv@gmail.com>
      Cc: Leon Romanovsky <leon@kernel.org>
      Cc: linux-rdma@vger.kernel.org
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NJason Gunthorpe <jgg@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a7605370
    • A
      net: usb: use ndo_siocdevprivate · ef1b5b0c
      Arnd Bergmann 提交于
      The pegasus and rtl8150 drivers use SIOCDEVPRIVATE ioctls
      to access their MII registers, in place of the normal
      commands. This is broken for all compat ioctls today.
      
      Change to ndo_siocdevprivate to fix it.
      
      Cc: Petko Manolov <petkan@nucleusys.com>
      Cc: linux-usb@vger.kernel.org
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ef1b5b0c
    • A
      phonet: use siocdevprivate · 4747c1a8
      Arnd Bergmann 提交于
      phonet has a single private ioctl that is broken in compat
      mode on big-endian machines today because the data returned
      from it is never copied back to user space.
      
      Move it over to the ndo_siocdevprivate callback, which also
      fixes the compat issue.
      
      Cc: Remi Denis-Courmont <courmisch@gmail.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NRémi Denis-Courmont <courmisch@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4747c1a8
  10. 22 7月, 2021 2 次提交
  11. 21 7月, 2021 2 次提交
  12. 16 7月, 2021 1 次提交
  13. 15 7月, 2021 2 次提交
  14. 02 7月, 2021 1 次提交
  15. 25 6月, 2021 1 次提交
  16. 18 6月, 2021 2 次提交
  17. 17 6月, 2021 2 次提交
  18. 16 6月, 2021 2 次提交
    • K
      qmi_wwan: Do not call netif_rx from rx_fixup · 057d4933
      Kristian Evensen 提交于
      When the QMI_WWAN_FLAG_PASS_THROUGH is set, netif_rx() is called from
      qmi_wwan_rx_fixup(). When the call to netif_rx() is successful (which is
      most of the time), usbnet_skb_return() is called (from rx_process()).
      usbnet_skb_return() will then call netif_rx() a second time for the same
      skb.
      
      Simplify the code and avoid the redundant netif_rx() call by changing
      qmi_wwan_rx_fixup() to always return 1 when QMI_WWAN_FLAG_PASS_THROUGH
      is set. We then leave it up to the existing infrastructure to call
      netif_rx().
      Suggested-by: NBjørn Mork <bjorn@mork.no>
      Signed-off-by: NKristian Evensen <kristian.evensen@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      057d4933
    • M
      net: cdc_ncm: switch to eth%d interface naming · c1a3d406
      Maciej Żenczykowski 提交于
      This is meant to make the host side cdc_ncm interface consistently
      named just like the older CDC protocols: cdc_ether & cdc_ecm
      (and even rndis_host), which all use 'FLAG_ETHER | FLAG_POINTTOPOINT'.
      
      include/linux/usb/usbnet.h:
        #define FLAG_ETHER	0x0020		/* maybe use "eth%d" names */
        #define FLAG_WLAN	0x0080		/* use "wlan%d" names */
        #define FLAG_WWAN	0x0400		/* use "wwan%d" names */
        #define FLAG_POINTTOPOINT 0x1000	/* possibly use "usb%d" names */
      
      drivers/net/usb/usbnet.c @ line 1711:
        strcpy (net->name, "usb%d");
        ...
        // heuristic:  "usb%d" for links we know are two-host,
        // else "eth%d" when there's reasonable doubt.  userspace
        // can rename the link if it knows better.
        if ((dev->driver_info->flags & FLAG_ETHER) != 0 &&
            ((dev->driver_info->flags & FLAG_POINTTOPOINT) == 0 ||
             (net->dev_addr [0] & 0x02) == 0))
                strcpy (net->name, "eth%d");
        /* WLAN devices should always be named "wlan%d" */
        if ((dev->driver_info->flags & FLAG_WLAN) != 0)
                strcpy(net->name, "wlan%d");
        /* WWAN devices should always be named "wwan%d" */
        if ((dev->driver_info->flags & FLAG_WWAN) != 0)
                strcpy(net->name, "wwan%d");
      
      So by using ETHER | POINTTOPOINT the interface naming is
      either usb%d or eth%d based on the global uniqueness of the
      mac address of the device.
      
      Without this 2.5gbps ethernet dongles which all seem to use the cdc_ncm
      driver end up being called usb%d instead of eth%d even though they're
      definitely not two-host.  (All 1gbps & 5gbps ethernet usb dongles I've
      tested don't hit this problem due to use of different drivers, primarily
      r8152 and aqc111)
      
      Fixes tag is based purely on git blame, and is really just here to make
      sure this hits LTS branches newer than v4.5.
      
      Cc: Lorenzo Colitti <lorenzo@google.com>
      Fixes: 4d06dd53 ("cdc_ncm: do not call usbnet_link_change from cdc_ncm_bind")
      Signed-off-by: NMaciej Żenczykowski <maze@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c1a3d406
  19. 12 6月, 2021 1 次提交
  20. 10 6月, 2021 2 次提交
  21. 08 6月, 2021 3 次提交