1. 26 Oct, 2017 7 commits
  2. 25 Oct, 2017 20 commits
  3. 24 Oct, 2017 13 commits
    • David S. Miller's avatar
      Merge branch 'mlxsw-Various-fixes' · 6a331e15
      David S. Miller authored
      Jiri Pirko says:
      
      ====================
      mlxsw: Various fixes
      
      Yotam says:
      
      Cleanup some issues reported by sparse.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6a331e15
    • Yotam Gigi's avatar
      mlxsw: spectrum: mr_tcam: Include the mr_tcam header file · ea00aa3a
      Yotam Gigi authored
      Make the spectrum_mr_tcam.c include the spectrum_mr_tcam.h header file.
      
      Cleans up sparse warning:
      symbol 'mlxsw_sp_mr_tcam_ops' was not declared. Should it be static?
      
      Fixes: 0e14c777 ("mlxsw: spectrum: Add the multicast routing hardware logic")
      Signed-off-by: default avatarYotam Gigi <yotamg@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ea00aa3a
    • Yotam Gigi's avatar
      mlxsw: spectrum: mr: Make the function mlxsw_sp_mr_dev_vif_lookup static · 6a30dc29
      Yotam Gigi authored
      The function is only used internally in spectrum_mr.c and is not declared
      in the header file, thus make it static.
      
      Cleans up sparse warning:
      symbol 'mlxsw_sp_mr_dev_vif_lookup' was not declared. Should it be static?
      
      Fixes: c011ec1b ("mlxsw: spectrum: Add the multicast routing offloading logic")
      Signed-off-by: default avatarYotam Gigi <yotamg@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6a30dc29
    • Yotam Gigi's avatar
      mlxsw: spectrum: mr: Fix various endianness issues · de3872cd
      Yotam Gigi authored
      Fix various endianness issues in comparisons and assignments. The fix is
      entirely cosmetic as all the values fixed are endianness-agnostic.
      
      Cleans up sparse warnings:
      spectrum_mr.c:156:49: warning: restricted __be32 degrades to integer
      spectrum_mr.c:206:26: warning: restricted __be32 degrades to integer
      spectrum_mr.c:212:31: warning: incorrect type in assignment (different
        base types)
      spectrum_mr.c:212:31:    expected restricted __be32 [usertype] addr4
      spectrum_mr.c:212:31:    got unsigned int
      spectrum_mr.c:214:32: warning: incorrect type in assignment (different
        base types)
      spectrum_mr.c:214:32:    expected restricted __be32 [usertype] addr4
      spectrum_mr.c:214:32:    got unsigned int
      spectrum_mr.c:461:16: warning: restricted __be32 degrades to integer
      spectrum_mr.c:461:49: warning: restricted __be32 degrades to integer
      
      Fixes: c011ec1b ("mlxsw: spectrum: Add the multicast routing offloading logic")
      Signed-off-by: default avatarYotam Gigi <yotamg@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      de3872cd
    • Arkadi Sharshevsky's avatar
      mlxsw: spectrum_dpipe: Fix entries dump of the adjacency table · 69715dd5
      Arkadi Sharshevsky authored
      During the dump the per netlink packet entry counter should be zeroed out
      when new packet is created.
      
      Fixes: 190d38a5 ("mlxsw: spectrum_dpipe: Add support for adjacency table dump")
      Signed-off-by: default avatarArkadi Sharshevsky <arkadis@mellanox.com>
      Reported-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      69715dd5
    • Or Gerlitz's avatar
      net/sched: Fix actions list corruption when adding offloaded tc flows · 9d452ceb
      Or Gerlitz authored
      Prior to commit b3f55bdd, the networking core doesn't wire an in-place
      actions list the when the low level driver is called to offload the flow,
      but all low level drivers do that (call tcf_exts_to_list()) in their
      offloading "add" logic.
      
      Now, the in-place list is set in the core which goes over the list in a loop,
      but also by the hw driver when their offloading code is invoked indirectly:
      
      	cls_xxx add flow -> tc_setup_cb_call -> tc_exts_setup_cb_egdev_call -> hw driver
      
      which messes up the core list instance upon driver return. Fix that by avoiding
      in-place list on the net core code that deals with adding flows.
      
      Fixes: b3f55bdd ('net: sched: introduce per-egress action device callbacks')
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9d452ceb
    • Veerasenareddy Burru's avatar
      liquidio: pass date and time info to NIC firmware · 907aaa6b
      Veerasenareddy Burru authored
      Pass date and time information to NIC at the time of loading
      firmware and periodically update the host time to NIC firmware.
      This is to make NIC firmware use the same time reference as Host,
      so that it is easy to correlate logs from firmware and host for debugging.
      Signed-off-by: default avatarVeerasenareddy Burru <veerasenareddy.burru@cavium.com>
      Signed-off-by: default avatarFelix Manlunas <felix.manlunas@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      907aaa6b
    • Wei Wang's avatar
      ipv6: add ip6_null_entry check in rt6_select() · 87b1af8d
      Wei Wang authored
      In rt6_select(), fn->leaf could be pointing to net->ipv6.ip6_null_entry.
      In this case, we should directly return instead of trying to carry on
      with the rest of the process.
      If not, we could crash at:
        spin_lock_bh(&leaf->rt6i_table->rt6_lock);
      because net->ipv6.ip6_null_entry does not have rt6i_table set.
      
      Syzkaller recently reported following issue on net-next:
      Use struct sctp_sack_info instead
      kasan: CONFIG_KASAN_INLINE enabled
      kasan: GPF could be caused by NULL-ptr deref or user memory access
      general protection fault: 0000 [#1] SMP KASAN
      Dumping ftrace buffer:
         (ftrace buffer empty)
      Modules linked in:
      sctp: [Deprecated]: syz-executor4 (pid 26496) Use of struct sctp_assoc_value in delayed_ack socket option.
      Use struct sctp_sack_info instead
      CPU: 1 PID: 26523 Comm: syz-executor6 Not tainted 4.14.0-rc4+ #85
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      task: ffff8801d147e3c0 task.stack: ffff8801a4328000
      RIP: 0010:debug_spin_lock_before kernel/locking/spinlock_debug.c:83 [inline]
      RIP: 0010:do_raw_spin_lock+0x23/0x1e0 kernel/locking/spinlock_debug.c:112
      RSP: 0018:ffff8801a432ed70 EFLAGS: 00010207
      RAX: dffffc0000000000 RBX: 0000000000000018 RCX: 0000000000000000
      RDX: 0000000000000003 RSI: 0000000000000000 RDI: 000000000000001c
      RBP: ffff8801a432ed90 R08: 0000000000000001 R09: 0000000000000000
      R10: 0000000000000000 R11: ffffffff8482b279 R12: ffff8801ce2ff3a0
      sctp: [Deprecated]: syz-executor1 (pid 26546) Use of int in maxseg socket option.
      Use struct sctp_assoc_value instead
      R13: dffffc0000000000 R14: ffff8801d971e000 R15: ffff8801ce2ff0d8
      FS:  00007f56e82f5700(0000) GS:ffff8801db300000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000001ddbc22000 CR3: 00000001a4a04000 CR4: 00000000001406e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
       __raw_spin_lock_bh include/linux/spinlock_api_smp.h:136 [inline]
       _raw_spin_lock_bh+0x39/0x40 kernel/locking/spinlock.c:175
       spin_lock_bh include/linux/spinlock.h:321 [inline]
       rt6_select net/ipv6/route.c:786 [inline]
       ip6_pol_route+0x1be3/0x3bd0 net/ipv6/route.c:1650
      sctp: [Deprecated]: syz-executor1 (pid 26576) Use of int in maxseg socket option.
      Use struct sctp_assoc_value instead
      TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies.  Check SNMP counters.
       ip6_pol_route_output+0x4c/0x60 net/ipv6/route.c:1843
       fib6_rule_lookup+0x9e/0x2a0 net/ipv6/ip6_fib.c:309
       ip6_route_output_flags+0x1f1/0x2b0 net/ipv6/route.c:1871
       ip6_route_output include/net/ip6_route.h:80 [inline]
       ip6_dst_lookup_tail+0x4ea/0x970 net/ipv6/ip6_output.c:953
       ip6_dst_lookup_flow+0xc8/0x270 net/ipv6/ip6_output.c:1076
       sctp_v6_get_dst+0x675/0x1c30 net/sctp/ipv6.c:274
       sctp_transport_route+0xa8/0x430 net/sctp/transport.c:287
       sctp_assoc_add_peer+0x4fe/0x1100 net/sctp/associola.c:656
       __sctp_connect+0x251/0xc80 net/sctp/socket.c:1187
       sctp_connect+0xb4/0xf0 net/sctp/socket.c:4209
       inet_dgram_connect+0x16b/0x1f0 net/ipv4/af_inet.c:541
       SYSC_connect+0x20a/0x480 net/socket.c:1642
       SyS_connect+0x24/0x30 net/socket.c:1623
       entry_SYSCALL_64_fastpath+0x1f/0xbe
      
      Fixes: 66f5d6ce ("ipv6: replace rwlock with rcu and spinlock in fib6_table")
      Signed-off-by: default avatarWei Wang <weiwan@google.com>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      87b1af8d
    • Christoph Paasch's avatar
      tcp: Configure TFO without cookie per socket and/or per route · 71c02379
      Christoph Paasch authored
      We already allow to enable TFO without a cookie by using the
      fastopen-sysctl and setting it to TFO_SERVER_COOKIE_NOT_REQD (or
      TFO_CLIENT_NO_COOKIE).
      This is safe to do in certain environments where we know that there
      isn't a malicous host (aka., data-centers) or when the
      application-protocol already provides an authentication mechanism in the
      first flight of data.
      
      A server however might be providing multiple services or talking to both
      sides (public Internet and data-center). So, this server would want to
      enable cookie-less TFO for certain services and/or for connections that
      go to the data-center.
      
      This patch exposes a socket-option and a per-route attribute to enable such
      fine-grained configurations.
      Signed-off-by: default avatarChristoph Paasch <cpaasch@apple.com>
      Reviewed-by: default avatarYuchung Cheng <ycheng@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      71c02379
    • Tim Hansen's avatar
      net/sock: Update sk rcu iterator macro. · b6f4f848
      Tim Hansen authored
      Mark hlist node in sk rcu iterator as protected by the rcu.
      hlist_next_rcu accomplishes this and silences the warnings
      sparse throws.
      
      Found with make C=1 net/ipv4/udp.o on linux-next tag
      next-20171009.
      Signed-off-by: default avatarTim Hansen <devtimhansen@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b6f4f848
    • Gustavo A. R. Silva's avatar
      ipv4: tcp_minisocks: use BUG_ON instead of if condition followed by BUG · 49ca1943
      Gustavo A. R. Silva authored
      Use BUG_ON instead of if condition followed by BUG in tcp_time_wait.
      
      This issue was detected with the help of Coccinelle.
      Signed-off-by: default avatarGustavo A. R. Silva <garsilva@embeddedor.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      49ca1943
    • Gustavo A. R. Silva's avatar
      ipv4: icmp: use BUG_ON instead of if condition followed by BUG · 15285402
      Gustavo A. R. Silva authored
      Use BUG_ON instead of if condition followed by BUG in icmp_timestamp.
      
      This issue was detected with the help of Coccinelle.
      Signed-off-by: default avatarGustavo A. R. Silva <garsilva@embeddedor.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      15285402
    • Jesper Dangaard Brouer's avatar
      bpf: cpumap fix potential lost wake-up problem · 31749468
      Jesper Dangaard Brouer authored
      As pointed out by Michael, commit 1c601d82 ("bpf: cpumap xdp_buff
      to skb conversion and allocation") contains a classical example of the
      potential lost wake-up problem.
      
      We need to recheck the condition __ptr_ring_empty() after changing
      current->state to TASK_INTERRUPTIBLE, this avoids a race between
      wake_up_process() and schedule(). After this, a race with
      wake_up_process() will simply change the state to TASK_RUNNING, and
      the schedule() call not really put us to sleep.
      
      Fixes: 1c601d82 ("bpf: cpumap xdp_buff to skb conversion and allocation")
      Reported-by: default avatar"Michael S. Tsirkin" <mst@redhat.com>
      Signed-off-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      31749468