Skip to content
  1. May 23, 2017
    • Jarod Wilson's avatar
      bonding: fix randomly populated arp target array · 72ccc471
      Jarod Wilson authored
      In commit dc9c4d0f, the arp_target array moved from a static global
      to a local variable. By the nature of static globals, the array used to
      be initialized to all 0. At present, it's full of random data, which
      that gets interpreted as arp_target values, when none have actually been
      specified. Systems end up booting with spew along these lines:
      
      [   32.161783] IPv6: ADDRCONF(NETDEV_UP): lacp0: link is not ready
      [   32.168475] IPv6: ADDRCONF(NETDEV_UP): lacp0: link is not ready
      [   32.175089] 8021q: adding VLAN 0 to HW filter on device lacp0
      [   32.193091] IPv6: ADDRCONF(NETDEV_UP): lacp0: link is not ready
      [   32.204892] lacp0: Setting MII monitoring interval to 100
      [   32.211071] lacp0: Removing ARP target 216.124.228.17
      [   32.216824] lacp0: Removing ARP target 218.160.255.255
      [   32.222646] lacp0: Removing ARP target 185.170.136.184
      [   32.228496] lacp0: invalid ARP target 255.255.255.255 specified for removal
      [   32.236294] lacp0: option arp_ip_target: invalid value (-255.255.255.255)
      [   32.243987] lacp0: Removing ARP target 56.125.228.17
      [   32.249625] lacp0: Removing ARP target 218.160.255.255
      [   32.255432] lacp0: Removing ARP target 15.157.233.184
      [   32.261165] lacp0: invalid ARP target 255.255.255.255 specified for removal
      [   32.268939] lacp0: option arp_ip_target: invalid value (-255.255.255.255)
      [   32.276632] lacp0: Removing ARP target 16.0.0.0
      [   32.281755] lacp0: Removing ARP target 218.160.255.255
      [   32.287567] lacp0: Removing ARP target 72.125.228.17
      [   32.293165] lacp0: Removing ARP target 218.160.255.255
      [   32.298970] lacp0: Removing ARP target 8.125.228.17
      [   32.304458] lacp0: Removing ARP target 218.160.255.255
      
      None of these were actually specified as ARP targets, and the driver does
      seem to clean up the mess okay, but it's rather noisy and confusing, leaks
      values to userspace, and the 255.255.255.255 spew shows up even when debug
      prints are disabled.
      
      The fix: just zero out arp_target at init time.
      
      While we're in here, init arp_all_targets_value in the right place.
      
      Fixes: dc9c4d0f
      
       ("bonding: reduce scope of some global variables")
      CC: Mahesh Bandewar <maheshb@google.com>
      CC: Jay Vosburgh <j.vosburgh@gmail.com>
      CC: Veaceslav Falico <vfalico@gmail.com>
      CC: Andy Gospodarek <andy@greyhouse.net>
      CC: netdev@vger.kernel.org
      CC: stable@vger.kernel.org
      Signed-off-by: default avatarJarod Wilson <jarod@redhat.com>
      Acked-by: default avatarAndy Gospodarek <andy@greyhouse.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      72ccc471
    • David S. Miller's avatar
      net: Make IP alignment calulations clearer. · e4eda884
      David S. Miller authored
      
      
      The assignmnet:
      
      	ip_align = strict ? 2 : NET_IP_ALIGN;
      
      in compare_pkt_ptr_alignment() trips up Coverity because we can only
      get to this code when strict is true, therefore ip_align will always
      be 2 regardless of NET_IP_ALIGN's value.
      
      So just assign directly to '2' and explain the situation in the
      comment above.
      
      Reported-by: default avatar"Gustavo A. R. Silva" <garsilva@embeddedor.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e4eda884
    • Jarod Wilson's avatar
      bonding: fix accounting of active ports in 3ad · 751da2a6
      Jarod Wilson authored
      As of 7bb11dc9 and 0622cab0, bond slaves in a 3ad bond are not
      removed from the aggregator when they are down, and the active slave count
      is NOT equal to number of ports in the aggregator, but rather the number
      of ports in the aggregator that are still enabled. The sysfs spew for
      bonding_show_ad_num_ports() has a comment that says "Show number of active
      802.3ad ports.", but it's currently showing total number of ports, both
      active and inactive. Remedy it by using the same logic introduced in
      0622cab0
      
       in __bond_3ad_get_active_agg_info(), so sysfs, procfs and
      netlink all report the number of active ports. Note that this means that
      IFLA_BOND_AD_INFO_NUM_PORTS really means NUM_ACTIVE_PORTS instead of
      NUM_PORTS, and thus perhaps should be renamed for clarity.
      
      Lightly tested on a dual i40e lacp bond, simulating link downs with an ip
      link set dev <slave2> down, was able to produce the state where I could
      see both in the same aggregator, but a number of ports count of 1.
      
      MII Status: up
      Active Aggregator Info:
              Aggregator ID: 1
              Number of ports: 2 <---
      Slave Interface: ens10
      MII Status: up <---
      Aggregator ID: 1
      Slave Interface: ens11
      MII Status: up
      Aggregator ID: 1
      
      MII Status: up
      Active Aggregator Info:
              Aggregator ID: 1
              Number of ports: 1 <---
      Slave Interface: ens10
      MII Status: down <---
      Aggregator ID: 1
      Slave Interface: ens11
      MII Status: up
      Aggregator ID: 1
      
      CC: Jay Vosburgh <j.vosburgh@gmail.com>
      CC: Veaceslav Falico <vfalico@gmail.com>
      CC: Andy Gospodarek <andy@greyhouse.net>
      CC: netdev@vger.kernel.org
      Signed-off-by: default avatarJarod Wilson <jarod@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      751da2a6
    • Alexey Khoroshilov's avatar
      net: atheros: atl2: don't return zero on failure path in atl2_probe() · bd703a15
      Alexey Khoroshilov authored
      
      
      If dma mask checks fail in atl2_probe(), it breaks off initialization,
      deallocates all resources, but returns zero.
      
      The patch adds proper error code return value and
      make error code setup unified.
      
      Found by Linux Driver Verification project (linuxtesting.org).
      
      Signed-off-by: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bd703a15
  2. May 22, 2017
    • Eric Dumazet's avatar
      ipv6: fix out of bound writes in __ip6_append_data() · 232cd35d
      Eric Dumazet authored
      
      
      Andrey Konovalov and idaifish@gmail.com reported crashes caused by
      one skb shared_info being overwritten from __ip6_append_data()
      
      Andrey program lead to following state :
      
      copy -4200 datalen 2000 fraglen 2040
      maxfraglen 2040 alloclen 2048 transhdrlen 0 offset 0 fraggap 6200
      
      The skb_copy_and_csum_bits(skb_prev, maxfraglen, data + transhdrlen,
      fraggap, 0); is overwriting skb->head and skb_shared_info
      
      Since we apparently detect this rare condition too late, move the
      code earlier to even avoid allocating skb and risking crashes.
      
      Once again, many thanks to Andrey and syzkaller team.
      
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarAndrey Konovalov <andreyknvl@google.com>
      Tested-by: default avatarAndrey Konovalov <andreyknvl@google.com>
      Reported-by: default avatar <idaifish@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      232cd35d
    • Xin Long's avatar
      bridge: start hello_timer when enabling KERNEL_STP in br_stp_start · 6d18c732
      Xin Long authored
      Since commit 76b91c32 ("bridge: stp: when using userspace stp stop
      kernel hello and hold timers"), bridge would not start hello_timer if
      stp_enabled is not KERNEL_STP when br_dev_open.
      
      The problem is even if users set stp_enabled with KERNEL_STP later,
      the timer will still not be started. It causes that KERNEL_STP can
      not really work. Users have to re-ifup the bridge to avoid this.
      
      This patch is to fix it by starting br->hello_timer when enabling
      KERNEL_STP in br_stp_start.
      
      As an improvement, it's also to start hello_timer again only when
      br->stp_enabled is KERNEL_STP in br_hello_timer_expired, there is
      no reason to start the timer again when it's NO_STP.
      
      Fixes: 76b91c32
      
       ("bridge: stp: when using userspace stp stop kernel hello and hold timers")
      Reported-by: default avatarHaidong Li <haili@redhat.com>
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Acked-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Reviewed-by: default avatarIvan Vecera <cera@cera.cz>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6d18c732
    • Nisar Sayed's avatar
      smsc95xx: Support only IPv4 TCP/UDP csum offload · fe0cd8ca
      Nisar Sayed authored
      
      
      When TX checksum offload is used, if the computed checksum is 0 the
      LAN95xx device do not alter the checksum to 0xffff.  In the case of ipv4
      UDP checksum, it indicates to receiver that no checksum is calculated.
      Under ipv6, UDP checksum yields a result of zero must be changed to
      0xffff. Hence disabling checksum offload for ipv6 packets.
      
      Signed-off-by: default avatarNisar Sayed <Nisar.Sayed@microchip.com>
      
      Reported-by: default avatarpopcorn mix <popcornmix@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fe0cd8ca
    • David S. Miller's avatar
      Merge branch 'arp-always-override-existing-neigh-entries-with-gratuitous-ARP' · 776ee323
      David S. Miller authored
      
      
      Ihar Hrachyshka says:
      
      ====================
      arp: always override existing neigh entries with gratuitous ARP
      
      This patchset is spurred by discussion started at
      https://patchwork.ozlabs.org/patch/760372/ where we figured that there is no
      real reason for enforcing override by gratuitous ARP packets only when
      arp_accept is 1. Same should happen when it's 0 (the default value).
      
      changelog v2: handled review comments by Julian Anastasov
      - fixed a mistake in a comment;
      - postponed addr_type calculation to as late as possible.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      776ee323
    • Ihar Hrachyshka's avatar
      arp: always override existing neigh entries with gratuitous ARP · 7d472a59
      Ihar Hrachyshka authored
      
      
      Currently, when arp_accept is 1, we always override existing neigh
      entries with incoming gratuitous ARP replies. Otherwise, we override
      them only if new replies satisfy _locktime_ conditional (packets arrive
      not earlier than _locktime_ seconds since the last update to the neigh
      entry).
      
      The idea behind locktime is to pick the very first (=> close) reply
      received in a unicast burst when ARP proxies are used. This helps to
      avoid ARP thrashing where Linux would switch back and forth from one
      proxy to another.
      
      This logic has nothing to do with gratuitous ARP replies that are
      generally not aligned in time when multiple IP address carriers send
      them into network.
      
      This patch enforces overriding of existing neigh entries by all incoming
      gratuitous ARP packets, irrespective of their time of arrival. This will
      make the kernel honour all incoming gratuitous ARP packets.
      
      Signed-off-by: default avatarIhar Hrachyshka <ihrachys@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7d472a59
    • Ihar Hrachyshka's avatar
      arp: postpone addr_type calculation to as late as possible · d9ef2e7b
      Ihar Hrachyshka authored
      
      
      The addr_type retrieval can be costly, so it's worth trying to avoid its
      calculation as much as possible. This patch makes it calculated only
      for gratuitous ARP packets. This is especially important since later we
      may want to move is_garp calculation outside of arp_accept block, at
      which point the costly operation will be executed for all setups.
      
      The patch is the result of a discussion in net-dev:
      http://marc.info/?l=linux-netdev&m=149506354216994
      
      Suggested-by: default avatarJulian Anastasov <ja@ssi.bg>
      Signed-off-by: default avatarIhar Hrachyshka <ihrachys@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d9ef2e7b
    • Ihar Hrachyshka's avatar
      arp: decompose is_garp logic into a separate function · 6fd05633
      Ihar Hrachyshka authored
      
      
      The code is quite involving already to earn a separate function for
      itself. If anything, it helps arp_process readability.
      
      Signed-off-by: default avatarIhar Hrachyshka <ihrachys@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6fd05633
    • Ihar Hrachyshka's avatar
      arp: fixed error in a comment · 34eb5fe0
      Ihar Hrachyshka authored
      
      
      the is_garp code deals just with gratuitous ARP packets, not every
      unsolicited packet.
      
      This patch is a result of a discussion in netdev:
      http://marc.info/?l=linux-netdev&m=149506354216994
      
      Suggested-by: default avatarJulian Anastasov <ja@ssi.bg>
      Signed-off-by: default avatarIhar Hrachyshka <ihrachys@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      34eb5fe0
    • Wei Wang's avatar
      tcp: initialize rcv_mss to TCP_MIN_MSS instead of 0 · 499350a5
      Wei Wang authored
      
      
      When tcp_disconnect() is called, inet_csk_delack_init() sets
      icsk->icsk_ack.rcv_mss to 0.
      This could potentially cause tcp_recvmsg() => tcp_cleanup_rbuf() =>
      __tcp_select_window() call path to have division by 0 issue.
      So this patch initializes rcv_mss to TCP_MIN_MSS instead of 0.
      
      Reported-by: default avatarAndrey Konovalov <andreyknvl@google.com>
      Signed-off-by: default avatarWei Wang <weiwan@google.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarNeal Cardwell <ncardwell@google.com>
      Signed-off-by: default avatarYuchung Cheng <ycheng@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      499350a5
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf · 23416e23
      David S. Miller authored
      
      
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter/IPVS fixes for net
      
      The following patchset contains Netfilter/IPVS fixes for your net tree,
      they are:
      
      1) When using IPVS in direct-routing mode, normal traffic from the LVS
         host to a back-end server is sometimes incorrectly NATed on the way
         back into the LVS host. Patch to fix this from Julian Anastasov.
      
      2) Calm down clang compilation warning in ctnetlink due to type
         mismatch, from Matthias Kaehlcke.
      
      3) Do not re-setup NAT for conntracks that are already confirmed, this
         is fixing a problem that was introduced in the previous nf-next batch.
         Patch from Liping Zhang.
      
      4) Do not allow conntrack helper removal from userspace cthelper
         infrastructure if already in used. This comes with an initial patch
         to introduce nf_conntrack_helper_put() that is required by this fix.
         From Liping Zhang.
      
      5) Zero the pad when copying data to userspace, otherwise iptables fails
         to remove rules. This is a follow up on the patchset that sorts out
         the internal match/target structure pointer leak to userspace. Patch
         from the same author, Willem de Bruijn. This also comes with a build
         failure when CONFIG_COMPAT is not on, coming in the last patch of
         this series.
      
      6) SYNPROXY crashes with conntrack entries that are created via
         ctnetlink, more specifically via conntrackd state sync. Patch from
         Eric Leblond.
      
      7) RCU safe iteration on set element dumping in nf_tables, from
         Liping Zhang.
      
      8) Missing sanitization of immediate date for the bitwise and cmp
         expressions in nf_tables.
      
      9) Refcounting logic for chain and objects from set elements does not
         integrate into the nf_tables 2-phase commit protocol.
      
      10) Missing sanitization of target verdict in ebtables arpreply target,
          from Gao Feng.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      23416e23
  3. May 19, 2017
    • Linus Torvalds's avatar
      Merge tag 'md/4.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md · 8b4822de
      Linus Torvalds authored
      Pull MD fixes from Shaohua Li:
      
       - Several bug fixes for raid5-cache from Song Liu, mainly handle
         journal disk error
      
       - Fix bad block handling in choosing raid1 disk from Tomasz Majchrzak
      
       - Simplify external metadata array sysfs handling from Artur
         Paszkiewicz
      
       - Optimize raid0 discard handling from me, now raid0 will dispatch
         large discard IO directly to underlayer disks.
      
      * tag 'md/4.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md:
        raid1: prefer disk without bad blocks
        md/r5cache: handle sync with data in write back cache
        md/r5cache: gracefully handle journal device errors for writeback mode
        md/raid1/10: avoid unnecessary locking
        md/raid5-cache: in r5l_do_submit_io(), submit io->split_bio first
        md/md0: optimize raid0 discard handling
        md: don't return -EAGAIN in md_allow_write for external metadata arrays
        md/raid5: make use of spin_lock_irq over local_irq_disable + spin_lock
      8b4822de
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 667f867c
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Don't allow negative TCP reordering values, from Soheil Hassas
          Yeganeh.
      
       2) Don't overflow while parsing ipv6 header options, from Craig Gallek.
      
       3) Handle more cleanly the case where an individual route entry during
          a dump will not fit into the allocated netlink SKB, from David
          Ahern.
      
       4) Add missing CONFIG_INET dependency for mlx5e, from Arnd Bergmann.
      
       5) Allow neighbour updates to converge more quickly via gratuitous
          ARPs, from Ihar Hrachyshka.
      
       6) Fix compile error from CONFIG_INET is disabled, from Eric Dumazet.
      
       7) Fix use after free in x25 protocol init, from Lin Zhang.
      
       8) Valid VLAN pvid ranges passed into br_validate(), from Tobias
          Jungel.
      
       9) NULL out address lists in child sockets in SCTP, this is similar to
          the fix we made for inet connection sockets last week. From Eric
          Dumazet.
      
      10) Fix NULL deref in mlxsw driver, from Ido Schimmel.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (27 commits)
        mlxsw: spectrum: Avoid possible NULL pointer dereference
        sh_eth: Do not print an error message for probe deferral
        sh_eth: Use platform device for printing before register_netdev()
        mlxsw: spectrum_router: Fix rif counter freeing routine
        mlxsw: spectrum_dpipe: Fix incorrect entry index
        cxgb4: update latest firmware version supported
        qmi_wwan: add another Lenovo EM74xx device ID
        sctp: do not inherit ipv6_{mc|ac|fl}_list from parent
        udp: make *udp*_queue_rcv_skb() functions static
        bridge: netlink: check vlan_default_pvid range
        net: ethernet: faraday: To support device tree usage.
        net: x25: fix one potential use-after-free issue
        bpf: adjust verifier heuristics
        ipv6: Check ip6_find_1stfragopt() return value properly.
        selftests/bpf: fix broken build due to types.h
        bnxt_en: Check status of firmware DCBX agent before setting DCB_CAP_DCBX_HOST.
        bnxt_en: Call bnxt_dcb_init() after getting firmware DCBX configuration.
        net: fix compile error in skb_orphan_partial()
        ipv6: Prevent overrun when parsing v6 header options
        neighbour: update neigh timestamps iff update is effective
        ...
      667f867c
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc · a58a260f
      Linus Torvalds authored
      Pull sparc fixes from David Miller:
       "Three sparc bug fixes"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
        sparc/ftrace: Fix ftrace graph time measurement
        sparc: Fix -Wstringop-overflow warning
        sparc64: Fix mapping of 64k pages with MAP_FIXED
      a58a260f
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v4.12' of... · 5396a018
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fix from Masahiro Yamada:
       "Fix headers_install to not delete pre-existing headers in the install
        destination"
      
      * tag 'kbuild-fixes-v4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        kbuild: skip install/check of headers right under uapi directories
      5396a018
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace · 16d95c43
      Linus Torvalds authored
      Pull pid namespace fixes from Eric Biederman:
       "These are two bugs that turn out to have simple fixes that were
        reported during the merge window. Both of these issues have existed
        for a while and it just happens that they both were reported at almost
        the same time"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
        pid_ns: Fix race between setns'ed fork() and zap_pid_ns_processes()
        pid_ns: Sleep in TASK_INTERRUPTIBLE in zap_pid_ns_processes
      16d95c43
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-linus-v4.12-rc2' of... · af5d2856
      Linus Torvalds authored
      Merge tag 'hwmon-for-linus-v4.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      Pull hwmon fix from Guenter Roeck:
       "Fix problem with hotplug state machine in coretemp driver"
      
      * tag 'hwmon-for-linus-v4.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (coretemp) Handle frozen hotplug state correctly
      af5d2856
  4. May 18, 2017