1. 28 2月, 2018 24 次提交
  2. 27 2月, 2018 4 次提交
  3. 24 2月, 2018 4 次提交
    • D
      net: fib_rules: Add new attribute to set protocol · 1b71af60
      Donald Sharp 提交于
      For ages iproute2 has used `struct rtmsg` as the ancillary header for
      FIB rules and in the process set the protocol value to RTPROT_BOOT.
      Until ca56209a66 ("net: Allow a rule to track originating protocol")
      the kernel rules code ignored the protocol value sent from userspace
      and always returned 0 in notifications. To avoid incompatibility with
      existing iproute2, send the protocol as a new attribute.
      
      Fixes: cac56209 ("net: Allow a rule to track originating protocol")
      Signed-off-by: NDonald Sharp <sharpd@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1b71af60
    • H
      r8169: simplify and improve check for dash · 9dbe7896
      Heiner Kallweit 提交于
      r8168_check_dash() returns false anyway for all chip versions not
      supporting dash. So we can simplify the check conditions.
      
      In addition change the check functions to return bool instead of int,
      because they actually return a bool value.
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9dbe7896
    • H
      r8169: disable WOL per default · 7edf6d31
      Heiner Kallweit 提交于
      Currently, if BIOS enables WOL in the chip, settings are inconsistent
      because the device isn't marked as wakeup-enabled (if not done
      explicitly via userspace tools). This causes issues with suspend/
      resume because mdio_bus_phy_may_suspend() checks whether device is
      wakeup-enabled. In detail MDIO bus access in phy_suspend() can fail
      because the MDIO bus is disabled.
      
      In the history of the driver we find two competing approaches:
      8f9d5138 "r8169: remember WOL preferences on driver load" prefers
      to preserve what the BIOS may have set, whilst bde135a6
      "r8169: only enable PCI wakeups when WOL is active" disabled PCI
      wakeup per default to work around a bug on one platform.
      
      Seems like nobody complained after the latter patch about non-working
      WOL, what makes me think that nobody uses WOL w/o configuring it
      explicitly.
      
      My opinion:
      Vast majority of users doesn't use WOL even if the BIOS enables it in
      the chip. And having WOL being active keeps the PHY(s) from powering
      down if being idle.
      If somebody needs WOL, he can enable it during boot, e.g. by
      configuring systemd.link/WakeOnLan.
      
      Therefore, to make WOL consistent again, disable it per default.
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7edf6d31
    • A
      gianfar: simplify FCS handling and fix memory leak · d903ec77
      Andy Spencer 提交于
      Previously, buffer descriptors containing only the frame check sequence
      (FCS) were skipped and not added to the skb. However, the page reference
      count was still incremented, leading to a memory leak.
      
      Fixing this inside gfar_add_rx_frag() is difficult due to reserved
      memory handling and page reuse. Instead, move the FCS handling to
      gfar_process_frame() and trim off the FCS before passing the skb up the
      networking stack.
      Signed-off-by: NAndy Spencer <aspencer@spacex.com>
      Signed-off-by: NJim Gruen <jgruen@spacex.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d903ec77
  4. 23 2月, 2018 8 次提交
    • A
      macvlan: fix use-after-free in macvlan_common_newlink() · 4e14bf42
      Alexey Kodanev 提交于
      The following use-after-free was reported by KASan when running
      LTP macvtap01 test on 4.16-rc2:
      
      [10642.528443] BUG: KASAN: use-after-free in
                     macvlan_common_newlink+0x12ef/0x14a0 [macvlan]
      [10642.626607] Read of size 8 at addr ffff880ba49f2100 by task ip/18450
      ...
      [10642.963873] Call Trace:
      [10642.994352]  dump_stack+0x5c/0x7c
      [10643.035325]  print_address_description+0x75/0x290
      [10643.092938]  kasan_report+0x28d/0x390
      [10643.137971]  ? macvlan_common_newlink+0x12ef/0x14a0 [macvlan]
      [10643.207963]  macvlan_common_newlink+0x12ef/0x14a0 [macvlan]
      [10643.275978]  macvtap_newlink+0x171/0x260 [macvtap]
      [10643.334532]  rtnl_newlink+0xd4f/0x1300
      ...
      [10646.256176] Allocated by task 18450:
      [10646.299964]  kasan_kmalloc+0xa6/0xd0
      [10646.343746]  kmem_cache_alloc_trace+0xf1/0x210
      [10646.397826]  macvlan_common_newlink+0x6de/0x14a0 [macvlan]
      [10646.464386]  macvtap_newlink+0x171/0x260 [macvtap]
      [10646.522728]  rtnl_newlink+0xd4f/0x1300
      ...
      [10647.022028] Freed by task 18450:
      [10647.061549]  __kasan_slab_free+0x138/0x180
      [10647.111468]  kfree+0x9e/0x1c0
      [10647.147869]  macvlan_port_destroy+0x3db/0x650 [macvlan]
      [10647.211411]  rollback_registered_many+0x5b9/0xb10
      [10647.268715]  rollback_registered+0xd9/0x190
      [10647.319675]  register_netdevice+0x8eb/0xc70
      [10647.370635]  macvlan_common_newlink+0xe58/0x14a0 [macvlan]
      [10647.437195]  macvtap_newlink+0x171/0x260 [macvtap]
      
      Commit d02fd6e7 ("macvlan: Fix one possible double free") handles
      the case when register_netdevice() invokes ndo_uninit() on error and
      as a result free the port. But 'macvlan_port_get_rtnl(dev))' check
      (returns dev->rx_handler_data), which was added by this commit in order
      to prevent double free, is not quite correct:
      
      * for macvlan it always returns NULL because 'lowerdev' is the one that
        was used to register rx handler (port) in macvlan_port_create() as
        well as to unregister it in macvlan_port_destroy().
      * for macvtap it always returns a valid pointer because macvtap registers
        its own rx handler before macvlan_common_newlink().
      
      Fixes: d02fd6e7 ("macvlan: Fix one possible double free")
      Signed-off-by: NAlexey Kodanev <alexey.kodanev@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4e14bf42
    • A
      dsa: ptp: mark dummy helpers as 'inline' · 46182452
      Arnd Bergmann 提交于
      Declaring a static function in a header leads to a warning every
      time that header gets included without the function being used:
      
      In file included from drivers/net/dsa/mv88e6xxx/chip.c:42:
      drivers/net/dsa/mv88e6xxx/ptp.h:92:13: error: 'mv88e6xxx_hwtstamp_work' defined but not used [-Werror=unused-function]
       static long mv88e6xxx_hwtstamp_work(struct ptp_clock_info *ptp)
      In file included from drivers/net/dsa/mv88e6xxx/chip.c:38:
      drivers/net/dsa/mv88e6xxx/global2.h:355:12: error: 'mv88e6xxx_g2_wait' defined but not used [-Werror=unused-function]
       static int mv88e6xxx_g2_wait(struct mv88e6xxx_chip *chip, int reg, u16 mask)
                  ^~~~~~~~~~~~~~~~~
      drivers/net/dsa/mv88e6xxx/global2.h:350:12: error: 'mv88e6xxx_g2_update' defined but not used [-Werror=unused-function]
       static int mv88e6xxx_g2_update(struct mv88e6xxx_chip *chip, int reg, u16 update)
                  ^~~~~~~~~~~~~~~~~~~
      drivers/net/dsa/mv88e6xxx/global2.h:345:12: error: 'mv88e6xxx_g2_write' defined but not used [-Werror=unused-function]
       static int mv88e6xxx_g2_write(struct mv88e6xxx_chip *chip, int reg, u16 val)
                  ^~~~~~~~~~~~~~~~~~
      drivers/net/dsa/mv88e6xxx/global2.h:340:12: error: 'mv88e6xxx_g2_read' defined but not used [-Werror=unused-function]
       static int mv88e6xxx_g2_read(struct mv88e6xxx_chip *chip, int reg, u16 *val)
      
      This marks all such functions in dsa inline to make sure we don't warn
      about them.
      
      Fixes: c6fe0ad2 ("net: dsa: mv88e6xxx: add rx/tx timestamping support")
      Fixes: 0d632c3d ("net: dsa: mv88e6xxx: add accessors for PTP/TAI registers")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Acked-by: NRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      46182452
    • D
      net: aquantia: Fix error handling in aq_pci_probe() · 370c1052
      Dan Carpenter 提交于
      We should check "self->aq_hw" for allocation failure, and also we should
      free it on the error paths.
      
      Fixes: 23ee07ad ("net: aquantia: Cleanup pci functions module")
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      370c1052
    • D
      nfp: advertise firmware for mixed 10G/25G mode · 70271dad
      Dirk van der Merwe 提交于
      The AMDA0099-0001 platform can support the 1x10G + 1x25G mixed mode
      operation. Recently, firmware has been added for this configuration
      mode.
      Signed-off-by: NDirk van der Merwe <dirk.vandermerwe@netronome.com>
      Acked-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      70271dad
    • J
      aquantia: add Makefiles to all directories · 420b9358
      Jakub Kicinski 提交于
      To be able to build separate objects we need to provide
      Kbuild with a Makefile in each directory.
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      420b9358
    • J
      nfp: add Makefiles to all directories · f7308991
      Jakub Kicinski 提交于
      To be able to build separate objects we need to provide
      Kbuild with a Makefile in each directory.
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f7308991
    • N
      ibmvnic: Split counters for scrq/pools/napi · 82e3be32
      Nathan Fontenot 提交于
      The approach of one counter to rule them all when tracking the number
      of active sub-crqs, pools, and napi has problems handling some failover
      scenarios. This is due to the split in initializing the sub crqs,
      pools and napi in different places and the placement of updating
      the active counts.
      
      This patch simplifies this by having a counter for tx and rx
      sub-crqs, pools, and napi.
      Signed-off-by: NNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      82e3be32
    • A
      net: dsa: mv88e6xxx: scratch registers and external MDIO pins · 2510babc
      Andrew Lunn 提交于
      MV88E6352 and later switches support GPIO control through the "Scratch
      & Misc" global2 register. Two of the pins controlled this way on the
      mv88e6390 family are the external MDIO pins. They can either by used
      as part of the MII interface for port 0, GPIOs, or MDIO. Add a
      function to configure them for MDIO, if possible, and call it when
      registering the external MDIO bus.
      Suggested-by: NRussell King <rmk@armlinux.org.uk>
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2510babc