31 Mar, 2020

1 commit


30 Mar, 2020

2 commits


26 Mar, 2020

4 commits

  • When a frame is transmitted via the nl80211 TX rather than as a
    normal frame, IEEE80211_TX_CTRL_PORT_CTRL_PROTO wasn't set and
    this will lead to wrong decisions (rate control etc.) being made
    about the frame; fix this.

    Fixes: 911806491425 ("mac80211: Add support for tx_control_port")
    Signed-off-by: Johannes Berg
    Link: https://lore.kernel.org/r/20200326155333.f183f52b02f0.I4054e2a8c11c2ddcb795a0103c87be3538690243@changeid
    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • If a station is still marked as authorized, mark it as no longer
    so before removing its keys. This allows frames transmitted to it
    to be rejected, providing additional protection against leaking
    plain text data during the disconnection flow.

    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20200326155133.ccb4fb0bb356.If48f0f0504efdcf16b8921f48c6d3bb2cb763c99@changeid
    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • mac80211 used to check port authorization in the Data frame enqueue case
    when going through start_xmit(). However, that authorization status may
    change while the frame is waiting in a queue. Add a similar check in the
    dequeue case to avoid sending previously accepted frames after
    authorization change. This provides additional protection against
    potential leaking of frames after a station has been disconnected and
    the keys for it are being removed.

    Cc: stable@vger.kernel.org
    Signed-off-by: Jouni Malinen
    Link: https://lore.kernel.org/r/20200326155133.ced84317ea29.I34d4c47cd8cc8a4042b38a76f16a601fbcbfd9b3@changeid
    Signed-off-by: Johannes Berg

    Jouni Malinen
     
  • If we know that we have an encrypted link (based on having had
    a key configured for TX in the past) then drop all data frames
    in the key selection handler if there's no key anymore.

    This fixes an issue with mac80211 internal TXQs - there we can
    buffer frames for an encrypted link, but then if the key is no
    longer there when they're dequeued, the frames are sent without
    encryption. This happens if a station is disconnected while the
    frames are still on the TXQ.

    Detecting that a link should be encrypted based on a first key
    having been configured for TX is fine as there are no use cases
    for a connection going from with encryption to no encryption.
    With extended key IDs, however, there is a case of having a key
    configured for only decryption, so we can't just trigger this
    behaviour on a key being configured.

    Cc: stable@vger.kernel.org
    Reported-by: Jouni Malinen
    Signed-off-by: Johannes Berg
    Signed-off-by: Luca Coelho
    Link: https://lore.kernel.org/r/iwlwifi.20200326150855.6865c7f28a14.I9fb1d911b064262d33e33dfba730cdeef83926ca@changeid
    Signed-off-by: Johannes Berg

    Johannes Berg
     

20 Mar, 2020

7 commits

  • Some of the drivers are not using channel context, but let the
    stack to control/switch channels instead. For such cases, driver
    can still remain on channel because the mac80211 stack actually
    supports it.

    The stack will check if the driver is using chan_ctx and has
    ops->remain_on_channel been hooked. Otherwise it will start its
    ROC work to remain on channel. So, even if the driver is not
    using chan_ctx, the driver is still capable of doing remain on
    channel.

    Signed-off-by: Yan-Hsuan Chuang
    Link: https://lore.kernel.org/r/20200312074337.16198-1-yhchuang@realtek.com
    Signed-off-by: Johannes Berg

    Yan-Hsuan Chuang
     
  • Use perCPU pointers to get rx_stats in sta_set_sinfo
    when RSS is enabled

    Signed-off-by: Seevalamuthu Mariappan
    Link: https://lore.kernel.org/r/1584526555-25960-1-git-send-email-seevalam@codeaurora.org
    Signed-off-by: Johannes Berg

    Seevalamuthu Mariappan
     
  • Set the NL80211_EXT_FEATURE_DEL_IBSS_STA if the interface support IBSS
    mode, so that stations can be reset from user space.

    mac80211 already deletes stations by itself, so mac80211 drivers must
    already support this.

    This has been successfully tested with ath9k.

    Signed-off-by: Nicolas Cavallari
    Link: https://lore.kernel.org/r/20200305135754.12094-2-cavallar@lri.fr
    Signed-off-by: Johannes Berg

    Nicolas Cavallari
     
  • We use the parsing CRC for checking if the beacon changed, and
    if the WLAN_EID_EXT_HE_OPERATION extended element changes we
    need to track it so we can react to that. Include it in the CRC
    calculation.

    Link: https://lore.kernel.org/r/20200131111300.891737-22-luca@coelho.fi
    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • In AP mode, set htc_trig_based_pkt_ext and frame_time_rts_th
    for driver use.

    Signed-off-by: Shaul Triebitz
    Signed-off-by: Luca Coelho
    Link: https://lore.kernel.org/r/20200131111300.891737-19-luca@coelho.fi
    Signed-off-by: Johannes Berg

    Shaul Triebitz
     
  • In beacon protection, don't leave skb->next/prev pointing to the
    on-stack list, even if that's actually harmless since we don't use
    them again afterwards.

    While at it, check that the SKB on the list is still the same, as
    that's required here. If not, the encryption (protection) code is
    buggy.

    Fixes: 0a3a84360b37 ("mac80211: Beacon protection using the new BIGTK (AP)")
    Signed-off-by: Johannes Berg
    Link: https://lore.kernel.org/r/20200320102021.1be7823fc05e.Ia89fb79a0469d32137c9a04315a1d2dfc7b7d6f5@changeid
    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • This patch adds support for disabling pre-auth rx over the nl80211 control
    port for mac80211.

    Signed-off-by: Markus Theil
    Link: https://lore.kernel.org/r/20200312091055.54257-3-markus.theil@tu-ilmenau.de
    [fix indentation slightly, squash feature enablement]
    Signed-off-by: Johannes Berg

    Markus Theil
     

13 Mar, 2020

1 commit


11 Mar, 2020

1 commit


28 Feb, 2020

1 commit


24 Feb, 2020

8 commits

  • Implement drv_set_tid_config api to allow TID specific
    configuration and drv_reset_tid_config api to reset peer
    specific TID configuration. This per-TID onfiguration
    will be applied for all the connected stations when MAC is NULL.

    Signed-off-by: Tamizh chelvam
    Link: https://lore.kernel.org/r/1579506687-18296-7-git-send-email-tamizhr@codeaurora.org
    Signed-off-by: Johannes Berg

    Tamizh chelvam
     
  • local->sta_mtx is held in __ieee80211_check_fast_rx_iface().
    No need to use list_for_each_entry_rcu() as it also requires
    a cond argument to avoid false lockdep warnings when not used in
    RCU read-side section (with CONFIG_PROVE_RCU_LIST).
    Therefore use list_for_each_entry();

    Signed-off-by: Madhuparna Bhowmik
    Link: https://lore.kernel.org/r/20200223143302.15390-1-madhuparnabhowmik10@gmail.com
    Signed-off-by: Johannes Berg

    Madhuparna Bhowmik
     
  • This adds support for mac80211 to verify that received Beacon frames
    have a valid MME in station mode when a BIGTK is configured.

    Signed-off-by: Jouni Malinen
    Link: https://lore.kernel.org/r/20200222132548.20835-6-jouni@codeaurora.org
    Signed-off-by: Johannes Berg

    Jouni Malinen
     
  • This adds support for mac80211 to add an MME into Beacon frames in AP
    mode when a BIGTK is configured.

    Signed-off-by: Jouni Malinen
    Link: https://lore.kernel.org/r/20200222132548.20835-5-jouni@codeaurora.org
    Signed-off-by: Johannes Berg

    Jouni Malinen
     
  • When BIP is used to protect Beacon frames, the Timestamp field is masked
    to zero. Otherwise, the BIP processing is identical to the way it was
    already used with group-addressed Robust Management frames.

    Signed-off-by: Jouni Malinen
    Link: https://lore.kernel.org/r/20200222132548.20835-4-jouni@codeaurora.org
    Signed-off-by: Johannes Berg

    Jouni Malinen
     
  • Extend mac80211 key configuration to support the new BIGTK with key
    index values 6 and 7. Support for actually protecting Beacon frames
    (adding the MME in AP mode and checking it in STA mode) is covered in
    separate commits.

    Signed-off-by: Jouni Malinen
    Link: https://lore.kernel.org/r/20200222132548.20835-3-jouni@codeaurora.org
    Signed-off-by: Johannes Berg

    Jouni Malinen
     
  • This reverts commit 8c3ed7aa2b9ef666195b789e9b02e28383243fa8.

    As Jouni points out, there's really no need for this, since the
    RSN pre-authentication frames are normal data frames, not port
    control frames (locally).

    We can still revert this now since it hasn't actually gone beyond
    -next.

    Fixes: 8c3ed7aa2b9e ("nl80211: add src and dst addr attributes for control port tx/rx")
    Signed-off-by: Johannes Berg
    Link: https://lore.kernel.org/r/20200224101910.b746e263287a.I9eb15d6895515179d50964dec3550c9dc784bb93@changeid
    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • This reverts commit 9b125c27998719288e4dcf2faf54511039526692.

    As Jouni points out, there's really no need for this, since the
    RSN pre-authentication frames are normal data frames, not port
    control frames (locally).

    Fixes: 9b125c279987 ("mac80211: support NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211_MAC_ADDRS")
    Signed-off-by: Johannes Berg
    Link: https://lore.kernel.org/r/20200224101910.b87da63a3cd6.Ic94bc51a370c4aa7d19fbca9b96d90ab703257dc@changeid
    Signed-off-by: Johannes Berg

    Johannes Berg
     

22 Feb, 2020

1 commit


21 Feb, 2020

2 commits

  • In case of monitor mode injection, vif may be NULL, don't crash
    on that in ieee80211_calc_expected_tx_airtime().

    Signed-off-by: Johannes Berg
    Acked-by: Toke Høiland-Jørgensen
    Link: https://lore.kernel.org/r/20200221104544.dddb7a3568fd.I0ede2733a3c76e95daeab07538449ea847e7b78d@changeid
    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • The below-mentioned commit changed the code to unlock *inside*
    the function, but previously the unlock was *outside*. It failed
    to remove the outer unlock, however, leading to double unlock.

    Fix this.

    Fixes: 33483a6b88e4 ("mac80211: fix missing unlock on error in ieee80211_mark_sta_auth()")
    Signed-off-by: Andrei Otcheretianski
    Link: https://lore.kernel.org/r/20200221104719.cce4741cf6eb.I671567b185c8a4c2409377e483fd149ce590f56d@changeid
    [rewrite commit message to better explain what happened]
    Signed-off-by: Johannes Berg

    Andrei Otcheretianski
     

17 Feb, 2020

1 commit


14 Feb, 2020

3 commits

  • Currently a mac80211 driver can only set the txq_limit when using
    wake_tx_queue. Not all drivers use wake_tx_queue. This patch adds a new
    element to wiphy allowing a driver to set a custom tx_queue_len and the
    code that will apply it in case it is set. The current default is
    1000 which is too low for ath11k when doing HE rates.

    Signed-off-by: John Crispin
    Link: https://lore.kernel.org/r/20200211122605.13002-1-john@phrozen.org
    Signed-off-by: Johannes Berg

    John Crispin
     
  • With multiple VIFS ath10k, and probably others, tries to find the
    minimum txpower for all vifs and uses that when setting txpower in
    the firmware.

    If a second vif is added and starts to scan, it's txpower is not
    initialized yet and it set to zero.

    ath10k had a patch to ignore zero values, but then it is impossible
    to actually set txpower to zero.

    So, instead initialize the txpower to INT_MIN in mac80211, and let
    drivers know that means the power has not been set and so should
    be ignored.

    This should fix regression in:

    commit 88407beb1b1462f706a1950a355fd086e1c450b6
    Author: Ryan Hsu
    Date: Tue Dec 13 14:55:19 2016 -0800

    ath10k: fix incorrect txpower set by P2P_DEVICE interface

    Tested on ath10k 9984 with ath10k-ct firmware.

    Signed-off-by: Ben Greear
    Link: https://lore.kernel.org/r/20191217183057.24586-1-greearb@candelatech.com
    Signed-off-by: Johannes Berg

    Ben Greear
     
  • Before this patch, STA's would set new width of 160/80+80 MHz based on AP capability only.
    This is wrong because STA may not support > 80MHz BW.
    Fix is to verify STA has 160/80+80 MHz capability before increasing its width to > 80MHz.

    The "support_80_80" and "support_160" setting is based on:
    "Table 9-272 — Setting of the Supported Channel Width Set subfield and Extended NSS BW
    Support subfield at a STA transmitting the VHT Capabilities Information field"
    From "Draft P802.11REVmd_D3.0.pdf"

    Signed-off-by: Aviad Brikman
    Signed-off-by: Shay Bar
    Link: https://lore.kernel.org/r/20200210130728.23674-1-shay.bar@celeno.com
    Signed-off-by: Johannes Berg

    Shay Bar
     

07 Feb, 2020

8 commits

  • This is now a trivial patch, but for seeing the actual changes
    I (Johannes) split it out from the original.

    Signed-off-by: Markus Theil
    Link: https://lore.kernel.org/r/20200115125522.3755-1-markus.theil@tu-ilmenau.de
    [split into separate cfg80211/mac80211 patches]
    Signed-off-by: Johannes Berg

    Markus Theil
     
  • When using control port over nl80211 in AP mode with
    pre-authentication, APs need to forward frames to other
    APs defined by their MAC address. Before this patch,
    pre-auth frames reaching user space over nl80211 control
    port have no longer any information about the dest attached,
    which can be used for forwarding to a controller or injecting
    the frame back to a ethernet interface over a AF_PACKET
    socket.
    Analog problems exist, when forwarding pre-auth frames from
    AP -> STA.

    This patch therefore adds the NL80211_ATTR_DST_MAC and
    NL80211_ATTR_SRC_MAC attributes to provide more context
    information when forwarding.
    The respective arguments are optional on tx and included on rx.
    Therefore unaware existing software is not affected.

    Software which wants to detect this feature, can do so
    by checking against:
    NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211_MAC_ADDRS

    Signed-off-by: Markus Theil
    Link: https://lore.kernel.org/r/20200115125522.3755-1-markus.theil@tu-ilmenau.de
    [split into separate cfg80211/mac80211 patches]
    Signed-off-by: Johannes Berg

    Markus Theil
     
  • Parse also the RSN Extension IE when parsing the rest of the IEs.
    It will be used in a later patch.

    Signed-off-by: Shaul Triebitz
    Signed-off-by: Luca Coelho
    Link: https://lore.kernel.org/r/20200131111300.891737-21-luca@coelho.fi
    Signed-off-by: Johannes Berg

    Shaul Triebitz
     
  • To support Pre Association Security Negotiation (PASN) while already
    associated to one AP, allow user space to register to Rx
    authentication frames, so that the user space logic would be able to
    receive/handle authentication frames from a different AP as part of
    PASN.

    Note that it is expected that user space would intelligently register
    for Rx authentication frames, i.e., only when PASN is used and
    configure a match filter only for PASN authentication algorithm, as
    otherwise the MLME functionality of mac80211 would be broken.

    Additionally, since some versions of the user space daemons wrongly
    register to all types of authentication frames (which might result in
    unexpected behavior) allow such registration if the request is for a
    specific authentication algorithm number.

    Signed-off-by: Ilan Peer
    Signed-off-by: Luca Coelho
    Link: https://lore.kernel.org/r/20200131114529.894206-1-luca@coelho.fi
    Signed-off-by: Johannes Berg

    Ilan Peer
     
  • The SMPS feature is defined in the specification only to be
    used by non-AP stations and not by APs, so remove the support
    for changing the AP's SMPS mode dynamically.

    Signed-off-by: Ilan Peer
    Signed-off-by: Luca Coelho
    Link: https://lore.kernel.org/r/20200131111300.891737-20-luca@coelho.fi
    Signed-off-by: Johannes Berg

    Ilan Peer
     
  • According to IEEE802.11 specifications the SM power save field
    in the HT capability IE and the HE extended capability IE is valid
    only in (re)association frames and should be ignored otherwise.
    Remove code paths that handled this also for non AP modes.

    Signed-off-by: Ilan Peer
    Signed-off-by: Luca Coelho
    Link: https://lore.kernel.org/r/20200131111300.891737-17-luca@coelho.fi
    Signed-off-by: Johannes Berg

    Ilan Peer
     
  • An AP that operates on 6GHz may respond with a broadcast probe response.
    Don't ignore such frames.

    Signed-off-by: Andrei Otcheretianski
    Signed-off-by: Luca Coelho
    Link: https://lore.kernel.org/r/20200131111300.891737-14-luca@coelho.fi
    Signed-off-by: Johannes Berg

    Andrei Otcheretianski
     
  • In case of HE, the RX NSS is taken from the HE capabilities.
    If the supported NSS capabilities that are reported by AP for
    HE mode in the HE Capabilities element are different from the NSS
    capabilities that are reported by AP for the VHT mode in the VHT
    Capabilities element, use the lowest supported NSS to not get all
    the values confused.

    Signed-off-by: Tova Mussai
    Signed-off-by: Luca Coelho
    Link: https://lore.kernel.org/r/20200131111300.891737-9-luca@coelho.fi
    Signed-off-by: Johannes Berg

    Tova Mussai