1. 14 3月, 2020 5 次提交
    • D
      afs: Fix handling of an abort from a service handler · dde9f095
      David Howells 提交于
      When an AFS service handler function aborts a call, AF_RXRPC marks the call
      as complete - which means that it's not going to get any more packets from
      the receiver.  This is a problem because reception of the final ACK is what
      triggers afs_deliver_to_call() to drop the final ref on the afs_call
      object.
      
      Instead, aborted AFS service calls may then just sit around waiting for
      ever or until they're displaced by a new call on the same connection
      channel or a connection-level abort.
      
      Fix this by calling afs_set_call_complete() to finalise the afs_call struct
      representing the call.
      
      However, we then need to drop the ref that stops the call from being
      deallocated.  We can do this in afs_set_call_complete(), as the work queue
      is holding a separate ref of its own, but then we shouldn't do it in
      afs_process_async_call() and afs_delete_async_call().
      
      call->drop_ref is set to indicate that a ref needs dropping for a call and
      this is dealt with when we transition a call to AFS_CALL_COMPLETE.
      
      But then we also need to get rid of the ref that pins an asynchronous
      client call.  We can do this by the same mechanism, setting call->drop_ref
      for an async client call too.
      
      We can also get rid of call->incoming since nothing ever sets it and only
      one thing ever checks it (futilely).
      
      
      A trace of the rxrpc_call and afs_call struct ref counting looks like:
      
                <idle>-0     [001] ..s5   164.764892: rxrpc_call: c=00000002 SEE u=3 sp=rxrpc_new_incoming_call+0x473/0xb34 a=00000000442095b5
                <idle>-0     [001] .Ns5   164.766001: rxrpc_call: c=00000002 QUE u=4 sp=rxrpc_propose_ACK+0xbe/0x551 a=00000000442095b5
                <idle>-0     [001] .Ns4   164.766005: rxrpc_call: c=00000002 PUT u=3 sp=rxrpc_new_incoming_call+0xa3f/0xb34 a=00000000442095b5
                <idle>-0     [001] .Ns7   164.766433: afs_call: c=00000002 WAKE  u=2 o=11 sp=rxrpc_notify_socket+0x196/0x33c
           kworker/1:2-1810  [001] ...1   164.768409: rxrpc_call: c=00000002 SEE u=3 sp=rxrpc_process_call+0x25/0x7ae a=00000000442095b5
           kworker/1:2-1810  [001] ...1   164.769439: rxrpc_tx_packet: c=00000002 e9f1a7a8:95786a88:00000008:09c5 00000001 00000000 02 22 ACK CallAck
           kworker/1:2-1810  [001] ...1   164.769459: rxrpc_call: c=00000002 PUT u=2 sp=rxrpc_process_call+0x74f/0x7ae a=00000000442095b5
           kworker/1:2-1810  [001] ...1   164.770794: afs_call: c=00000002 QUEUE u=3 o=12 sp=afs_deliver_to_call+0x449/0x72c
           kworker/1:2-1810  [001] ...1   164.770829: afs_call: c=00000002 PUT   u=2 o=12 sp=afs_process_async_call+0xdb/0x11e
           kworker/1:2-1810  [001] ...2   164.771084: rxrpc_abort: c=00000002 95786a88:00000008 s=0 a=1 e=1 K-1
           kworker/1:2-1810  [001] ...1   164.771461: rxrpc_tx_packet: c=00000002 e9f1a7a8:95786a88:00000008:09c5 00000002 00000000 04 00 ABORT CallAbort
           kworker/1:2-1810  [001] ...1   164.771466: afs_call: c=00000002 PUT   u=1 o=12 sp=SRXAFSCB_ProbeUuid+0xc1/0x106
      
      The abort generated in SRXAFSCB_ProbeUuid(), labelled "K-1", indicates that
      the local filesystem/cache manager didn't recognise the UUID as its own.
      
      Fixes: 2067b2b3 ("afs: Fix the CB.ProbeUuid service handler to reply correctly")
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      dde9f095
    • D
      afs: Fix some tracing details · 4636cf18
      David Howells 提交于
      Fix a couple of tracelines to indicate the usage count after the atomic op,
      not the usage count before it to be consistent with other afs and rxrpc
      trace lines.
      
      Change the wording of the afs_call_trace_work trace ID label from "WORK" to
      "QUEUE" to reflect the fact that it's queueing work, not doing work.
      
      Fixes: 341f741f ("afs: Refcount the afs_call struct")
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      4636cf18
    • D
      rxrpc: Fix sendmsg(MSG_WAITALL) handling · 498b5776
      David Howells 提交于
      Fix the handling of sendmsg() with MSG_WAITALL for userspace to round the
      timeout for when a signal occurs up to at least two jiffies as a 1 jiffy
      timeout may end up being effectively 0 if jiffies wraps at the wrong time.
      
      Fixes: bc5e3a54 ("rxrpc: Use MSG_WAITALL to tell sendmsg() to temporarily ignore signals")
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      498b5776
    • D
      rxrpc: Fix call interruptibility handling · e138aa7d
      David Howells 提交于
      Fix the interruptibility of kernel-initiated client calls so that they're
      either only interruptible when they're waiting for a call slot to come
      available or they're not interruptible at all.  Either way, they're not
      interruptible during transmission.
      
      This should help prevent StoreData calls from being interrupted when
      writeback is in progress.  It doesn't, however, handle interruption during
      the receive phase.
      
      Userspace-initiated calls are still interruptable.  After the signal has
      been handled, sendmsg() will return the amount of data copied out of the
      buffer and userspace can perform another sendmsg() call to continue
      transmission.
      
      Fixes: bc5e3a54 ("rxrpc: Use MSG_WAITALL to tell sendmsg() to temporarily ignore signals")
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      e138aa7d
    • D
      rxrpc: Abstract out the calculation of whether there's Tx space · 158fe666
      David Howells 提交于
      Abstract out the calculation of there being sufficient Tx buffer space.
      This is reproduced several times in the rxrpc sendmsg code.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      158fe666
  2. 12 3月, 2020 16 次提交
    • C
      net: mvmdio: avoid error message for optional IRQ · e1f550dc
      Chris Packham 提交于
      Per the dt-binding the interrupt is optional so use
      platform_get_irq_optional() instead of platform_get_irq(). Since
      commit 7723f4c5 ("driver core: platform: Add an error message to
      platform_get_irq*()") platform_get_irq() produces an error message
      
        orion-mdio f1072004.mdio: IRQ index 0 not found
      
      which is perfectly normal if one hasn't specified the optional property
      in the device tree.
      Signed-off-by: NChris Packham <chris.packham@alliedtelesis.co.nz>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e1f550dc
    • A
      net: dsa: mv88e6xxx: Add missing mask of ATU occupancy register · 012fc745
      Andrew Lunn 提交于
      Only the bottom 12 bits contain the ATU bin occupancy statistics. The
      upper bits need masking off.
      
      Fixes: e0c69ca7 ("net: dsa: mv88e6xxx: Add ATU occupancy via devlink resources")
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      012fc745
    • E
      net: memcg: fix lockdep splat in inet_csk_accept() · 06669ea3
      Eric Dumazet 提交于
      Locking newsk while still holding the listener lock triggered
      a lockdep splat [1]
      
      We can simply move the memcg code after we release the listener lock,
      as this can also help if multiple threads are sharing a common listener.
      
      Also fix a typo while reading socket sk_rmem_alloc.
      
      [1]
      WARNING: possible recursive locking detected
      5.6.0-rc3-syzkaller #0 Not tainted
      --------------------------------------------
      syz-executor598/9524 is trying to acquire lock:
      ffff88808b5b8b90 (sk_lock-AF_INET6){+.+.}, at: lock_sock include/net/sock.h:1541 [inline]
      ffff88808b5b8b90 (sk_lock-AF_INET6){+.+.}, at: inet_csk_accept+0x69f/0xd30 net/ipv4/inet_connection_sock.c:492
      
      but task is already holding lock:
      ffff88808b5b9590 (sk_lock-AF_INET6){+.+.}, at: lock_sock include/net/sock.h:1541 [inline]
      ffff88808b5b9590 (sk_lock-AF_INET6){+.+.}, at: inet_csk_accept+0x8d/0xd30 net/ipv4/inet_connection_sock.c:445
      
      other info that might help us debug this:
       Possible unsafe locking scenario:
      
             CPU0
             ----
        lock(sk_lock-AF_INET6);
        lock(sk_lock-AF_INET6);
      
       *** DEADLOCK ***
      
       May be due to missing lock nesting notation
      
      1 lock held by syz-executor598/9524:
       #0: ffff88808b5b9590 (sk_lock-AF_INET6){+.+.}, at: lock_sock include/net/sock.h:1541 [inline]
       #0: ffff88808b5b9590 (sk_lock-AF_INET6){+.+.}, at: inet_csk_accept+0x8d/0xd30 net/ipv4/inet_connection_sock.c:445
      
      stack backtrace:
      CPU: 0 PID: 9524 Comm: syz-executor598 Not tainted 5.6.0-rc3-syzkaller #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Call Trace:
       __dump_stack lib/dump_stack.c:77 [inline]
       dump_stack+0x188/0x20d lib/dump_stack.c:118
       print_deadlock_bug kernel/locking/lockdep.c:2370 [inline]
       check_deadlock kernel/locking/lockdep.c:2411 [inline]
       validate_chain kernel/locking/lockdep.c:2954 [inline]
       __lock_acquire.cold+0x114/0x288 kernel/locking/lockdep.c:3954
       lock_acquire+0x197/0x420 kernel/locking/lockdep.c:4484
       lock_sock_nested+0xc5/0x110 net/core/sock.c:2947
       lock_sock include/net/sock.h:1541 [inline]
       inet_csk_accept+0x69f/0xd30 net/ipv4/inet_connection_sock.c:492
       inet_accept+0xe9/0x7c0 net/ipv4/af_inet.c:734
       __sys_accept4_file+0x3ac/0x5b0 net/socket.c:1758
       __sys_accept4+0x53/0x90 net/socket.c:1809
       __do_sys_accept4 net/socket.c:1821 [inline]
       __se_sys_accept4 net/socket.c:1818 [inline]
       __x64_sys_accept4+0x93/0xf0 net/socket.c:1818
       do_syscall_64+0xf6/0x790 arch/x86/entry/common.c:294
       entry_SYSCALL_64_after_hwframe+0x49/0xbe
      RIP: 0033:0x4445c9
      Code: e8 0c 0d 03 00 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 eb 08 fc ff c3 66 2e 0f 1f 84 00 00 00 00
      RSP: 002b:00007ffc35b37608 EFLAGS: 00000246 ORIG_RAX: 0000000000000120
      RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00000000004445c9
      RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003
      RBP: 0000000000000000 R08: 0000000000306777 R09: 0000000000306777
      R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
      R13: 00000000004053d0 R14: 0000000000000000 R15: 0000000000000000
      
      Fixes: d752a498 ("net: memcg: late association of sock to memcg")
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Shakeel Butt <shakeelb@google.com>
      Reported-by: Nsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      06669ea3
    • D
      Merge branch 's390-qeth-fixes' · 5e72b237
      David S. Miller 提交于
      Julian Wiedmann says:
      
      ====================
      s390/qeth: fixes 2020-03-11
      
      please apply the following patch series for qeth to netdev's net tree.
      
      Just one fix to get the RX buffer pool resizing right, with two
      preparatory cleanups.
      This is on the larger side given where we are in the -rc cycle, but a
      big chunk of the delta is just refactoring to make the fix look nice.
      
      I intentionally split these off from yesterday's series. No objections
      if you'd rather punt them to net-next, the series should apply cleanly.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5e72b237
    • J
      s390/qeth: implement smarter resizing of the RX buffer pool · 5d4f7856
      Julian Wiedmann 提交于
      The RX buffer pool is allocated in qeth_alloc_qdio_queues().
      A subsequent pool resizing is then handled in a very simple way:
      first free the current pool, then allocate a new pool of the requested
      size.
      
      There's two ways where this can go wrong:
      1. if the resize action happens _before_ the initial pool was allocated,
         then a subsequent initialization will call qeth_alloc_qdio_queues()
         and fill the pool with a second(!) set of pages. We consume twice the
         planned amount of memory.
         This is easy to fix - just skip the resizing if the queues haven't
         been allocated yet.
      2. if the initial pool was created by qeth_alloc_qdio_queues() but a
         subsequent resizing fails, then the device has no(!) RX buffer pool.
         The next initialization will _not_ call qeth_alloc_qdio_queues(), and
         attempting to back the RX buffers with pages in
         qeth_init_qdio_queues() will fail.
         Not very difficult to fix either - instead of re-allocating the whole
         pool, just allocate/free as many entries to match the desired size.
      
      Fixes: 4a71df50 ("qeth: new qeth device driver")
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5d4f7856
    • J
      s390/qeth: refactor buffer pool code · 0f75e149
      Julian Wiedmann 提交于
      In preparation for a subsequent fix, split out helpers to allocate/free
      individual pool entries.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0f75e149
    • J
      s390/qeth: use page pointers to manage RX buffer pool · f81649df
      Julian Wiedmann 提交于
      The RX buffer elements are always backed with full pages, reflect this
      in the pointer type.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f81649df
    • P
      seg6: fix SRv6 L2 tunnels to use IANA-assigned protocol number · 26776253
      Paolo Lungaroni 提交于
      The Internet Assigned Numbers Authority (IANA) has recently assigned
      a protocol number value of 143 for Ethernet [1].
      
      Before this assignment, encapsulation mechanisms such as Segment Routing
      used the IPv6-NoNxt protocol number (59) to indicate that the encapsulated
      payload is an Ethernet frame.
      
      In this patch, we add the definition of the Ethernet protocol number to the
      kernel headers and update the SRv6 L2 tunnels to use it.
      
      [1] https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtmlSigned-off-by: NPaolo Lungaroni <paolo.lungaroni@cnit.it>
      Reviewed-by: NAndrea Mayer <andrea.mayer@uniroma2.it>
      Acked-by: NAhmed Abdelsalam <ahmed.abdelsalam@gssi.it>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      26776253
    • A
      net: dsa: Don't instantiate phylink for CPU/DSA ports unless needed · a20f9970
      Andrew Lunn 提交于
      By default, DSA drivers should configure CPU and DSA ports to their
      maximum speed. In many configurations this is sufficient to make the
      link work.
      
      In some cases it is necessary to configure the link to run slower,
      e.g. because of limitations of the SoC it is connected to. Or back to
      back PHYs are used and the PHY needs to be driven in order to
      establish link. In this case, phylink is used.
      
      Only instantiate phylink if it is required. If there is no PHY, or no
      fixed link properties, phylink can upset a link which works in the
      default configuration.
      
      Fixes: 0e279218 ("net: dsa: Use PHYLINK for the CPU/DSA ports")
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a20f9970
    • W
      net/packet: tpacket_rcv: do not increment ring index on drop · 46e4c421
      Willem de Bruijn 提交于
      In one error case, tpacket_rcv drops packets after incrementing the
      ring producer index.
      
      If this happens, it does not update tp_status to TP_STATUS_USER and
      thus the reader is stalled for an iteration of the ring, causing out
      of order arrival.
      
      The only such error path is when virtio_net_hdr_from_skb fails due
      to encountering an unknown GSO type.
      Signed-off-by: NWillem de Bruijn <willemb@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      46e4c421
    • D
      sxgbe: Fix off by one in samsung driver strncpy size arg · f3cc008b
      Dominik Czarnota 提交于
      This patch fixes an off-by-one error in strncpy size argument in
      drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c. The issue is that in:
      
              strncmp(opt, "eee_timer:", 6)
      
      the passed string literal: "eee_timer:" has 10 bytes (without the NULL
      byte) and the passed size argument is 6. As a result, the logic will
      also accept other, malformed strings, e.g. "eee_tiXXX:".
      
      This bug doesn't seem to have any security impact since its present in
      module's cmdline parsing code.
      Signed-off-by: NDominik Czarnota <dominik.b.czarnota@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f3cc008b
    • A
      net: caif: Add lockdep expression to RCU traversal primitive · f9fc28a8
      Amol Grover 提交于
      caifdevs->list is traversed using list_for_each_entry_rcu()
      outside an RCU read-side critical section but under the
      protection of rtnl_mutex. Hence, add the corresponding lockdep
      expression to silence the following false-positive warning:
      
      [   10.868467] =============================
      [   10.869082] WARNING: suspicious RCU usage
      [   10.869817] 5.6.0-rc1-00177-g06ec0a154aae4 #1 Not tainted
      [   10.870804] -----------------------------
      [   10.871557] net/caif/caif_dev.c:115 RCU-list traversed in non-reader section!!
      Reported-by: Nkernel test robot <lkp@intel.com>
      Signed-off-by: NAmol Grover <frextrite@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f9fc28a8
    • J
      MAINTAINERS: remove Sathya Perla as Emulex NIC maintainer · eecba79e
      Jakub Kicinski 提交于
      Remove Sathya Perla, sathya.perla@broadcom.com is bouncing.
      The driver has 3 more maintainers.
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      eecba79e
    • J
      net: fec: validate the new settings in fec_enet_set_coalesce() · ab14961d
      Jakub Kicinski 提交于
      fec_enet_set_coalesce() validates the previously set params
      and if they are within range proceeds to apply the new ones.
      The new ones, however, are not validated. This seems backwards,
      probably a copy-paste error?
      
      Compile tested only.
      
      Fixes: d851b47b ("net: fec: add interrupt coalescence feature support")
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      Acked-by: NFugang Duan <fugang.duan@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ab14961d
    • N
      dpaa_eth: Remove unnecessary boolean expression in dpaa_get_headroom · 7395f62d
      Nathan Chancellor 提交于
      Clang warns:
      
      drivers/net/ethernet/freescale/dpaa/dpaa_eth.c:2860:9: warning:
      converting the result of '?:' with integer constants to a boolean always
      evaluates to 'true' [-Wtautological-constant-compare]
              return DPAA_FD_DATA_ALIGNMENT ? ALIGN(headroom,
                     ^
      drivers/net/ethernet/freescale/dpaa/dpaa_eth.c:131:34: note: expanded
      from macro 'DPAA_FD_DATA_ALIGNMENT'
      \#define DPAA_FD_DATA_ALIGNMENT  (fman_has_errata_a050385() ? 64 : 16)
                                       ^
      1 warning generated.
      
      This was exposed by commit 3c68b8ff ("dpaa_eth: FMan erratum A050385
      workaround") even though it appears to have been an issue since the
      introductory commit 9ad1a374 ("dpaa_eth: add support for DPAA
      Ethernet") since DPAA_FD_DATA_ALIGNMENT has never been able to be zero.
      
      Just replace the whole boolean expression with the true branch, as it is
      always been true.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/928Signed-off-by: NNathan Chancellor <natechancellor@gmail.com>
      Reviewed-by: NMadalin Bucur <madalin.bucur@oss.nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7395f62d
    • D
      Merge tag 'mac80211-for-net-2020-03-11' of... · f2df8ce1
      David S. Miller 提交于
      Merge tag 'mac80211-for-net-2020-03-11' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
      
      Johannes Berg says:
      
      ====================
      A couple of fixes:
       * three netlink validation fixes
       * a mesh path selection fix
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f2df8ce1
  3. 11 3月, 2020 17 次提交
  4. 10 3月, 2020 2 次提交