Skip to content
  1. Jun 12, 2017
  2. Jun 11, 2017
  3. Jun 10, 2017
    • David S. Miller's avatar
      Merge tag 'linux-can-fixes-for-4.12-20170609' of... · f6d4c713
      David S. Miller authored
      Merge tag 'linux-can-fixes-for-4.12-20170609' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
      
      
      
      Marc Kleine-Budde says:
      
      ====================
      pull-request: can 2017-06-09
      
      this is a pull request of 6 patches for net/master.
      
      There's a patch by Stephane Grosjean that fixes an uninitialized symbol warning
      in the peak_canfd driver. A patch by Johan Hovold to fix the product-id
      endianness in an error message in the the peak_usb driver. A patch by Oliver
      Hartkopp to enable CAN FD for virtual CAN devices by default. Three patches by
      me, one makes the helper function can_change_state() robust to be called with
      cf == NULL. The next patch fixes a memory leak in the gs_usb driver. And the
      last one fixes a lockdep splat by properly initialize the per-net
      can_rcvlists_lock spin_lock.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f6d4c713
    • Johannes Berg's avatar
      mac80211: free netdev on dev_alloc_name() error · c7a61cba
      Johannes Berg authored
      
      
      The change to remove free_netdev() from ieee80211_if_free()
      erroneously didn't add the necessary free_netdev() for when
      ieee80211_if_free() is called directly in one place, rather
      than as the priv_destructor. Add the missing call.
      
      Fixes: cf124db5 ("net: Fix inconsistent teardown and release of private netdev state.")
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c7a61cba
    • ashwanth@codeaurora.org's avatar
      net: rps: send out pending IPI's on CPU hotplug · 773fc8f6
      ashwanth@codeaurora.org authored
      
      
      IPI's from the victim cpu are not handled in dev_cpu_callback.
      So these pending IPI's would be sent to the remote cpu only when
      NET_RX is scheduled on the victim cpu and since this trigger is
      unpredictable it would result in packet latencies on the remote cpu.
      
      This patch add support to send the pending ipi's of victim cpu.
      
      Signed-off-by: default avatarAshwanth Goli <ashwanth@codeaurora.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      773fc8f6
    • Mario Molitor's avatar
      stmmac: fix for hw timestamp of GMAC3 unit · 33d4c482
      Mario Molitor authored
      
      
      1.) Bugfix of function stmmac_get_tx_hwtstamp.
          Corrected the tx timestamp available check (same as 4.8 and older)
          Change printout from info syslevel to debug.
      
      2.) Bugfix of function stmmac_get_rx_hwtstamp.
          Corrected the rx timestamp available check (same as 4.8 and older)
          Change printout from info syslevel to debug.
      
      Fixes: ba1ffd74 ("stmmac: fix PTP support for GMAC4")
      Signed-off-by: default avatarMario Molitor <mario_molitor@web.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      33d4c482
    • Mario Molitor's avatar
      stmmac: fix ptp header for GMAC3 hw timestamp · fd6720ae
      Mario Molitor authored
      
      
      According the CYCLON V documention only the bit 16 of snaptypesel should
      set.
      (more information see Table 17-20 (cv_5v4.pdf) :
       Timestamp Snapshot Dependency on Register Bits)
      
      Fixes: d2042052 ("stmmac: update the PTP header file")
      Signed-off-by: default avatarMario Molitor <mario_molitor@web.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fd6720ae
    • Krister Johansen's avatar
      Fix an intermittent pr_emerg warning about lo becoming free. · f186ce61
      Krister Johansen authored
      
      
      It looks like this:
      
      Message from syslogd@flamingo at Apr 26 00:45:00 ...
       kernel:unregister_netdevice: waiting for lo to become free. Usage count = 4
      
      They seem to coincide with net namespace teardown.
      
      The message is emitted by netdev_wait_allrefs().
      
      Forced a kdump in netdev_run_todo, but found that the refcount on the lo
      device was already 0 at the time we got to the panic.
      
      Used bcc to check the blocking in netdev_run_todo.  The only places
      where we're off cpu there are in the rcu_barrier() and msleep() calls.
      That behavior is expected.  The msleep time coincides with the amount of
      time we spend waiting for the refcount to reach zero; the rcu_barrier()
      wait times are not excessive.
      
      After looking through the list of callbacks that the netdevice notifiers
      invoke in this path, it appears that the dst_dev_event is the most
      interesting.  The dst_ifdown path places a hold on the loopback_dev as
      part of releasing the dev associated with the original dst cache entry.
      Most of our notifier callbacks are straight-forward, but this one a)
      looks complex, and b) places a hold on the network interface in
      question.
      
      I constructed a new bcc script that watches various events in the
      liftime of a dst cache entry.  Note that dst_ifdown will take a hold on
      the loopback device until the invalidated dst entry gets freed.
      
      [      __dst_free] on DST: ffff883ccabb7900 IF tap1008300eth0 invoked at 1282115677036183
          __dst_free
          rcu_nocb_kthread
          kthread
          ret_from_fork
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f186ce61
  4. Jun 09, 2017
    • Mateusz Jurczyk's avatar
      af_unix: Add sockaddr length checks before accessing sa_family in bind and connect handlers · defbcf2d
      Mateusz Jurczyk authored
      
      
      Verify that the caller-provided sockaddr structure is large enough to
      contain the sa_family field, before accessing it in bind() and connect()
      handlers of the AF_UNIX socket. Since neither syscall enforces a minimum
      size of the corresponding memory region, very short sockaddrs (zero or
      one byte long) result in operating on uninitialized memory while
      referencing .sa_family.
      
      Signed-off-by: default avatarMateusz Jurczyk <mjurczyk@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      defbcf2d
    • Joe Perches's avatar
      net: phy: add missing SPEED_14000 · fc5b775d
      Joe Perches authored
      
      
      Fixes: 0d7e2d21 ("IB/ipoib: add get_link_ksettings in ethtool")
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fc5b775d
    • Oliver Hartkopp's avatar
      can: enable CAN FD for virtual CAN devices by default · 97edec3a
      Oliver Hartkopp authored
      
      
      CAN FD capable CAN interfaces can handle (classic) CAN 2.0 frames too.
      New users usually fail at their first attempt to explore CAN FD on
      virtual CAN interfaces due to the current CAN_MTU default.
      
      Set the MTU to CANFD_MTU by default to reduce this confusion.
      If someone *really* needs a 'classic CAN'-only device this can be set
      with the 'ip' tool with e.g. 'ip link set vcan0 mtu 16' as before.
      
      Signed-off-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      97edec3a
    • Marc Kleine-Budde's avatar
      can: af_can: namespace support: fix lockdep splat: properly initialize spin_lock · 74b7b490
      Marc Kleine-Budde authored
      
      
      This patch uses spin_lock_init() instead of __SPIN_LOCK_UNLOCKED() to
      initialize the per namespace net->can.can_rcvlists_lock lock to fix this
      lockdep warning:
      
      | INFO: trying to register non-static key.
      | the code is fine but needs lockdep annotation.
      | turning off the locking correctness validator.
      | CPU: 0 PID: 186 Comm: candump Not tainted 4.12.0-rc3+ #47
      | Hardware name: Marvell Kirkwood (Flattened Device Tree)
      | [<c0016644>] (unwind_backtrace) from [<c00139a8>] (show_stack+0x18/0x1c)
      | [<c00139a8>] (show_stack) from [<c0058c8c>] (register_lock_class+0x1e4/0x55c)
      | [<c0058c8c>] (register_lock_class) from [<c005bdfc>] (__lock_acquire+0x148/0x1990)
      | [<c005bdfc>] (__lock_acquire) from [<c005deec>] (lock_acquire+0x174/0x210)
      | [<c005deec>] (lock_acquire) from [<c04a6780>] (_raw_spin_lock+0x50/0x88)
      | [<c04a6780>] (_raw_spin_lock) from [<bf02116c>] (can_rx_register+0x94/0x15c [can])
      | [<bf02116c>] (can_rx_register [can]) from [<bf02a868>] (raw_enable_filters+0x60/0xc0 [can_raw])
      | [<bf02a868>] (raw_enable_filters [can_raw]) from [<bf02ac14>] (raw_enable_allfilters+0x2c/0xa0 [can_raw])
      | [<bf02ac14>] (raw_enable_allfilters [can_raw]) from [<bf02ad38>] (raw_bind+0xb0/0x250 [can_raw])
      | [<bf02ad38>] (raw_bind [can_raw]) from [<c03b5fb8>] (SyS_bind+0x70/0xac)
      | [<c03b5fb8>] (SyS_bind) from [<c000f8c0>] (ret_fast_syscall+0x0/0x1c)
      
      Cc: Mario Kicherer <dev@kicherer.org>
      Acked-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      74b7b490
    • Marc Kleine-Budde's avatar
      can: gs_usb: fix memory leak in gs_cmd_reset() · 5cda3ee5
      Marc Kleine-Budde authored
      
      
      This patch adds the missing kfree() in gs_cmd_reset() to free the
      memory that is not used anymore after usb_control_msg().
      
      Cc: linux-stable <stable@vger.kernel.org>
      Cc: Maximilian Schneider <max@schneidersoft.net>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      5cda3ee5
    • Johan Hovold's avatar
      can: peak_usb: fix product-id endianness in error message · dadcd398
      Johan Hovold authored
      
      
      Make sure to use the USB device product-id stored in host-byte order in
      a probe error message.
      
      Also remove a redundant reassignment of the local usb_dev variable which
      had already been used to retrieve the product id.
      
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      dadcd398
    • Stephane Grosjean's avatar
      can: peak_canfd: fix uninitialized symbol warnings · f2a918b4
      Stephane Grosjean authored
      
      
      This patch fixes two uninitialized symbol warnings in the new code adding
      support of the PEAK-System PCAN-PCI Express FD boards, in the socket-CAN
      network protocol family.
      
      Signed-off-by: default avatarStephane Grosjean <s.grosjean@peak-system.com>
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      f2a918b4
    • Marc Kleine-Budde's avatar
      can: dev: make can_change_state() robust to be called with cf == NULL · ff3416fb
      Marc Kleine-Budde authored
      
      
      In OOM situations where no skb can be allocated, can_change_state() may
      be called with cf == NULL. As this function updates the state and error
      statistics it's not an option to skip the call to can_change_state() in
      OOM situations.
      
      This patch makes can_change_state() robust, so that it can be called
      with cf == NULL.
      
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      ff3416fb
    • David Ahern's avatar
      net: vrf: Make add_fib_rules per network namespace flag · 097d3c95
      David Ahern authored
      
      
      Commit 1aa6c4f6 ("net: vrf: Add l3mdev rules on first device create")
      adds the l3mdev FIB rule the first time a VRF device is created. However,
      it only creates the rule once and only in the namespace the first device
      is created - which may not be init_net. Fix by using the net_generic
      capability to make the add_fib_rules flag per network namespace.
      
      Fixes: 1aa6c4f6 ("net: vrf: Add l3mdev rules on first device create")
      Reported-by: default avatarPetr Machata <petrm@mellanox.com>
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      097d3c95
    • Daniel Borkmann's avatar
      bpf, tests: fix endianness selection · 78a5a93c
      Daniel Borkmann authored
      
      
      I noticed that test_l4lb was failing in selftests:
      
        # ./test_progs
        test_pkt_access:PASS:ipv4 77 nsec
        test_pkt_access:PASS:ipv6 44 nsec
        test_xdp:PASS:ipv4 2933 nsec
        test_xdp:PASS:ipv6 1500 nsec
        test_l4lb:PASS:ipv4 377 nsec
        test_l4lb:PASS:ipv6 544 nsec
        test_l4lb:FAIL:stats 6297600000 200000
        test_tcp_estats:PASS: 0 nsec
        Summary: 7 PASSED, 1 FAILED
      
      Tracking down the issue actually revealed that endianness selection
      in bpf_endian.h is broken when compiled with clang with bpf target.
      test_pkt_access.c, test_l4lb.c is compiled with __BYTE_ORDER as
      __BIG_ENDIAN, test_xdp.c as __LITTLE_ENDIAN! test_l4lb noticeably
      fails, because the test accounts bytes via bpf_ntohs(ip6h->payload_len)
      and bpf_ntohs(iph->tot_len), and compares them against a defined
      value and given a wrong endianness, the test outcome is different,
      of course.
      
      Turns out that there are actually two bugs: i) when we do __BYTE_ORDER
      comparison with __LITTLE_ENDIAN/__BIG_ENDIAN, then depending on the
      include order we see different outcomes. Reason is that __BYTE_ORDER
      is undefined due to missing endian.h include. Before we include the
      asm/byteorder.h (e.g. through linux/in.h), then __BYTE_ORDER equals
      __LITTLE_ENDIAN since both are undefined, after the include which
      correctly pulls in linux/byteorder/little_endian.h, __LITTLE_ENDIAN
      is defined, but given __BYTE_ORDER is still undefined, we match on
      __BYTE_ORDER equals to __BIG_ENDIAN since __BIG_ENDIAN is also
      undefined at that point, sigh. ii) But even that would be wrong,
      since when compiling the test cases with clang, one can select between
      bpfeb and bpfel targets for cross compilation. Hence, we can also not
      rely on what the system's endian.h provides, but we need to look at
      the compiler's defined endianness. The compiler defines __BYTE_ORDER__,
      and we can match __ORDER_LITTLE_ENDIAN__ and __ORDER_BIG_ENDIAN__,
      which also reflects targets bpf (native), bpfel, bpfeb correctly,
      thus really only rely on that. After patch:
      
        # ./test_progs
        test_pkt_access:PASS:ipv4 74 nsec
        test_pkt_access:PASS:ipv6 42 nsec
        test_xdp:PASS:ipv4 2340 nsec
        test_xdp:PASS:ipv6 1461 nsec
        test_l4lb:PASS:ipv4 400 nsec
        test_l4lb:PASS:ipv6 530 nsec
        test_tcp_estats:PASS: 0 nsec
        Summary: 7 PASSED, 0 FAILED
      
      Fixes: 43bcf707 ("bpf: fix _htons occurences in test_progs")
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      78a5a93c
    • Nicolas Dichtel's avatar
      ethtool.h: remind to update 802.3ad when adding new speeds · 297fb414
      Nicolas Dichtel authored
      
      
      Each time a new speed is added, the bonding 802.3ad isn't updated. Add a
      comment to remind the developer to update this driver.
      
      Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Acked-by: default avatarAndy Gospodarek <andy@greyhouse.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      297fb414