1. 16 Jan, 2023 3 commits
  2. 10 Jan, 2023 7 commits
    • Felix Fietkau's avatar
      wifi: mac80211: fix MLO + AP_VLAN check · f216033d
      Felix Fietkau authored
      Instead of preventing adding AP_VLAN to MLO enabled APs, this check was
      preventing adding more than one 4-addr AP_VLAN regardless of the MLO status.
      Fix this by adding missing extra checks.
      
      Fixes: ae960ee9 ("wifi: mac80211: prevent VLANs on MLDs")
      Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
      Link: https://lore.kernel.org/r/20221214130326.37756-1-nbd@nbd.name
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      f216033d
    • Sriram R's avatar
      mac80211: Fix MLO address translation for multiple bss case · fa22b51a
      Sriram R authored
      When multiple interfaces are present in the local interface
      list, new skb copy is taken before rx processing except for
      the first interface. The address translation happens each
      time only on the original skb since the hdr pointer is not
      updated properly to the newly created skb.
      
      As a result frames start to drop in userspace when address
      based checks or search fails.
      Signed-off-by: default avatarSriram R <quic_srirrama@quicinc.com>
      Link: https://lore.kernel.org/r/20221208040050.25922-1-quic_srirrama@quicinc.comSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      fa22b51a
    • Aloka Dixit's avatar
      wifi: mac80211: reset multiple BSSID options in stop_ap() · 0eb38842
      Aloka Dixit authored
      Reset multiple BSSID options when all AP related configurations are
      reset in ieee80211_stop_ap().
      
      Stale values result in HWSIM test failures (e.g. p2p_group_cli_invalid),
      if run after 'he_ap_ema'.
      Reported-by: default avatarJouni Malinen <j@w1.fi>
      Signed-off-by: default avatarAloka Dixit <quic_alokad@quicinc.com>
      Link: https://lore.kernel.org/r/20221221185616.11514-1-quic_alokad@quicinc.com
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      0eb38842
    • Alexander Wetzel's avatar
      wifi: mac80211: Fix iTXQ AMPDU fragmentation handling · 592234e9
      Alexander Wetzel authored
      mac80211 must not enable aggregation wile transmitting a fragmented
      MPDU. Enforce that for mac80211 internal TX queues (iTXQs).
      Reported-by: default avatarkernel test robot <oliver.sang@intel.com>
      Link: https://lore.kernel.org/oe-lkp/202301021738.7cd3e6ae-oliver.sang@intel.comSigned-off-by: default avatarAlexander Wetzel <alexander@wetzel-home.de>
      Link: https://lore.kernel.org/r/20230106223141.98696-1-alexander@wetzel-home.de
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      592234e9
    • Alexander Wetzel's avatar
      wifi: mac80211: sdata can be NULL during AMPDU start · 69403bad
      Alexander Wetzel authored
      ieee80211_tx_ba_session_handle_start() may get NULL for sdata when a
      deauthentication is ongoing.
      
      Here a trace triggering the race with the hostapd test
      multi_ap_fronthaul_on_ap:
      
      (gdb) list *drv_ampdu_action+0x46
      0x8b16 is in drv_ampdu_action (net/mac80211/driver-ops.c:396).
      391             int ret = -EOPNOTSUPP;
      392
      393             might_sleep();
      394
      395             sdata = get_bss_sdata(sdata);
      396             if (!check_sdata_in_driver(sdata))
      397                     return -EIO;
      398
      399             trace_drv_ampdu_action(local, sdata, params);
      400
      
      wlan0: moving STA 02:00:00:00:03:00 to state 3
      wlan0: associated
      wlan0: deauthenticating from 02:00:00:00:03:00 by local choice (Reason: 3=DEAUTH_LEAVING)
      wlan3.sta1: Open BA session requested for 02:00:00:00:00:00 tid 0
      wlan3.sta1: dropped frame to 02:00:00:00:00:00 (unauthorized port)
      wlan0: moving STA 02:00:00:00:03:00 to state 2
      wlan0: moving STA 02:00:00:00:03:00 to state 1
      wlan0: Removed STA 02:00:00:00:03:00
      wlan0: Destroyed STA 02:00:00:00:03:00
      BUG: unable to handle page fault for address: fffffffffffffb48
      PGD 11814067 P4D 11814067 PUD 11816067 PMD 0
      Oops: 0000 [#1] PREEMPT SMP PTI
      CPU: 2 PID: 133397 Comm: kworker/u16:1 Tainted: G        W          6.1.0-rc8-wt+ #59
      Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.0-20220807_005459-localhost 04/01/2014
      Workqueue: phy3 ieee80211_ba_session_work [mac80211]
      RIP: 0010:drv_ampdu_action+0x46/0x280 [mac80211]
      Code: 53 48 89 f3 be 89 01 00 00 e8 d6 43 bf ef e8 21 46 81 f0 83 bb a0 1b 00 00 04 75 0e 48 8b 9b 28 0d 00 00 48 81 eb 10 0e 00 00 <8b> 93 58 09 00 00 f6 c2 20 0f 84 3b 01 00 00 8b 05 dd 1c 0f 00 85
      RSP: 0018:ffffc900025ebd20 EFLAGS: 00010287
      RAX: 0000000000000000 RBX: fffffffffffff1f0 RCX: ffff888102228240
      RDX: 0000000080000000 RSI: ffffffff918c5de0 RDI: ffff888102228b40
      RBP: ffffc900025ebd40 R08: 0000000000000001 R09: 0000000000000001
      R10: 0000000000000001 R11: 0000000000000000 R12: ffff888118c18ec0
      R13: 0000000000000000 R14: ffffc900025ebd60 R15: ffff888018b7efb8
      FS:  0000000000000000(0000) GS:ffff88817a600000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: fffffffffffffb48 CR3: 0000000105228006 CR4: 0000000000170ee0
      Call Trace:
       <TASK>
       ieee80211_tx_ba_session_handle_start+0xd0/0x190 [mac80211]
       ieee80211_ba_session_work+0xff/0x2e0 [mac80211]
       process_one_work+0x29f/0x620
       worker_thread+0x4d/0x3d0
       ? process_one_work+0x620/0x620
       kthread+0xfb/0x120
       ? kthread_complete_and_exit+0x20/0x20
       ret_from_fork+0x22/0x30
       </TASK>
      Signed-off-by: default avatarAlexander Wetzel <alexander@wetzel-home.de>
      Link: https://lore.kernel.org/r/20221230121850.218810-2-alexander@wetzel-home.de
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      69403bad
    • Alexander Wetzel's avatar
      wifi: mac80211: Proper mark iTXQs for resumption · 4444bc21
      Alexander Wetzel authored
      When a running wake_tx_queue() call is aborted due to a hw queue stop
      the corresponding iTXQ is not always correctly marked for resumption:
      wake_tx_push_queue() can stops the queue run without setting
      @IEEE80211_TXQ_STOP_NETIF_TX.
      
      Without the @IEEE80211_TXQ_STOP_NETIF_TX flag __ieee80211_wake_txqs()
      will not schedule a new queue run and remaining frames in the queue get
      stuck till another frame is queued to it.
      
      Fix the issue for all drivers - also the ones with custom wake_tx_queue
      callbacks - by moving the logic into ieee80211_tx_dequeue() and drop the
      redundant @txqs_stopped.
      
      @IEEE80211_TXQ_STOP_NETIF_TX is also renamed to @IEEE80211_TXQ_DIRTY to
      better describe the flag.
      
      Fixes: c850e31f ("wifi: mac80211: add internal handler for wake_tx_queue")
      Signed-off-by: default avatarAlexander Wetzel <alexander@wetzel-home.de>
      Link: https://lore.kernel.org/r/20221230121850.218810-1-alexander@wetzel-home.de
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      4444bc21
    • Felix Fietkau's avatar
      wifi: mac80211: fix initialization of rx->link and rx->link_sta · e66b7920
      Felix Fietkau authored
      There are some codepaths that do not initialize rx->link_sta properly. This
      causes a crash in places which assume that rx->link_sta is valid if rx->sta
      is valid.
      One known instance is triggered by __ieee80211_rx_h_amsdu being called from
      fast-rx. It results in a crash like this one:
      
       BUG: kernel NULL pointer dereference, address: 00000000000000a8
       #PF: supervisor write access in kernel mode
       #PF: error_code(0x0002) - not-present page PGD 0 P4D 0
       Oops: 0002 [#1] PREEMPT SMP PTI
       CPU: 1 PID: 506 Comm: mt76-usb-rx phy Tainted: G            E      6.1.0-debian64x+1.7 #3
       Hardware name: ZOTAC ZBOX-ID92/ZBOX-IQ01/ZBOX-ID92/ZBOX-IQ01, BIOS B220P007 05/21/2014
       RIP: 0010:ieee80211_deliver_skb+0x62/0x1f0 [mac80211]
       Code: 00 48 89 04 24 e8 9e a7 c3 df 89 c0 48 03 1c c5 a0 ea 39 a1 4c 01 6b 08 48 ff 03 48
             83 7d 28 00 74 11 48 8b 45 30 48 63 55 44 <48> 83 84 d0 a8 00 00 00 01 41 8b 86 c0
             11 00 00 8d 50 fd 83 fa 01
       RSP: 0018:ffff999040803b10 EFLAGS: 00010286
       RAX: 0000000000000000 RBX: ffffb9903f496480 RCX: 0000000000000000
       RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
       RBP: ffff999040803ce0 R08: 0000000000000000 R09: 0000000000000000
       R10: 0000000000000000 R11: 0000000000000000 R12: ffff8d21828ac900
       R13: 000000000000004a R14: ffff8d2198ed89c0 R15: ffff8d2198ed8000
       FS:  0000000000000000(0000) GS:ffff8d24afe80000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: 00000000000000a8 CR3: 0000000429810002 CR4: 00000000001706e0
       Call Trace:
        <TASK>
        __ieee80211_rx_h_amsdu+0x1b5/0x240 [mac80211]
        ? ieee80211_prepare_and_rx_handle+0xcdd/0x1320 [mac80211]
        ? __local_bh_enable_ip+0x3b/0xa0
        ieee80211_prepare_and_rx_handle+0xcdd/0x1320 [mac80211]
        ? prepare_transfer+0x109/0x1a0 [xhci_hcd]
        ieee80211_rx_list+0xa80/0xda0 [mac80211]
        mt76_rx_complete+0x207/0x2e0 [mt76]
        mt76_rx_poll_complete+0x357/0x5a0 [mt76]
        mt76u_rx_worker+0x4f5/0x600 [mt76_usb]
        ? mt76_get_min_avg_rssi+0x140/0x140 [mt76]
        __mt76_worker_fn+0x50/0x80 [mt76]
        kthread+0xed/0x120
        ? kthread_complete_and_exit+0x20/0x20
        ret_from_fork+0x22/0x30
      
      Since the initialization of rx->link and rx->link_sta is rather convoluted
      and duplicated in many places, clean it up by using a helper function to
      set it.
      
      Fixes: ccdde7c7 ("wifi: mac80211: properly implement MLO key handling")
      Fixes: b320d6c4 ("wifi: mac80211: use correct rx link_sta instead of default")
      Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
      Link: https://lore.kernel.org/r/20221230200747.19040-1-nbd@nbd.name
      [remove unnecessary rx->sta->sta.mlo check]
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      e66b7920
  3. 09 Jan, 2023 7 commits
  4. 07 Jan, 2023 3 commits
    • David S. Miller's avatar
      Merge tag 'rxrpc-fixes-20230107' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs · 571f3dd0
      David S. Miller authored
      David Howells says:
      
      ====================
      rxrpc: Fix race between call connection, data transmit and call disconnect
      
      Here are patches to fix an oops[1] caused by a race between call
      connection, initial packet transmission and call disconnection which
      results in something like:
      
              kernel BUG at net/rxrpc/peer_object.c:413!
      
      when the syzbot test is run.  The problem is that the connection procedure
      is effectively split across two threads and can get expanded by taking an
      interrupt, thereby adding the call to the peer error distribution list
      *after* it has been disconnected (say by the rxrpc socket shutting down).
      
      The easiest solution is to look at the fourth set of I/O thread
      conversion/SACK table expansion patches that didn't get applied[2] and take
      from it those patches that move call connection and disconnection into the
      I/O thread.  Moving these things into the I/O thread means that the
      sequencing is managed by all being done in the same thread - and the race
      can no longer happen.
      
      This is preferable to introducing an extra lock as adding an extra lock
      would make the I/O thread have to wait for the app thread in yet another
      place.
      
      The changes can be considered as a number of logical parts:
      
       (1) Move all of the call state changes into the I/O thread.
      
       (2) Make client connection ID space per-local endpoint so that the I/O
           thread doesn't need locks to access it.
      
       (3) Move actual abort generation into the I/O thread and clean it up.  If
           sendmsg or recvmsg want to cause an abort, they have to delegate it.
      
       (4) Offload the setting up of the security context on a connection to the
           thread of one of the apps that's starting a call.  We don't want to be
           doing any sort of crypto in the I/O thread.
      
       (5) Connect calls (ie. assign them to channel slots on connections) in the
           I/O thread.  Calls are set up by sendmsg/kafs and passed to the I/O
           thread to connect.  Connections are allocated in the I/O thread after
           this.
      
       (6) Disconnect calls in the I/O thread.
      
      I've also added a patch for an unrelated bug that cropped up during
      testing, whereby a race can occur between an incoming call and socket
      shutdown.
      
      Note that whilst this fixes the original syzbot bug, another bug may get
      triggered if this one is fixed:
      
              INFO: rcu detected stall in corrupted
              rcu: INFO: rcu_preempt detected expedited stalls on CPUs/tasks: { P5792 } 2657 jiffies s: 2825 root: 0x0/T
              rcu: blocking rcu_node structures (internal RCU debug):
      
      It doesn't look this should be anything to do with rxrpc, though, as I've
      tested an additional patch[3] that removes practically all the RCU usage
      from rxrpc and it still occurs.  It seems likely that it is being caused by
      something in the tunnelling setup that the syzbot test does, but there's
      not enough info to go on.  It also seems unlikely to be anything to do with
      the afs driver as the test doesn't use that.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      571f3dd0
    • David Howells's avatar
      rxrpc: Fix incoming call setup race · 42f229c3
      David Howells authored
      An incoming call can race with rxrpc socket destruction, leading to a
      leaked call.  This may result in an oops when the call timer eventually
      expires:
      
         BUG: kernel NULL pointer dereference, address: 0000000000000874
         RIP: 0010:_raw_spin_lock_irqsave+0x2a/0x50
         Call Trace:
          <IRQ>
          try_to_wake_up+0x59/0x550
          ? __local_bh_enable_ip+0x37/0x80
          ? rxrpc_poke_call+0x52/0x110 [rxrpc]
          ? rxrpc_poke_call+0x110/0x110 [rxrpc]
          ? rxrpc_poke_call+0x110/0x110 [rxrpc]
          call_timer_fn+0x24/0x120
      
      with a warning in the kernel log looking something like:
      
         rxrpc: Call 00000000ba5e571a still in use (1,SvAwtACK,1061d,0)!
      
      incurred during rmmod of rxrpc.  The 1061d is the call flags:
      
         RECVMSG_READ_ALL, RX_HEARD, BEGAN_RX_TIMER, RX_LAST, EXPOSED,
         IS_SERVICE, RELEASED
      
      but no DISCONNECTED flag (0x800), so it's an incoming (service) call and
      it's still connected.
      
      The race appears to be that:
      
       (1) rxrpc_new_incoming_call() consults the service struct, checks sk_state
           and allocates a call - then pauses, possibly for an interrupt.
      
       (2) rxrpc_release_sock() sets RXRPC_CLOSE, nulls the service pointer,
           discards the prealloc and releases all calls attached to the socket.
      
       (3) rxrpc_new_incoming_call() resumes, launching the new call, including
           its timer and attaching it to the socket.
      
      Fix this by read-locking local->services_lock to access the AF_RXRPC socket
      providing the service rather than RCU in rxrpc_new_incoming_call().
      There's no real need to use RCU here as local->services_lock is only
      write-locked by the socket side in two places: when binding and when
      shutting down.
      
      Fixes: 5e6ef4f1 ("rxrpc: Make the I/O thread take over the call and local processor work")
      Reported-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: linux-afs@lists.infradead.org
      42f229c3
    • Angela Czubak's avatar
      octeontx2-af: Fix LMAC config in cgx_lmac_rx_tx_enable · b4e9b876
      Angela Czubak authored
      PF netdev can request AF to enable or disable reception and transmission
      on assigned CGX::LMAC. The current code instead of disabling or enabling
      'reception and transmission' also disables/enable the LMAC. This patch
      fixes this issue.
      
      Fixes: 1435f66a ("octeontx2-af: CGX Rx/Tx enable/disable mbox handlers")
      Signed-off-by: default avatarAngela Czubak <aczubak@marvell.com>
      Signed-off-by: default avatarHariprasad Kelam <hkelam@marvell.com>
      Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      Link: https://lore.kernel.org/r/20230105160107.17638-1-hkelam@marvell.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b4e9b876
  5. 06 Jan, 2023 20 commits
    • Tung Nguyen's avatar
      tipc: fix unexpected link reset due to discovery messages · c244c092
      Tung Nguyen authored
      This unexpected behavior is observed:
      
      node 1                    | node 2
      ------                    | ------
      link is established       | link is established
      reboot                    | link is reset
      up                        | send discovery message
      receive discovery message |
      link is established       | link is established
      send discovery message    |
                                | receive discovery message
                                | link is reset (unexpected)
                                | send reset message
      link is reset             |
      
      It is due to delayed re-discovery as described in function
      tipc_node_check_dest(): "this link endpoint has already reset
      and re-established contact with the peer, before receiving a
      discovery message from that node."
      
      However, commit 598411d7 has changed the condition for calling
      tipc_node_link_down() which was the acceptance of new media address.
      
      This commit fixes this by restoring the old and correct behavior.
      
      Fixes: 598411d7 ("tipc: make resetting of links non-atomic")
      Acked-by: default avatarJon Maloy <jmaloy@redhat.com>
      Signed-off-by: default avatarTung Nguyen <tung.q.nguyen@dektech.com.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c244c092
    • David Howells's avatar
      rxrpc: Move client call connection to the I/O thread · 9d35d880
      David Howells authored
      Move the connection setup of client calls to the I/O thread so that a whole
      load of locking and barrierage can be eliminated.  This necessitates the
      app thread waiting for connection to complete before it can begin
      encrypting data.
      
      This also completes the fix for a race that exists between call connection
      and call disconnection whereby the data transmission code adds the call to
      the peer error distribution list after the call has been disconnected (say
      by the rxrpc socket getting closed).
      
      The fix is to complete the process of moving call connection, data
      transmission and call disconnection into the I/O thread and thus forcibly
      serialising them.
      
      Note that the issue may predate the overhaul to an I/O thread model that
      were included in the merge window for v6.2, but the timing is very much
      changed by the change given below.
      
      Fixes: cf37b598 ("rxrpc: Move DATA transmission into call processor work item")
      Reported-by: syzbot+c22650d2844392afdcfd@syzkaller.appspotmail.com
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      9d35d880
    • David Howells's avatar
      rxrpc: Move the client conn cache management to the I/O thread · 0d6bf319
      David Howells authored
      Move the management of the client connection cache to the I/O thread rather
      than managing it from the namespace as an aggregate across all the local
      endpoints within the namespace.
      
      This will allow a load of locking to be got rid of in a future patch as
      only the I/O thread will be looking at the this.
      
      The downside is that the total number of cached connections on the system
      can get higher because the limit is now per-local rather than per-netns.
      We can, however, keep the number of client conns in use across the entire
      netfs and use that to reduce the expiration time of idle connection.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      0d6bf319
    • David Howells's avatar
      rxrpc: Remove call->state_lock · 96b4059f
      David Howells authored
      All the setters of call->state are now in the I/O thread and thus the state
      lock is now unnecessary.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      96b4059f
    • David Howells's avatar
      rxrpc: Move call state changes from recvmsg to I/O thread · 93368b6b
      David Howells authored
      Move the call state changes that are made in rxrpc_recvmsg() to the I/O
      thread.  This means that, thenceforth, only the I/O thread does this and
      the call state lock can be removed.
      
      This requires the Rx phase to be ended when the last packet is received,
      not when it is processed.
      
      Since this now changes the rxrpc call state to SUCCEEDED before we've
      consumed all the data from it, rxrpc_kernel_check_life() mustn't say the
      call is dead until the recvmsg queue is empty (unless the call has failed).
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      93368b6b
    • David Howells's avatar
      rxrpc: Move call state changes from sendmsg to I/O thread · 2d689424
      David Howells authored
      Move all the call state changes that are made in rxrpc_sendmsg() to the I/O
      thread.  This is a step towards removing the call state lock.
      
      This requires the switch to the RXRPC_CALL_CLIENT_AWAIT_REPLY and
      RXRPC_CALL_SERVER_SEND_REPLY states to be done when the last packet is
      decanted from ->tx_sendmsg to ->tx_buffer in the I/O thread, not when it is
      added to ->tx_sendmsg by sendmsg().
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      2d689424
    • David Howells's avatar
      rxrpc: Wrap accesses to get call state to put the barrier in one place · d41b3f5b
      David Howells authored
      Wrap accesses to get the state of a call from outside of the I/O thread in
      a single place so that the barrier needed to order wrt the error code and
      abort code is in just that place.
      
      Also use a barrier when setting the call state and again when reading the
      call state such that the auxiliary completion info (error code, abort code)
      can be read without taking a read lock on the call state lock.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      d41b3f5b
    • David Howells's avatar
      rxrpc: Split out the call state changing functions into their own file · 0b9bb322
      David Howells authored
      Split out the functions that change the state of an rxrpc call into their
      own file.  The idea being to remove anything to do with changing the state
      of a call directly from the rxrpc sendmsg() and recvmsg() paths and have
      all that done in the I/O thread only, with the ultimate aim of removing the
      state lock entirely.  Moving the code out of sendmsg.c and recvmsg.c makes
      that easier to manage.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      0b9bb322
    • David Howells's avatar
      rxrpc: Set up a connection bundle from a call, not rxrpc_conn_parameters · 1bab27af
      David Howells authored
      Use the information now stored in struct rxrpc_call to configure the
      connection bundle and thence the connection, rather than using the
      rxrpc_conn_parameters struct.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      1bab27af
    • David Howells's avatar
      rxrpc: Offload the completion of service conn security to the I/O thread · 2953d3b8
      David Howells authored
      Offload the completion of the challenge/response cycle on a service
      connection to the I/O thread.  After the RESPONSE packet has been
      successfully decrypted and verified by the work queue, offloading the
      changing of the call states to the I/O thread makes iteration over the
      conn's channel list simpler.
      
      Do this by marking the RESPONSE skbuff and putting it onto the receive
      queue for the I/O thread to collect.  We put it on the front of the queue
      as we've already received the packet for it.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      2953d3b8
    • David Howells's avatar
      rxrpc: Make the set of connection IDs per local endpoint · f06cb291
      David Howells authored
      Make the set of connection IDs per local endpoint so that endpoints don't
      cause each other's connections to get dismissed.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      f06cb291
    • David Howells's avatar
      rxrpc: Tidy up abort generation infrastructure · 57af281e
      David Howells authored
      Tidy up the abort generation infrastructure in the following ways:
      
       (1) Create an enum and string mapping table to list the reasons an abort
           might be generated in tracing.
      
       (2) Replace the 3-char string with the values from (1) in the places that
           use that to log the abort source.  This gets rid of a memcpy() in the
           tracepoint.
      
       (3) Subsume the rxrpc_rx_eproto tracepoint with the rxrpc_abort tracepoint
           and use values from (1) to indicate the trace reason.
      
       (4) Always make a call to an abort function at the point of the abort
           rather than stashing the values into variables and using goto to get
           to a place where it reported.  The C optimiser will collapse the calls
           together as appropriate.  The abort functions return a value that can
           be returned directly if appropriate.
      
      Note that this extends into afs also at the points where that generates an
      abort.  To aid with this, the afs sources need to #define
      RXRPC_TRACE_ONLY_DEFINE_ENUMS before including the rxrpc tracing header
      because they don't have access to the rxrpc internal structures that some
      of the tracepoints make use of.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      57af281e
    • David Howells's avatar
      rxrpc: Clean up connection abort · a00ce28b
      David Howells authored
      Clean up connection abort, using the connection state_lock to gate access
      to change that state, and use an rxrpc_call_completion value to indicate
      the difference between local and remote aborts as these can be pasted
      directly into the call state.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      a00ce28b
    • David Howells's avatar
      rxrpc: Implement a mechanism to send an event notification to a connection · f2cce89a
      David Howells authored
      Provide a means by which an event notification can be sent to a connection
      through such that the I/O thread can pick it up and handle it rather than
      doing it in a separate workqueue.
      
      This is then used to move the deferred final ACK of a call into the I/O
      thread rather than a separate work queue as part of the drive to do all
      transmission from the I/O thread.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      f2cce89a
    • David Howells's avatar
      rxrpc: Only disconnect calls in the I/O thread · 03fc55ad
      David Howells authored
      Only perform call disconnection in the I/O thread to reduce the locking
      requirement.
      
      This is the first part of a fix for a race that exists between call
      connection and call disconnection whereby the data transmission code adds
      the call to the peer error distribution list after the call has been
      disconnected (say by the rxrpc socket getting closed).
      
      The fix is to complete the process of moving call connection, data
      transmission and call disconnection into the I/O thread and thus forcibly
      serialising them.
      
      Note that the issue may predate the overhaul to an I/O thread model that
      were included in the merge window for v6.2, but the timing is very much
      changed by the change given below.
      
      Fixes: cf37b598 ("rxrpc: Move DATA transmission into call processor work item")
      Reported-by: syzbot+c22650d2844392afdcfd@syzkaller.appspotmail.com
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      03fc55ad
    • David Howells's avatar
      rxrpc: Only set/transmit aborts in the I/O thread · a343b174
      David Howells authored
      Only set the abort call completion state in the I/O thread and only
      transmit ABORT packets from there.  rxrpc_abort_call() can then be made to
      actually send the packet.
      
      Further, ABORT packets should only be sent if the call has been exposed to
      the network (ie. at least one attempted DATA transmission has occurred for
      it).
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      a343b174
    • David Howells's avatar
      rxrpc: Separate call retransmission from other conn events · 30df927b
      David Howells authored
      Call the rxrpc_conn_retransmit_call() directly from rxrpc_input_packet()
      rather than calling it via connection event handling.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      30df927b
    • David Howells's avatar
      rxrpc: Make the local endpoint hold a ref on a connected call · 5040011d
      David Howells authored
      Make the local endpoint and it's I/O thread hold a reference on a connected
      call until that call is disconnected.  Without this, we're reliant on
      either the AF_RXRPC socket to hold a ref (which is dropped when the call is
      released) or a queued work item to hold a ref (the work item is being
      replaced with the I/O thread).
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      5040011d
    • David Howells's avatar
      rxrpc: Stash the network namespace pointer in rxrpc_local · 8a758d98
      David Howells authored
      Stash the network namespace pointer in the rxrpc_local struct in addition
      to a pointer to the rxrpc-specific net namespace info.  Use this to remove
      some places where the socket is passed as a parameter.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      8a758d98
    • Hui Wang's avatar
      net: usb: cdc_ether: add support for Thales Cinterion PLS62-W modem · eea8ce81
      Hui Wang authored
      This modem has 7 interfaces, 5 of them are serial interfaces and are
      driven by cdc_acm, while 2 of them are wwan interfaces and are driven
      by cdc_ether:
      If 0: Abstract (modem)
      If 1: Abstract (modem)
      If 2: Abstract (modem)
      If 3: Abstract (modem)
      If 4: Abstract (modem)
      If 5: Ethernet Networking
      If 6: Ethernet Networking
      
      Without this change, the 2 network interfaces will be named to usb0
      and usb1, our QA think the names are confusing and filed a bug on it.
      
      After applying this change, the name will be wwan0 and wwan1, and
      they could work well with modem manager.
      Signed-off-by: default avatarHui Wang <hui.wang@canonical.com>
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Link: https://lore.kernel.org/r/20230105034249.10433-1-hui.wang@canonical.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      eea8ce81