Skip to content
  1. Jul 25, 2021
    • Zhang Changzhong's avatar
      can: j1939: j1939_xtp_rx_dat_one(): fix rxtimer value between consecutive TP.DT to 750ms · c6eea1c8
      Zhang Changzhong authored
      For receive side, the max time interval between two consecutive TP.DT
      should be 750ms.
      
      Fixes: 9d71dd0c
      
       ("can: add support of SAE J1939 protocol")
      Link: https://lore.kernel.org/r/1625569210-47506-1-git-send-email-zhangchangzhong@huawei.com
      Cc: linux-stable <stable@vger.kernel.org>
      Signed-off-by: default avatarZhang Changzhong <zhangchangzhong@huawei.com>
      Acked-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      c6eea1c8
    • Oleksij Rempel's avatar
      can: j1939: j1939_session_deactivate(): clarify lifetime of session object · 0c71437d
      Oleksij Rempel authored
      The j1939_session_deactivate() is decrementing the session ref-count and
      potentially can free() the session. This would cause use-after-free
      situation.
      
      However, the code calling j1939_session_deactivate() does always hold
      another reference to the session, so that it would not be free()ed in
      this code path.
      
      This patch adds a comment to make this clear and a WARN_ON, to ensure
      that future changes will not violate this requirement. Further this
      patch avoids dereferencing the session pointer as a precaution to avoid
      use-after-free if the session is actually free()ed.
      
      Fixes: 9d71dd0c
      
       ("can: add support of SAE J1939 protocol")
      Link: https://lore.kernel.org/r/20210714111602.24021-1-o.rempel@pengutronix.de
      Reported-by: default avatarXiaochen Zou <xzou017@ucr.edu>
      Signed-off-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      0c71437d
    • Ziyang Xuan's avatar
      can: raw: raw_setsockopt(): fix raw_rcv panic for sock UAF · 54f93336
      Ziyang Xuan authored
      We get a bug during ltp can_filter test as following.
      
      ===========================================
      [60919.264984] BUG: unable to handle kernel NULL pointer dereference at 0000000000000010
      [60919.265223] PGD 8000003dda726067 P4D 8000003dda726067 PUD 3dda727067 PMD 0
      [60919.265443] Oops: 0000 [#1] SMP PTI
      [60919.265550] CPU: 30 PID: 3638365 Comm: can_filter Kdump: loaded Tainted: G        W         4.19.90+ #1
      [60919.266068] RIP: 0010:selinux_socket_sock_rcv_skb+0x3e/0x200
      [60919.293289] RSP: 0018:ffff8d53bfc03cf8 EFLAGS: 00010246
      [60919.307140] RAX: 0000000000000000 RBX: 000000000000001d RCX: 0000000000000007
      [60919.320756] RDX: 0000000000000001 RSI: ffff8d5104a8ed00 RDI: ffff8d53bfc03d30
      [60919.334319] RBP: ffff8d9338056800 R08: ffff8d53bfc29d80 R09: 0000000000000001
      [60919.347969] R10: ffff8d53bfc03ec0 R11: ffffb8526ef47c98 R12: ffff8d53bfc03d30
      [60919.350320] perf: interrupt took too long (3063 > 2500), lowering kernel.perf_event_max_sample_rate to 65000
      [60919.361148] R13: 0000000000000001 R14: ffff8d53bcf90000 R15: 0000000000000000
      [60919.361151] FS:  00007fb78b6b3600(0000) GS:ffff8d53bfc00000(0000) knlGS:0000000000000000
      [60919.400812] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [60919.413730] CR2: 0000000000000010 CR3: 0000003e3f784006 CR4: 00000000007606e0
      [60919.426479] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [60919.439339] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [60919.451608] PKRU: 55555554
      [60919.463622] Call Trace:
      [60919.475617]  <IRQ>
      [60919.487122]  ? update_load_avg+0x89/0x5d0
      [60919.498478]  ? update_load_avg+0x89/0x5d0
      [60919.509822]  ? account_entity_enqueue+0xc5/0xf0
      [60919.520709]  security_sock_rcv_skb+0x2a/0x40
      [60919.531413]  sk_filter_trim_cap+0x47/0x1b0
      [60919.542178]  ? kmem_cache_alloc+0x38/0x1b0
      [60919.552444]  sock_queue_rcv_skb+0x17/0x30
      [60919.562477]  raw_rcv+0x110/0x190 [can_raw]
      [60919.572539]  can_rcv_filter+0xbc/0x1b0 [can]
      [60919.582173]  can_receive+0x6b/0xb0 [can]
      [60919.591595]  can_rcv+0x31/0x70 [can]
      [60919.600783]  __netif_receive_skb_one_core+0x5a/0x80
      [60919.609864]  process_backlog+0x9b/0x150
      [60919.618691]  net_rx_action+0x156/0x400
      [60919.627310]  ? sched_clock_cpu+0xc/0xa0
      [60919.635714]  __do_softirq+0xe8/0x2e9
      [60919.644161]  do_softirq_own_stack+0x2a/0x40
      [60919.652154]  </IRQ>
      [60919.659899]  do_softirq.part.17+0x4f/0x60
      [60919.667475]  __local_bh_enable_ip+0x60/0x70
      [60919.675089]  __dev_queue_xmit+0x539/0x920
      [60919.682267]  ? finish_wait+0x80/0x80
      [60919.689218]  ? finish_wait+0x80/0x80
      [60919.695886]  ? sock_alloc_send_pskb+0x211/0x230
      [60919.702395]  ? can_send+0xe5/0x1f0 [can]
      [60919.708882]  can_send+0xe5/0x1f0 [can]
      [60919.715037]  raw_sendmsg+0x16d/0x268 [can_raw]
      
      It's because raw_setsockopt() concurrently with
      unregister_netdevice_many(). Concurrent scenario as following.
      
      	cpu0						cpu1
      raw_bind
      raw_setsockopt					unregister_netdevice_many
      						unlist_netdevice
      dev_get_by_index				raw_notifier
      raw_enable_filters				......
      can_rx_register
      can_rcv_list_find(..., net->can.rx_alldev_list)
      
      ......
      
      sock_close
      raw_release(sock_a)
      
      ......
      
      can_receive
      can_rcv_filter(net->can.rx_alldev_list, ...)
      raw_rcv(skb, sock_a)
      BUG
      
      After unlist_netdevice(), dev_get_by_index() return NULL in
      raw_setsockopt(). Function raw_enable_filters() will add sock
      and can_filter to net->can.rx_alldev_list. Then the sock is closed.
      Followed by, we sock_sendmsg() to a new vcan device use the same
      can_filter. Protocol stack match the old receiver whose sock has
      been released on net->can.rx_alldev_list in can_rcv_filter().
      Function raw_rcv() uses the freed sock. UAF BUG is triggered.
      
      We can find that the key issue is that net_device has not been
      protected in raw_setsockopt(). Use rtnl_lock to protect net_device
      in raw_setsockopt().
      
      Fixes: c18ce101
      
       ("[CAN]: Add raw protocol")
      Link: https://lore.kernel.org/r/20210722070819.1048263-1-william.xuanziyang@huawei.com
      Cc: linux-stable <stable@vger.kernel.org>
      Signed-off-by: default avatarZiyang Xuan <william.xuanziyang@huawei.com>
      Acked-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      54f93336
  2. Jul 24, 2021
  3. Jul 23, 2021
    • Kangmin Park's avatar
      ipv6: decrease hop limit counter in ip6_forward() · 46c7655f
      Kangmin Park authored
      
      
      Decrease hop limit counter when deliver skb to ndp proxy.
      
      Signed-off-by: default avatarKangmin Park <l4stpr0gr4m@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      46c7655f
    • Gilad Naaman's avatar
      net: Set true network header for ECN decapsulation · 227adfb2
      Gilad Naaman authored
      In cases where the header straight after the tunnel header was
      another ethernet header (TEB), instead of the network header,
      the ECN decapsulation code would treat the ethernet header as if
      it was an IP header, resulting in mishandling and possible
      wrong drops or corruption of the IP header.
      
      In this case, ECT(1) is sent, so IP_ECN_decapsulate tries to copy it to the
      inner IPv4 header, and correct its checksum.
      
      The offset of the ECT bits in an IPv4 header corresponds to the
      lower 2 bits of the second octet of the destination MAC address
      in the ethernet header.
      The IPv4 checksum corresponds to end of the source address.
      
      In order to reproduce:
      
          $ ip netns add A
          $ ip netns add B
          $ ip -n A link add _v0 type veth peer name _v1 netns B
          $ ip -n A link set _v0 up
          $ ip -n A addr add dev _v0 10.254.3.1/24
          $ ip -n A route add default dev _v0 scope global
          $ ip -n B link set _v1 up
          $ ip -n B addr add dev _v1 10.254.1.6/24
          $ ip -n B route add default dev _v1 scope global
          $ ip -n B link add gre1 type gretap local 10.254.1.6 remote 10.254.3.1 key 0x49000000
          $ ip -n B link set gre1 up
      
          # Now send an IPv4/GRE/Eth/IPv4 frame where the outer header has ECT(1),
          # and the inner header has no ECT bits set:
      
          $ cat send_pkt.py
              #!/usr/bin/env python3
              from scapy.all import *
      
              pkt = IP(b'E\x01\x00\xa7\x00\x00\x00\x00@/`%\n\xfe\x03\x01\n\xfe\x01\x06 \x00eXI\x00'
                       b'\x00\x00\x18\xbe\x92\xa0\xee&\x18\xb0\x92\xa0l&\x08\x00E\x00\x00}\x8b\x85'
                       b'@\x00\x01\x01\xe4\xf2\x82\x82\x82\x01\x82\x82\x82\x02\x08\x00d\x11\xa6\xeb'
                       b'3\x1e\x1e\\xf3\\xf7`\x00\x00\x00\x00ZN\x00\x00\x00\x00\x00\x00\x10\x11\x12'
                       b'\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./01234'
                       b'56789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ')
      
              send(pkt)
          $ sudo ip netns exec B tcpdump -neqlllvi gre1 icmp & ; sleep 1
          $ sudo ip netns exec A python3 send_pkt.py
      
      In the original packet, the source/destinatio MAC addresses are
      dst=18:be:92:a0:ee:26 src=18:b0:92:a0:6c:26
      
      In the received packet, they are
      dst=18:bd:92:a0:ee:26 src=18:b0:92:a0:6c:27
      
      Thanks to Lahav Schlesinger <lschlesinger@drivenets.com> and Isaac Garzon <isaac@speed.io>
      for helping me pinpoint the origin.
      
      Fixes: b7237487
      
       ("tunnel: Propagate ECT(1) when decapsulating as recommended by RFC6040")
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
      Cc: David Ahern <dsahern@kernel.org>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Toke Høiland-Jørgensen <toke@redhat.com>
      Signed-off-by: default avatarGilad Naaman <gnaaman@drivenets.com>
      Acked-by: default avatarToke Høiland-Jørgensen <toke@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      227adfb2
    • Hoang Le's avatar
      tipc: fix sleeping in tipc accept routine · d237a7f1
      Hoang Le authored
      The release_sock() is blocking function, it would change the state
      after sleeping. In order to evaluate the stated condition outside
      the socket lock context, switch to use wait_woken() instead.
      
      Fixes: 6398e23c
      
       ("tipc: standardize accept routine")
      Acked-by: default avatarJon Maloy <jmaloy@redhat.com>
      Signed-off-by: default avatarHoang Le <hoang.h.le@dektech.com.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d237a7f1
    • Xin Long's avatar
      tipc: fix implicit-connect for SYN+ · f8dd60de
      Xin Long authored
      For implicit-connect, when it's either SYN- or SYN+, an ACK should
      be sent back to the client immediately. It's not appropriate for
      the client to enter established state only after receiving data
      from the server.
      
      On client side, after the SYN is sent out, tipc_wait_for_connect()
      should be called to wait for the ACK if timeout is set.
      
      This patch also restricts __tipc_sendstream() to call __sendmsg()
      only when it's in TIPC_OPEN state, so that the client can program
      in a single loop doing both connecting and data sending like:
      
        for (...)
            sendmsg(dest, buf);
      
      This makes the implicit-connect more implicit.
      
      Fixes: b97bf3fd
      
       ("[TIPC] Initial merge")
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Acked-by: default avatarJon Maloy <jmaloy@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f8dd60de
    • Sunil Goutham's avatar
      octeontx2-af: Remove unnecessary devm_kfree · d72e91ef
      Sunil Goutham authored
      Remove devm_kfree of memory where VLAN entry to RVU PF mapping
      info is saved. This will be freed anyway at driver exit.
      Having this could result in warning from devm_kfree() if
      the memory is not allocated due to errors in rvu_nix_block_init()
      before nix_setup_txvlan().
      
      Fixes: 9a946def
      
       ("octeontx2-af: Modify nix_vtag_cfg mailbox to support TX VTAG entries")
      Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d72e91ef
    • Jedrzej Jagielski's avatar
      i40e: Fix log TC creation failure when max num of queues is exceeded · ea52faae
      Jedrzej Jagielski authored
      Fix missing failed message if driver does not have enough queues to
      complete TC command. Without this fix no message is displayed in dmesg.
      
      Fixes: a9ce82f7
      
       ("i40e: Enable 'channel' mode in mqprio for TC configs")
      Signed-off-by: default avatarGrzegorz Szczurek <grzegorzx.szczurek@intel.com>
      Signed-off-by: default avatarJedrzej Jagielski <jedrzej.jagielski@intel.com>
      Tested-by: default avatarImam Hassan Reza Biswas <imam.hassan.reza.biswas@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      ea52faae
    • Jedrzej Jagielski's avatar
      i40e: Fix queue-to-TC mapping on Tx · 89ec1f08
      Jedrzej Jagielski authored
      In SW DCB mode the packets sent receive incorrect UP tags. They are
      constructed correctly and put into tx_ring, but UP is later remapped by
      HW on the basis of TCTUPR register contents according to Tx queue
      selected, and BW used is consistent with the new UP values. This is
      caused by Tx queue selection in kernel not taking into account DCB
      configuration. This patch fixes the issue by implementing the
      ndo_select_queue NDO callback.
      
      Fixes: fd0a05ce
      
       ("i40e: transmit, receive, and NAPI")
      Signed-off-by: default avatarArkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
      Signed-off-by: default avatarJedrzej Jagielski <jedrzej.jagielski@intel.com>
      Tested-by: default avatarImam Hassan Reza Biswas <imam.hassan.reza.biswas@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      89ec1f08
    • Lukasz Cieplicki's avatar
      i40e: Add additional info to PHY type error · dc614c46
      Lukasz Cieplicki authored
      In case of PHY type error occurs, the message was too generic.
      Add additional info to PHY type error indicating that it can be
      wrong cable connected.
      
      Fixes: 124ed15b
      
       ("i40e: Add dual speed module support")
      Signed-off-by: default avatarLukasz Cieplicki <lukaszx.cieplicki@intel.com>
      Signed-off-by: default avatarMichal Maloszewski <michal.maloszewski@intel.com>
      Tested-by: default avatarTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      dc614c46
    • Arkadiusz Kubalewski's avatar
      i40e: Fix firmware LLDP agent related warning · 71d6fdba
      Arkadiusz Kubalewski authored
      Make warning meaningful for the user.
      
      Previously the trace:
      "Starting FW LLDP agent failed: error: I40E_ERR_ADMIN_QUEUE_ERROR, I40E_AQ_RC_EAGAIN"
      was produced when user tried to start Firmware LLDP agent,
      just after it was stopped with sequence:
      ethtool --set-priv-flags <dev> disable-fw-lldp on
      ethtool --set-priv-flags <dev> disable-fw-lldp off
      (without any delay between the commands)
      At that point the firmware is still processing stop command, the behavior
      is expected.
      
      Fixes: c1041d07
      
       ("i40e: Missing response checks in driver when starting/stopping FW LLDP")
      Signed-off-by: default avatarAleksandr Loktionov <aleksandr.loktionov@intel.com>
      Signed-off-by: default avatarArkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
      Tested-by: default avatarImam Hassan Reza Biswas <imam.hassan.reza.biswas@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      71d6fdba
    • Arkadiusz Kubalewski's avatar
      i40e: Fix logic of disabling queues · 65662a8d
      Arkadiusz Kubalewski authored
      Correct the message flow between driver and firmware when disabling
      queues.
      
      Previously in case of PF reset (due to required reinit after reconfig),
      the error like: "VSI seid 397 Tx ring 60 disable timeout" could show up
      occasionally. The error was not a real issue of hardware or firmware,
      it was caused by wrong sequence of messages invoked by the driver.
      
      Fixes: 41c445ff
      
       ("i40e: main driver core")
      Signed-off-by: default avatarAleksandr Loktionov <aleksandr.loktionov@intel.com>
      Signed-off-by: default avatarArkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
      Tested-by: default avatarTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      65662a8d
    • Arnd Bergmann's avatar
      netfilter: nfnl_hook: fix unused variable warning · 217e26bd
      Arnd Bergmann authored
      The only user of this variable is in an #ifdef:
      
      net/netfilter/nfnetlink_hook.c: In function 'nfnl_hook_entries_head':
      net/netfilter/nfnetlink_hook.c:177:28: error: unused variable 'netdev' [-Werror=unused-variable]
      
      Fixes: e2cf17d3
      
       ("netfilter: add new hook nfnl subsystem")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      217e26bd
    • Pablo Neira Ayuso's avatar
      netfilter: nft_nat: allow to specify layer 4 protocol NAT only · a33f387e
      Pablo Neira Ayuso authored
      nft_nat reports a bogus EAFNOSUPPORT if no layer 3 information is specified.
      
      Fixes: d07db988
      
       ("netfilter: nf_tables: introduce nft_validate_register_load()")
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      a33f387e
    • Florian Westphal's avatar
      netfilter: conntrack: adjust stop timestamp to real expiry value · 30a56a2b
      Florian Westphal authored
      In case the entry is evicted via garbage collection there is
      delay between the timeout value and the eviction event.
      
      This adjusts the stop value based on how much time has passed.
      
      Fixes: b87a2f91
      
       ("netfilter: conntrack: add gc worker to remove timed-out entries")
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      30a56a2b
    • Pablo Neira Ayuso's avatar
      netfilter: nft_last: avoid possible false sharing · 32953df7
      Pablo Neira Ayuso authored
      Use the idiom described in:
      
      https://github.com/google/ktsan/wiki/READ_ONCE-and-WRITE_ONCE#it-may-improve-performance
      
      Moreover, prevent a compiler optimization.
      
      Fixes: 836382dc
      
       ("netfilter: nf_tables: add last expression")
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      32953df7
    • Pablo Neira Ayuso's avatar
      netfilter: flowtable: avoid possible false sharing · 32c3973d
      Pablo Neira Ayuso authored
      The flowtable follows the same timeout approach as conntrack, use the
      same idiom as in cc169213 ("netfilter: conntrack: avoid same-timeout
      update") but also include the fix provided by e37542ba
      
       ("netfilter:
      conntrack: avoid possible false sharing").
      
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      32c3973d
    • Nguyen Dinh Phi's avatar
      cfg80211: Fix possible memory leak in function cfg80211_bss_update · f9a5c358
      Nguyen Dinh Phi authored
      
      
      When we exceed the limit of BSS entries, this function will free the
      new entry, however, at this time, it is the last door to access the
      inputed ies, so these ies will be unreferenced objects and cause memory
      leak.
      Therefore we should free its ies before deallocating the new entry, beside
      of dropping it from hidden_list.
      
      Signed-off-by: default avatarNguyen Dinh Phi <phind.uet@gmail.com>
      Link: https://lore.kernel.org/r/20210628132334.851095-1-phind.uet@gmail.com
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      f9a5c358
    • Johannes Berg's avatar
      nl80211: limit band information in non-split data · 0d059964
      Johannes Berg authored
      
      
      In non-split data, we shouldn't be adding S1G and 6 GHz
      data (or future bands) since we're really close to the
      4k message size limit. Remove those bands, any modern
      userspace that can use S1G or 6 GHz should already be
      using split dumps, and if not then it needs to update.
      
      Link: https://lore.kernel.org/r/20210712215329.31444162a2c2.I5555312e4a074c84f8b4e7ad79dc4d1fbfc5126c@changeid
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      0d059964
    • Matteo Croce's avatar
      virt_wifi: fix error on connect · 17109e97
      Matteo Croce authored
      
      
      When connecting without first doing a scan, the BSS list is empty
      and __cfg80211_connect_result() generates this warning:
      
      $ iw dev wlan0 connect -w VirtWifi
      [   15.371989] ------------[ cut here ]------------
      [   15.372179] WARNING: CPU: 0 PID: 92 at net/wireless/sme.c:756 __cfg80211_connect_result+0x402/0x440
      [   15.372383] CPU: 0 PID: 92 Comm: kworker/u2:2 Not tainted 5.13.0-kvm #444
      [   15.372512] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-3.fc34 04/01/2014
      [   15.372597] Workqueue: cfg80211 cfg80211_event_work
      [   15.372756] RIP: 0010:__cfg80211_connect_result+0x402/0x440
      [   15.372818] Code: 48 2b 04 25 28 00 00 00 75 59 48 8b 3b 48 8b 76 10 48 8d 65 e0 5b 41 5c 41 5d 41 5e 5d 49 8d 65 f0 41 5d e9 d0 d4 fd ff 0f 0b <0f> 0b e9 f6 fd ff ff e8 f2 4a b4 ff e9 ec fd ff ff 0f 0b e9 19 fd
      [   15.372966] RSP: 0018:ffffc900005cbdc0 EFLAGS: 00010246
      [   15.373022] RAX: 0000000000000000 RBX: ffff8880028e2400 RCX: ffff8880028e2472
      [   15.373088] RDX: 0000000000000002 RSI: 00000000fffffe01 RDI: ffffffff815335ba
      [   15.373149] RBP: ffffc900005cbe00 R08: 0000000000000008 R09: ffff888002bdf8b8
      [   15.373209] R10: ffff88803ec208f0 R11: ffffffffffffe9ae R12: ffff88801d687d98
      [   15.373280] R13: ffff88801b5fe000 R14: ffffc900005cbdc0 R15: dead000000000100
      [   15.373330] FS:  0000000000000000(0000) GS:ffff88803ec00000(0000) knlGS:0000000000000000
      [   15.373382] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   15.373425] CR2: 000056421c468958 CR3: 000000001b458001 CR4: 0000000000170eb0
      [   15.373478] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [   15.373529] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [   15.373580] Call Trace:
      [   15.373611]  ? cfg80211_process_wdev_events+0x10e/0x170
      [   15.373743]  cfg80211_process_wdev_events+0x10e/0x170
      [   15.373783]  cfg80211_process_rdev_events+0x21/0x40
      [   15.373846]  cfg80211_event_work+0x20/0x30
      [   15.373892]  process_one_work+0x1e9/0x340
      [   15.373956]  worker_thread+0x4b/0x3f0
      [   15.374017]  ? process_one_work+0x340/0x340
      [   15.374053]  kthread+0x11f/0x140
      [   15.374089]  ? set_kthread_struct+0x30/0x30
      [   15.374153]  ret_from_fork+0x1f/0x30
      [   15.374187] ---[ end trace 321ef0cb7e9c0be1 ]---
      wlan0 (phy #0): connected to 00:00:00:00:00:00
      
      Add the fake bss just before the connect so that cfg80211_get_bss()
      finds the virtual network.
      As some code was duplicated, move it in a common function.
      
      Signed-off-by: default avatarMatteo Croce <mcroce@microsoft.com>
      Link: https://lore.kernel.org/r/20210706154423.11065-1-mcroce@linux.microsoft.com
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      17109e97
    • Felix Fietkau's avatar
      mac80211: fix enabling 4-address mode on a sta vif after assoc · a5d3cbdb
      Felix Fietkau authored
      Notify the driver about the 4-address mode change and also send a nulldata
      packet to the AP to notify it about the change
      
      Fixes: 1ff4e8f2
      
       ("mac80211: notify the driver when a sta uses 4-address mode")
      Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
      Link: https://lore.kernel.org/r/20210702050111.47546-1-nbd@nbd.name
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      a5d3cbdb
    • Felix Fietkau's avatar
      mac80211: fix starting aggregation sessions on mesh interfaces · 1a791550
      Felix Fietkau authored
      The logic for starting aggregation sessions was recently moved from minstrel_ht
      to mac80211, into the subif tx handler just after the sta lookup.
      Unfortunately this didn't work for mesh interfaces, since the sta lookup is
      deferred until a much later point in time on those.
      Fix this by also calling the aggregation check right after the deferred sta
      lookup.
      
      Fixes: 08a46c64
      
       ("mac80211: move A-MPDU session check from minstrel_ht to mac80211")
      Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
      Link: https://lore.kernel.org/r/20210629112853.29785-1-nbd@nbd.name
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      1a791550
    • Johan Almbladh's avatar
      mac80211: Do not strip skb headroom on monitor frames · ec61cd49
      Johan Almbladh authored
      
      
      When a monitor interface is present together with other interfaces, a
      received skb is copied and received on the monitor netdev. Before, the
      copied skb was allocated with exactly the amount of space needed for
      the radiotap header, resulting in an skb without any headroom at all
      being received on the monitor netdev. With the introduction of eBPF
      and XDP in the kernel, skbs may be processed by custom eBPF programs.
      However, since the skb cannot be reallocated in the eBPF program, no
      more data or headers can be pushed. The old code made sure the final
      headroom was zero regardless of the value of NET_SKB_PAD, so increasing
      that constant would have no effect.
      
      Now we allocate monitor skb copies with a headroom of NET_SKB_PAD bytes
      before the radiotap header. Monitor interfaces now behave in the same
      way as other netdev interfaces that honor the NET_SKB_PAD constant.
      
      Signed-off-by: default avatarJohan Almbladh <johan.almbladh@anyfinetworks.com>
      Link: https://lore.kernel.org/r/20210628123713.2070753-1-johan.almbladh@anyfinetworks.com
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      ec61cd49
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 9f42f674
      Linus Torvalds authored
      Pull arm64 fixes from Will Deacon:
       "A pair of arm64 fixes for -rc3. The straightforward one is a fix to
        our firmware calling stub, which accidentally started corrupting the
        link register on machines with SVE. Since these machines don't really
        exist yet, it wasn't spotted in -next.
      
        The other fix is a revert-and-a-bit of a patch originally intended to
        allow PTE-level huge mappings for the VMAP area on 32-bit PPC 8xx. A
        side-effect of this change was that our pXd_set_huge() implementations
        could be replaced with generic dummy functions depending on the levels
        of page-table being used, which in turn broke the boot if we fail to
        create the linear mapping as a result of using these functions to
        operate on the pgd. Huge thanks to Michael Ellerman for modifying the
        revert so as not to regress PPC 8xx in terms of functionality.
      
        Anyway, that's the background and it's also available in the commit
        message along with Link tags pointing at all of the fun.
      
        Summary:
      
         - Fix hang when issuing SMC on SVE-capable system due to
           clobbered LR
      
         - Fix boot failure due to missing block mappings with folded
           page-table"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        Revert "mm/pgtable: add stubs for {pmd/pub}_{set/clear}_huge"
        arm64: smccc: Save lr before calling __arm_smccc_sve_check()
      9f42f674