Skip to content
  1. Sep 01, 2019
    • Dmitry Bogdanov's avatar
      net: aquantia: fix removal of vlan 0 · 6fdc060d
      Dmitry Bogdanov authored
      
      
      Due to absence of checking against the rx flow rule when vlan 0 is being
      removed, the other rule could be removed instead of the rule with vlan 0
      
      Fixes: 7975d2af ("net: aquantia: add support of rx-vlan-filter offload")
      Signed-off-by: default avatarDmitry Bogdanov <dmitry.bogdanov@aquantia.com>
      Signed-off-by: default avatarIgor Russkikh <igor.russkikh@aquantia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6fdc060d
    • David S. Miller's avatar
      Merge branch 'Fix-issues-in-tc-taprio-and-tc-cbs' · 154f4fb7
      David S. Miller authored
      
      
      Vladimir Oltean says:
      
      ====================
      Fix issues in tc-taprio and tc-cbs
      
      This series fixes one panic and one WARN_ON found in the tc-taprio
      qdisc, while trying to apply it:
      
      - On an interface which is not multi-queue
      - On an interface which has no carrier
      
      The tc-cbs was also visually found to suffer of the same issue as
      tc-taprio, and the fix was only compile-tested in that case.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      154f4fb7
    • Vladimir Oltean's avatar
      net/sched: cbs: Set default link speed to 10 Mbps in cbs_set_port_rate · 1c6c09a0
      Vladimir Oltean authored
      
      
      The discussion to be made is absolutely the same as in the case of
      previous patch ("taprio: Set default link speed to 10 Mbps in
      taprio_set_picos_per_byte"). Nothing is lost when setting a default.
      
      Cc: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
      Fixes: e0a7683d ("net/sched: cbs: fix port_rate miscalculation")
      Acked-by: default avatarVinicius Costa Gomes <vinicius.gomes@intel.com>
      Signed-off-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1c6c09a0
    • Vladimir Oltean's avatar
      taprio: Set default link speed to 10 Mbps in taprio_set_picos_per_byte · f04b514c
      Vladimir Oltean authored
      
      
      The taprio budget needs to be adapted at runtime according to interface
      link speed. But that handling is problematic.
      
      For one thing, installing a qdisc on an interface that doesn't have
      carrier is not illegal. But taprio prints the following stack trace:
      
      [   31.851373] ------------[ cut here ]------------
      [   31.856024] WARNING: CPU: 1 PID: 207 at net/sched/sch_taprio.c:481 taprio_dequeue+0x1a8/0x2d4
      [   31.864566] taprio: dequeue() called with unknown picos per byte.
      [   31.864570] Modules linked in:
      [   31.873701] CPU: 1 PID: 207 Comm: tc Not tainted 5.3.0-rc5-01199-g8838fe023cd6 #1689
      [   31.881398] Hardware name: Freescale LS1021A
      [   31.885661] [<c03133a4>] (unwind_backtrace) from [<c030d8cc>] (show_stack+0x10/0x14)
      [   31.893368] [<c030d8cc>] (show_stack) from [<c10ac958>] (dump_stack+0xb4/0xc8)
      [   31.900555] [<c10ac958>] (dump_stack) from [<c0349d04>] (__warn+0xe0/0xf8)
      [   31.907395] [<c0349d04>] (__warn) from [<c0349d64>] (warn_slowpath_fmt+0x48/0x6c)
      [   31.914841] [<c0349d64>] (warn_slowpath_fmt) from [<c0f38db4>] (taprio_dequeue+0x1a8/0x2d4)
      [   31.923150] [<c0f38db4>] (taprio_dequeue) from [<c0f227b0>] (__qdisc_run+0x90/0x61c)
      [   31.930856] [<c0f227b0>] (__qdisc_run) from [<c0ec82ac>] (net_tx_action+0x12c/0x2bc)
      [   31.938560] [<c0ec82ac>] (net_tx_action) from [<c0302298>] (__do_softirq+0x130/0x3c8)
      [   31.946350] [<c0302298>] (__do_softirq) from [<c03502a0>] (irq_exit+0xbc/0xd8)
      [   31.953536] [<c03502a0>] (irq_exit) from [<c03a4808>] (__handle_domain_irq+0x60/0xb4)
      [   31.961328] [<c03a4808>] (__handle_domain_irq) from [<c0754478>] (gic_handle_irq+0x58/0x9c)
      [   31.969638] [<c0754478>] (gic_handle_irq) from [<c0301a8c>] (__irq_svc+0x6c/0x90)
      [   31.977076] Exception stack(0xe8167b20 to 0xe8167b68)
      [   31.982100] 7b20: e9d4bd80 00000cc0 000000cf 00000000 e9d4bd80 c1f38958 00000cc0 c1f38960
      [   31.990234] 7b40: 00000001 000000cf 00000004 e9dc0800 00000000 e8167b70 c0f478ec c0f46d94
      [   31.998363] 7b60: 60070013 ffffffff
      [   32.001833] [<c0301a8c>] (__irq_svc) from [<c0f46d94>] (netlink_trim+0x18/0xd8)
      [   32.009104] [<c0f46d94>] (netlink_trim) from [<c0f478ec>] (netlink_broadcast_filtered+0x34/0x414)
      [   32.017930] [<c0f478ec>] (netlink_broadcast_filtered) from [<c0f47cec>] (netlink_broadcast+0x20/0x28)
      [   32.027102] [<c0f47cec>] (netlink_broadcast) from [<c0eea378>] (rtnetlink_send+0x34/0x88)
      [   32.035238] [<c0eea378>] (rtnetlink_send) from [<c0f25890>] (notify_and_destroy+0x2c/0x44)
      [   32.043461] [<c0f25890>] (notify_and_destroy) from [<c0f25e08>] (qdisc_graft+0x398/0x470)
      [   32.051595] [<c0f25e08>] (qdisc_graft) from [<c0f27a00>] (tc_modify_qdisc+0x3a4/0x724)
      [   32.059470] [<c0f27a00>] (tc_modify_qdisc) from [<c0ee4c84>] (rtnetlink_rcv_msg+0x260/0x2ec)
      [   32.067864] [<c0ee4c84>] (rtnetlink_rcv_msg) from [<c0f4a988>] (netlink_rcv_skb+0xb8/0x110)
      [   32.076172] [<c0f4a988>] (netlink_rcv_skb) from [<c0f4a170>] (netlink_unicast+0x1b4/0x22c)
      [   32.084392] [<c0f4a170>] (netlink_unicast) from [<c0f4a5e4>] (netlink_sendmsg+0x33c/0x380)
      [   32.092614] [<c0f4a5e4>] (netlink_sendmsg) from [<c0ea9f40>] (sock_sendmsg+0x14/0x24)
      [   32.100403] [<c0ea9f40>] (sock_sendmsg) from [<c0eaa780>] (___sys_sendmsg+0x214/0x228)
      [   32.108279] [<c0eaa780>] (___sys_sendmsg) from [<c0eabad0>] (__sys_sendmsg+0x50/0x8c)
      [   32.116068] [<c0eabad0>] (__sys_sendmsg) from [<c0301000>] (ret_fast_syscall+0x0/0x54)
      [   32.123938] Exception stack(0xe8167fa8 to 0xe8167ff0)
      [   32.128960] 7fa0:                   b6fa68c8 000000f8 00000003 bea142d0 00000000 00000000
      [   32.137093] 7fc0: b6fa68c8 000000f8 0052154c 00000128 5d6468a2 00000000 00000028 00558c9c
      [   32.145224] 7fe0: 00000070 bea14278 00530d64 b6e17e64
      [   32.150659] ---[ end trace 2139c9827c3e5177 ]---
      
      This happens because the qdisc ->dequeue callback gets called. Which
      again is not illegal, the qdisc will dequeue even when the interface is
      up but doesn't have carrier (and hence SPEED_UNKNOWN), and the frames
      will be dropped further down the stack in dev_direct_xmit().
      
      And, at the end of the day, for what? For calculating the initial budget
      of an interface which is non-operational at the moment and where frames
      will get dropped anyway.
      
      So if we can't figure out the link speed, default to SPEED_10 and move
      along. We can also remove the runtime check now.
      
      Cc: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
      Fixes: 7b9eba7b ("net/sched: taprio: fix picos_per_byte miscalculation")
      Acked-by: default avatarVinicius Costa Gomes <vinicius.gomes@intel.com>
      Signed-off-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f04b514c
    • Vladimir Oltean's avatar
      taprio: Fix kernel panic in taprio_destroy · efb55222
      Vladimir Oltean authored
      
      
      taprio_init may fail earlier than this line:
      
      	list_add(&q->taprio_list, &taprio_list);
      
      i.e. due to the net device not being multi queue.
      
      Attempting to remove q from the global taprio_list when it is not part
      of it will result in a kernel panic.
      
      Fix it by matching list_add and list_del better to one another in the
      order of operations. This way we can keep the deletion unconditional
      and with lower complexity - O(1).
      
      Cc: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
      Fixes: 7b9eba7b ("net/sched: taprio: fix picos_per_byte miscalculation")
      Signed-off-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Acked-by: default avatarVinicius Costa Gomes <vinicius.gomes@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      efb55222
    • George McCollister's avatar
      net: dsa: microchip: fill regmap_config name · 5f81d545
      George McCollister authored
      
      
      Use the register value width as the regmap_config name to prevent the
      following error when the second and third regmap_configs are
      initialized.
       "debugfs: Directory '${bus-id}' with parent 'regmap' already present!"
      
      Signed-off-by: default avatarGeorge McCollister <george.mccollister@gmail.com>
      Reviewed-by: default avatarMarek Vasut <marex@denx.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5f81d545
    • David S. Miller's avatar
      Merge tag 'batadv-net-for-davem-20190830' of git://git.open-mesh.org/linux-merge · 5b161002
      David S. Miller authored
      
      
      Simon Wunderlich says:
      
      ====================
      Here are two batman-adv bugfixes:
      
       - Fix OGM and OGMv2 header read boundary check,
         by Sven Eckelmann (2 patches)
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5b161002
  2. Aug 31, 2019
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf · c3d7a089
      David S. Miller authored
      
      
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter fixes for net
      
      The following patchset contains Netfilter fixes for net:
      
      1) Spurious warning when loading rules using the physdev match,
         from Todd Seidelmann.
      
      2) Fix FTP conntrack helper debugging output, from Thomas Jarosch.
      
      3) Restore per-netns nf_conntrack_{acct,helper,timeout} sysctl knobs,
         from Florian Westphal.
      
      4) Clear skbuff timestamp from the flowtable datapath, also from Florian.
      
      5) Fix incorrect byteorder of NFT_META_BRI_IIFVPROTO, from wenxu.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c3d7a089
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · 94880a5b
      David S. Miller authored
      
      
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf 2019-08-31
      
      The following pull-request contains BPF updates for your *net* tree.
      
      The main changes are:
      
      1) Fix 32-bit zero-extension during constant blinding which
         has been causing a regression on ppc64, from Naveen.
      
      2) Fix a latency bug in nfp driver when updating stack index
         register, from Jiong.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      94880a5b
    • David Howells's avatar
      rxrpc: Fix lack of conn cleanup when local endpoint is cleaned up [ver #2] · d12040b6
      David Howells authored
      
      
      When a local endpoint is ceases to be in use, such as when the kafs module
      is unloaded, the kernel will emit an assertion failure if there are any
      outstanding client connections:
      
      	rxrpc: Assertion failed
      	------------[ cut here ]------------
      	kernel BUG at net/rxrpc/local_object.c:433!
      
      and even beyond that, will evince other oopses if there are service
      connections still present.
      
      Fix this by:
      
       (1) Removing the triggering of connection reaping when an rxrpc socket is
           released.  These don't actually clean up the connections anyway - and
           further, the local endpoint may still be in use through another
           socket.
      
       (2) Mark the local endpoint as dead when we start the process of tearing
           it down.
      
       (3) When destroying a local endpoint, strip all of its client connections
           from the idle list and discard the ref on each that the list was
           holding.
      
       (4) When destroying a local endpoint, call the service connection reaper
           directly (rather than through a workqueue) to immediately kill off all
           outstanding service connections.
      
       (5) Make the service connection reaper reap connections for which the
           local endpoint is marked dead.
      
      Only after destroying the connections can we close the socket lest we get
      an oops in a workqueue that's looking at a connection or a peer.
      
      Fixes: 3d18cbb7 ("rxrpc: Fix conn expiry timers")
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Tested-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d12040b6
    • David S. Miller's avatar
      Merge tag 'rxrpc-fixes-20190827' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs · a285c1fa
      David S. Miller authored
      
      
      David Howells says:
      
      ====================
      rxrpc: Fix use of skb_cow_data()
      
      Here's a series of patches that replaces the use of skb_cow_data() in rxrpc
      with skb_unshare() early on in the input process.  The problem that is
      being seen is that skb_cow_data() indirectly requires that the maximum
      usage count on an sk_buff be 1, and it may generate an assertion failure in
      pskb_expand_head() if not.
      
      This can occur because rxrpc_input_data() may be still holding a ref when
      it has just attached the sk_buff to the rx ring and given that attachment
      its own ref.  If recvmsg happens fast enough, skb_cow_data() can see the
      ref still held by the softirq handler.
      
      Further, a packet may contain multiple subpackets, each of which gets its
      own attachment to the ring and its own ref - also making skb_cow_data() go
      bang.
      
      Fix this by:
      
       (1) The DATA packet is currently parsed for subpackets twice by the input
           routines.  Parse it just once instead and make notes in the sk_buff
           private data.
      
       (2) Use the notes from (1) when attaching the packet to the ring multiple
           times.  Once the packet is attached to the ring, recvmsg can see it
           and start modifying it, so the softirq handler is not permitted to
           look inside it from that point.
      
       (3) Pass the ref from the input code to the ring rather than getting an
           extra ref.  rxrpc_input_data() uses a ref on the second refcount to
           prevent the packet from evaporating under it.
      
       (4) Call skb_unshare() on secured DATA packets in rxrpc_input_packet()
           before we take call->input_lock.  Other sorts of packets don't get
           modified and so can be left.
      
           A trace is emitted if skb_unshare() eats the skb.  Note that
           skb_share() for our accounting in this regard as we can't see the
           parameters in the packet to log in a trace line if it releases it.
      
       (5) Remove the calls to skb_cow_data().  These are then no longer
           necessary.
      
      There are also patches to improve the rxrpc_skb tracepoint to make sure
      that Tx-derived buffers are identified separately from Rx-derived buffers
      in the trace.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a285c1fa
    • Chen-Yu Tsai's avatar
      net: stmmac: dwmac-rk: Don't fail if phy regulator is absent · 3b25528e
      Chen-Yu Tsai authored
      
      
      The devicetree binding lists the phy phy as optional. As such, the
      driver should not bail out if it can't find a regulator. Instead it
      should just skip the remaining regulator related code and continue
      on normally.
      
      Skip the remainder of phy_power_on() if a regulator supply isn't
      available. This also gets rid of the bogus return code.
      
      Fixes: 2e12f536 ("net: stmmac: dwmac-rk: Use standard devicetree property for phy regulator")
      Signed-off-by: default avatarChen-Yu Tsai <wens@csie.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3b25528e
    • YueHaibing's avatar
      amd-xgbe: Fix error path in xgbe_mod_init() · b6b4dc4c
      YueHaibing authored
      
      
      In xgbe_mod_init(), we should do cleanup if some error occurs
      
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Fixes: efbaa828 ("amd-xgbe: Add support to handle device renaming")
      Fixes: 47f164de ("amd-xgbe: Add PCI device support")
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b6b4dc4c
  3. Aug 30, 2019
  4. Aug 29, 2019
  5. Aug 28, 2019
    • Eric Dumazet's avatar
      tcp: remove empty skb from write queue in error cases · fdfc5c85
      Eric Dumazet authored
      
      
      Vladimir Rutsky reported stuck TCP sessions after memory pressure
      events. Edge Trigger epoll() user would never receive an EPOLLOUT
      notification allowing them to retry a sendmsg().
      
      Jason tested the case of sk_stream_alloc_skb() returning NULL,
      but there are other paths that could lead both sendmsg() and sendpage()
      to return -1 (EAGAIN), with an empty skb queued on the write queue.
      
      This patch makes sure we remove this empty skb so that
      Jason code can detect that the queue is empty, and
      call sk->sk_write_space(sk) accordingly.
      
      Fixes: ce5ec440 ("tcp: ensure epoll edge trigger wakeup when write queue is empty")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Jason Baron <jbaron@akamai.com>
      Reported-by: default avatarVladimir Rutsky <rutsky@google.com>
      Cc: Soheil Hassas Yeganeh <soheil@google.com>
      Cc: Neal Cardwell <ncardwell@google.com>
      Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
      Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fdfc5c85
    • Ka-Cheong Poon's avatar
      net/rds: Fix info leak in rds6_inc_info_copy() · 7d0a0658
      Ka-Cheong Poon authored
      
      
      The rds6_inc_info_copy() function has a couple struct members which
      are leaking stack information.  The ->tos field should hold actual
      information and the ->flags field needs to be zeroed out.
      
      Fixes: 3eb45036 ("rds: add type of service(tos) infrastructure")
      Fixes: b7ff8b10 ("rds: Extend RDS API for IPv6 support")
      Reported-by: default avatar黄ID蝴蝶 <butterflyhuangxx@gmail.com>
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarKa-Cheong Poon <ka-cheong.poon@oracle.com>
      Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7d0a0658
    • Feng Sun's avatar
      net: fix skb use after free in netpoll · 2c1644cf
      Feng Sun authored
      
      
      After commit baeababb
      ("tun: return NET_XMIT_DROP for dropped packets"),
      when tun_net_xmit drop packets, it will free skb and return NET_XMIT_DROP,
      netpoll_send_skb_on_dev will run into following use after free cases:
      1. retry netpoll_start_xmit with freed skb;
      2. queue freed skb in npinfo->txq.
      queue_process will also run into use after free case.
      
      hit netpoll_send_skb_on_dev first case with following kernel log:
      
      [  117.864773] kernel BUG at mm/slub.c:306!
      [  117.864773] invalid opcode: 0000 [#1] SMP PTI
      [  117.864774] CPU: 3 PID: 2627 Comm: loop_printmsg Kdump: loaded Tainted: P           OE     5.3.0-050300rc5-generic #201908182231
      [  117.864775] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014
      [  117.864775] RIP: 0010:kmem_cache_free+0x28d/0x2b0
      [  117.864781] Call Trace:
      [  117.864781]  ? tun_net_xmit+0x21c/0x460
      [  117.864781]  kfree_skbmem+0x4e/0x60
      [  117.864782]  kfree_skb+0x3a/0xa0
      [  117.864782]  tun_net_xmit+0x21c/0x460
      [  117.864782]  netpoll_start_xmit+0x11d/0x1b0
      [  117.864788]  netpoll_send_skb_on_dev+0x1b8/0x200
      [  117.864789]  __br_forward+0x1b9/0x1e0 [bridge]
      [  117.864789]  ? skb_clone+0x53/0xd0
      [  117.864790]  ? __skb_clone+0x2e/0x120
      [  117.864790]  deliver_clone+0x37/0x50 [bridge]
      [  117.864790]  maybe_deliver+0x89/0xc0 [bridge]
      [  117.864791]  br_flood+0x6c/0x130 [bridge]
      [  117.864791]  br_dev_xmit+0x315/0x3c0 [bridge]
      [  117.864792]  netpoll_start_xmit+0x11d/0x1b0
      [  117.864792]  netpoll_send_skb_on_dev+0x1b8/0x200
      [  117.864792]  netpoll_send_udp+0x2c6/0x3e8
      [  117.864793]  write_msg+0xd9/0xf0 [netconsole]
      [  117.864793]  console_unlock+0x386/0x4e0
      [  117.864793]  vprintk_emit+0x17e/0x280
      [  117.864794]  vprintk_default+0x29/0x50
      [  117.864794]  vprintk_func+0x4c/0xbc
      [  117.864794]  printk+0x58/0x6f
      [  117.864795]  loop_fun+0x24/0x41 [printmsg_loop]
      [  117.864795]  kthread+0x104/0x140
      [  117.864795]  ? 0xffffffffc05b1000
      [  117.864796]  ? kthread_park+0x80/0x80
      [  117.864796]  ret_from_fork+0x35/0x40
      
      Signed-off-by: default avatarFeng Sun <loyou85@gmail.com>
      Signed-off-by: default avatarXiaojun Zhao <xiaojunzhao141@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2c1644cf