13 Oct, 2018

1 commit

  • commit 211710ca74adf790b46ab3867fcce8047b573cd1 upstream.

    key->sta is only valid after ieee80211_key_link, which is called later
    in this function. Because of that, the IEEE80211_KEY_FLAG_RX_MGMT is
    never set when management frame protection is enabled.

    Fixes: e548c49e6dc6b ("mac80211: add key flag for management keys")
    Cc: stable@vger.kernel.org
    Signed-off-by: Felix Fietkau
    Signed-off-by: Johannes Berg
    Signed-off-by: Greg Kroah-Hartman

    Felix Fietkau
     

10 Oct, 2018

11 commits

  • [ Upstream commit c6e57b3896fc76299913b8cfd82d853bee8a2c84 ]

    When tracing is enabled, all the debug messages are recorded and must
    not exceed MAX_MSG_LEN (100) columns. Longer debug messages grant the
    user with:

    WARNING: CPU: 3 PID: 32642 at /tmp/wifi-core-20180806094828/src/iwlwifi-stack-dev/net/mac80211/./trace_msg.h:32 trace_event_raw_event_mac80211_msg_event+0xab/0xc0 [mac80211]
    Workqueue: phy1 ieee80211_iface_work [mac80211]
    RIP: 0010:trace_event_raw_event_mac80211_msg_event+0xab/0xc0 [mac80211]
    Call Trace:
    __sdata_dbg+0xbd/0x120 [mac80211]
    ieee80211_ibss_rx_queued_mgmt+0x15f/0x510 [mac80211]
    ieee80211_iface_work+0x21d/0x320 [mac80211]

    Signed-off-by: Emmanuel Grumbach
    Signed-off-by: Luca Coelho
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Emmanuel Grumbach
     
  • [ Upstream commit 6c18b27d6e5c6a7206364eae2b47bc8d8b2fa68f ]

    If the driver fails to properly prepare for the channel
    switch, mac80211 will disconnect. If the CSA IE had mode
    set to 1, it means that the clients are not allowed to send
    any Tx on the current channel, and that includes the
    deauthentication frame.

    Make sure that we don't send the deauthentication frame in
    this case.

    In iwlwifi, this caused a failure to flush queues since the
    firmware already closed the queues after having parsed the
    CSA IE. Then mac80211 would wait until the deauthentication
    frame would go out (drv_flush(drop=false)) and that would
    never happen.

    Signed-off-by: Emmanuel Grumbach
    Signed-off-by: Luca Coelho
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Emmanuel Grumbach
     
  • [ Upstream commit 0007e94355fdb71a1cf5dba0754155cba08f0666 ]

    When performing a channel switch flow for a managed interface, the
    flow did not update the bandwidth of the AP station and the rate
    scale algorithm. In case of a channel width downgrade, this would
    result with the rate scale algorithm using a bandwidth that does not
    match the interface channel configuration.

    Fix this by updating the AP station bandwidth and rate scaling algorithm
    before the actual channel change in case of a bandwidth downgrade, or
    after the actual channel change in case of a bandwidth upgrade.

    Signed-off-by: Ilan Peer
    Signed-off-by: Luca Coelho
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Ilan Peer
     
  • [ Upstream commit f3ffb6c3a28963657eb8b02a795d75f2ebbd5ef4 ]

    We hit a problem with iwlwifi that was caused by a bug in
    mac80211. A bug in iwlwifi caused the firwmare to crash in
    certain cases in channel switch. Because of that bug,
    drv_pre_channel_switch would fail and trigger the restart
    flow.
    Now we had the hw restart worker which runs on the system's
    workqueue and the csa_connection_drop_work worker that runs
    on mac80211's workqueue that can run together. This is
    obviously problematic since the restart work wants to
    reconfigure the connection, while the csa_connection_drop_work
    worker does the exact opposite: it tries to disconnect.

    Fix this by cancelling the csa_connection_drop_work worker
    in the restart worker.

    Note that this can sound racy: we could have:

    driver iface_work CSA_work restart_work
    +++++++++++++++++++++++++++++++++++++++++++++
    |

    -CS FAILED-->
    | |
    | cancel_work(CSA)
    schedule |
    CSA work |
    | |
    Race between those 2

    But this is not possible because we flush the workqueue
    in the restart worker before we cancel the CSA worker.
    That would be bullet proof if we could guarantee that
    we schedule the CSA worker only from the iface_work
    which runs on the workqueue (and not on the system's
    workqueue), but unfortunately we do have an instance
    in which we schedule the CSA work outside the context
    of the workqueue (ieee80211_chswitch_done).

    Note also that we should probably cancel other workers
    like beacon_connection_loss_work and possibly others
    for different types of interfaces, at the very least,
    IBSS should suffer from the exact same problem, but for
    now, do the minimum to fix the actual bug that was actually
    experienced and reproduced.

    Signed-off-by: Emmanuel Grumbach
    Signed-off-by: Luca Coelho
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Emmanuel Grumbach
     
  • [ Upstream commit 66eb02d839e8495ae6b612e2d09ff599374b80e2 ]

    Initialize 'n' to 2 in order to take into account also the first
    packet in the estimation of max_subframe limit for a given A-MSDU
    since frag_tail pointer is NULL when ieee80211_amsdu_aggregate
    routine analyzes the second frame.

    Fixes: 6e0456b54545 ("mac80211: add A-MSDU tx support")
    Signed-off-by: Lorenzo Bianconi
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Lorenzo Bianconi
     
  • [ Upstream commit aa58acf325b4aadeecae2bfc90658273b47dbace ]

    In the error path of changing the SKB headroom of the second
    A-MSDU subframe, we would not account for the already-changed
    length of the first frame that just got converted to be in
    A-MSDU format and thus is a bit longer now.

    Fix this by doing the necessary accounting.

    It would be possible to reorder the operations, but that would
    make the code more complex (to calculate the necessary pad),
    and the headroom expansion should not fail frequently enough
    to make that worthwhile.

    Fixes: 6e0456b54545 ("mac80211: add A-MSDU tx support")
    Signed-off-by: Johannes Berg
    Acked-by: Lorenzo Bianconi
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Johannes Berg
     
  • [ Upstream commit 1eb507903665442360a959136dfa3234c43db085 ]

    Do not start to aggregate packets in a A-MSDU frame (converting the
    first subframe to A-MSDU, adding the header) if max_tx_fragments or
    max_amsdu_subframes limits are already exceeded by it. In particular,
    this happens when drivers set the limit to 1 to avoid A-MSDUs at all.

    Signed-off-by: Lorenzo Bianconi
    [reword commit message to be more precise]
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Lorenzo Bianconi
     
  • [ Upstream commit 166ac9d55b0ab70b644e429be1f217fe8393cbd7 ]

    When building building AMSDU from non-linear SKB, we hit a
    kernel panic when trying to push the padding to the tail.
    Instead, put the padding at the head of the next subframe.
    This also fixes the A-MSDU subframes to not have the padding
    accounted in the length field and not have pad at all for
    the last subframe, both required by the spec.

    Fixes: 6e0456b54545 ("mac80211: add A-MSDU tx support")
    Signed-off-by: Sara Sharon
    Reviewed-by: Lorenzo Bianconi
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Sara Sharon
     
  • [ Upstream commit 1f631c3201fe5491808df143d8fcba81b3197ffd ]

    IEEE 802.11-2016 14.10.8.3 HWMP sequence numbering says:
    If it is a target mesh STA, it shall update its own HWMP SN to
    maximum (current HWMP SN, target HWMP SN in the PREQ element) + 1
    immediately before it generates a PREP element in response to a
    PREQ element.

    Signed-off-by: Yuan-Chi Pang
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Yuan-Chi Pang
     
  • [ Upstream commit 67d1ba8a6dc83d90cd58b89fa6cbf9ae35a0cf7f ]

    The mod mask for VHT capabilities intends to say that you can override
    the number of STBC receive streams, and it does, but only by accident.
    The IEEE80211_VHT_CAP_RXSTBC_X aren't bits to be set, but values (albeit
    left-shifted). ORing the bits together gets the right answer, but we
    should use the _MASK macro here instead.

    Signed-off-by: Danek Duvall
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Danek Duvall
     
  • [ Upstream commit 77cfaf52eca5cac30ed029507e0cab065f888995 ]

    The TXQ teardown code can reference the vif data structures that are
    stored in the netdev private memory area if there are still packets on
    the queue when it is being freed. Since the TXQ teardown code is run
    after the netdevs are freed, this can lead to a use-after-free. Fix this
    by moving the TXQ teardown code to earlier in ieee80211_unregister_hw().

    Reported-by: Ben Greear
    Tested-by: Ben Greear
    Signed-off-by: Toke Høiland-Jørgensen
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Toke Høiland-Jørgensen
     

26 Sep, 2018

1 commit

  • [ Upstream commit 133bf90dbb8b873286f8ec2e81ba26e863114b8c ]

    As explained in ieee80211_delayed_tailroom_dec(), during roam,
    keys of the old AP will be destroyed and new keys will be
    installed. Deletion of the old key causes
    crypto_tx_tailroom_needed_cnt to go from 1 to 0 and the new key
    installation causes a transition from 0 to 1.

    Whenever crypto_tx_tailroom_needed_cnt transitions from 0 to 1,
    we invoke synchronize_net(); the reason for doing this is to avoid
    a race in the TX path as explained in increment_tailroom_need_count().
    This synchronize_net() operation can be slow and can affect the station
    roam time. To avoid this, decrementing the crypto_tx_tailroom_needed_cnt
    is delayed for a while so that upon installation of new key the
    transition would be from 1 to 2 instead of 0 to 1 and thereby
    improving the roam time.

    This is all correct for a STA iftype, but deferring the tailroom_needed
    decrement for other iftypes may be unnecessary.

    For example, let's consider the case of a 4-addr client connecting to
    an AP for which AP_VLAN interface is also created, let the initial
    value for tailroom_needed on the AP be 1.

    * 4-addr client connects to the AP (AP: tailroom_needed = 1)
    * AP will clear old keys, delay decrement of tailroom_needed count
    * AP_VLAN is created, it takes the tailroom count from master
    (AP_VLAN: tailroom_needed = 1, AP: tailroom_needed = 1)
    * Install new key for the station, assume key is plumbed in the HW,
    there won't be any change in tailroom_needed count on AP iface
    * Delayed decrement of tailroom_needed count on AP
    (AP: tailroom_needed = 0, AP_VLAN: tailroom_needed = 1)

    Because of the delayed decrement on AP iface, tailroom_needed count goes
    out of sync between AP(master iface) and AP_VLAN(slave iface) and
    there would be unnecessary tailroom created for the packets going
    through AP_VLAN iface.

    Also, WARN_ONs were observed while trying to bring down the AP_VLAN
    interface:
    (warn_slowpath_common) (warn_slowpath_null+0x18/0x20)
    (warn_slowpath_null) (ieee80211_free_keys+0x114/0x1e4)
    (ieee80211_free_keys) (ieee80211_del_virtual_monitor+0x51c/0x850)
    (ieee80211_del_virtual_monitor) (ieee80211_stop+0x30/0x3c)
    (ieee80211_stop) (__dev_close_many+0x94/0xb8)
    (__dev_close_many) (dev_close_many+0x5c/0xc8)

    Restricting delayed decrement to station interface alone fixes the problem
    and it makes sense to do so because delayed decrement is done to improve
    roam time which is applicable only for client devices.

    Signed-off-by: Manikanta Pubbisetty
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Manikanta Pubbisetty
     

05 Sep, 2018

1 commit

  • [ Upstream commit 19103a4bfb42f320395daa5616ece3e89e759d63 ]

    As part of hw reconfig, only stations linked to AP interfaces are added
    back to the driver ignoring those which are tied to AP_VLAN interfaces.

    It is true that there could be stations tied to the AP_VLAN interface while
    serving 4addr clients or when using AP_VLAN for VLAN operations; we should
    be adding these stations back to the driver as part of hw reconfig, failing
    to do so can cause functional issues.

    In the case of ath10k driver, the following errors were observed.

    ath10k_pci : failed to install key for non-existent peer XX:XX:XX:XX:XX:XX
    Workqueue: events_freezable ieee80211_restart_work [mac80211]
    (unwind_backtrace) from (show_stack+0x10/0x14)
    (show_stack) (dump_stack+0x80/0xa0)
    (dump_stack) (warn_slowpath_common+0x68/0x8c)
    (warn_slowpath_common) (warn_slowpath_null+0x18/0x20)
    (warn_slowpath_null) (ieee80211_enable_keys+0x88/0x154 [mac80211])
    (ieee80211_enable_keys) (ieee80211_reconfig+0xc90/0x19c8 [mac80211])
    (ieee80211_reconfig]) (ieee80211_restart_work+0x8c/0xa0 [mac80211])
    (ieee80211_restart_work) (process_one_work+0x284/0x488)
    (process_one_work) (worker_thread+0x228/0x360)
    (worker_thread) (kthread+0xd8/0xec)
    (kthread) (ret_from_fork+0x14/0x24)

    Also while bringing down the AP VAP, WARN_ONs and errors related to peer
    removal were observed.

    ath10k_pci : failed to clear all peer wep keys for vdev 0: -2
    ath10k_pci : failed to disassociate station: 8c:fd:f0:0a:8c:f5 vdev 0: -2
    (unwind_backtrace) (show_stack+0x10/0x14)
    (show_stack) (dump_stack+0x80/0xa0)
    (dump_stack) (warn_slowpath_common+0x68/0x8c)
    (warn_slowpath_common) (warn_slowpath_null+0x18/0x20)
    (warn_slowpath_null) (sta_set_sinfo+0xb98/0xc9c [mac80211])
    (sta_set_sinfo [mac80211]) (__sta_info_flush+0xf0/0x134 [mac80211])
    (__sta_info_flush [mac80211]) (ieee80211_stop_ap+0xe8/0x390 [mac80211])
    (ieee80211_stop_ap [mac80211]) (__cfg80211_stop_ap+0xe0/0x3dc [cfg80211])
    (__cfg80211_stop_ap [cfg80211]) (cfg80211_stop_ap+0x30/0x44 [cfg80211])
    (cfg80211_stop_ap [cfg80211]) (genl_rcv_msg+0x274/0x30c)
    (genl_rcv_msg) (netlink_rcv_skb+0x58/0xac)
    (netlink_rcv_skb) (genl_rcv+0x20/0x34)
    (genl_rcv) (netlink_unicast+0x11c/0x204)
    (netlink_unicast) (netlink_sendmsg+0x30c/0x370)
    (netlink_sendmsg) (sock_sendmsg+0x70/0x84)
    (sock_sendmsg) (___sys_sendmsg.part.3+0x188/0x228)
    (___sys_sendmsg.part.3) (__sys_sendmsg+0x4c/0x70)
    (__sys_sendmsg) (ret_fast_syscall+0x0/0x44)

    These issues got fixed by adding the stations which are
    tied to AP_VLANs back to the driver.

    Signed-off-by: Manikanta Pubbisetty
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    mpubbise@codeaurora.org
     

21 Jun, 2018

2 commits

  • [ Upstream commit 914eac248d876f9c00cd1792ffec3d182c863f13 ]

    2016 spec, section 10.24.2 specifies that the block ack
    timeout in the ADD BA request is advisory.

    That means we should check the value in the response and
    act upon it (same as buffer size).

    Signed-off-by: Sara Sharon
    Signed-off-by: Luca Coelho
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Sara Sharon
     
  • [ Upstream commit 407879b690ba3a6bf29be896d02dad63463bd1c0 ]

    The IEEE P802.11-REVmd D1.0 specification updated the SAE authentication
    timeout to be 2000 milliseconds (see dot11RSNASAERetransPeriod). Update
    the SAE timeout setting accordingly.

    While at it, reduce some code duplication in the timeout configuration.

    Signed-off-by: Ilan Peer
    Signed-off-by: Luca Coelho
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Ilan Peer
     

30 May, 2018

6 commits

  • [ Upstream commit b323ac19b7734a1c464b2785a082ee50bccd3b91 ]

    Fixes rx for 4-addr packets in AP mode. These may be used for setting
    up a 4-addr link for stations that are allowed to do so.

    Signed-off-by: Felix Fietkau
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Felix Fietkau
     
  • [ Upstream commit 3b07029729e347f288c70227cfe3c66b085d6b0b ]

    In case an ADDBA request is received while there is already
    an ongoing BA sessions with the same parameters, i.e., update
    flow, an ADBBA response with decline status was sent twice. Fix it.

    Signed-off-by: Ilan Peer
    Signed-off-by: Luca Coelho
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Ilan Peer
     
  • [ Upstream commit 191da271ac260700db3e5b4bb982a17ca78769d6 ]

    Some APs include a non global operating class in their extended channel
    switch information element. In such a case, as the operating class is not
    known, mac80211 would decide to disconnect.

    However the specification states that the operating class needs to be
    taken from Annex E, but it does not specify from which table it should be
    taken, so it is valid for an AP to use a non global operating class.

    To avoid possibly unneeded disconnection, in such a case ignore the
    operating class and assume that the current band is used, and if the
    resulting channel and band configuration is invalid disconnect.

    Signed-off-by: Ilan Peer
    Signed-off-by: Luca Coelho
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Ilan Peer
     
  • [ Upstream commit 95f3ce6a77893ac828ba841df44421620de4314b ]

    sta_info_alloc can be called from atomic paths (such as RX path)
    so we need to call pcpu_alloc with the correct gfp.

    Fixes: c9c5962b56c1 ("mac80211: enable collecting station statistics per-CPU")
    Signed-off-by: Sara Sharon
    Signed-off-by: Luca Coelho
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Sara Sharon
     
  • [ Upstream commit d78d9ee9d40aca4781d2c5334972544601a4c3a2 ]

    If sta_info_alloc fails after allocating the per CPU statistics,
    they are not properly freed.

    Fixes: c9c5962b56c1 ("mac80211: enable collecting station statistics per-CPU")
    Signed-off-by: Sara Sharon
    Signed-off-by: Luca Coelho
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Sara Sharon
     
  • [ Upstream commit c4de37ee2b55deac7d6aeac33e02e3d6be243898 ]

    mesh TTL offset in Mesh Channel Switch Parameters element depends on
    not only Secondary Channel Offset element, but also affected by
    HT Control field and Wide Bandwidth Channel Switch element.
    So use element structure to manipulate mesh channel swich param IE
    after removing its constant attribution to correct the miscalculation.

    Signed-off-by: Peter Oh
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Peter Oh
     

12 Apr, 2018

1 commit

  • [ Upstream commit 3a3713ec360138f806c6fc368d1de570f692b347 ]

    Instead of calling ieee80211_recalc_txpower on monitor interfaces
    directly, call it using the virtual monitor interface, if one exists.

    In case of a single monitor interface given, reject setting TX power,
    if no virtual monitor interface exists.

    That being checked, don't warn in ieee80211_bss_info_change_notify,
    after setting TX power on a monitor interface.

    Fixes warning:
    ------------[ cut here ]------------
    WARNING: CPU: 0 PID: 2193 at net/mac80211/driver-ops.h:167
    ieee80211_bss_info_change_notify+0x111/0x190 Modules linked in: uvcvideo
    videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_core
    rndis_host cdc_ether usbnet mii tp_smapi(O) thinkpad_ec(O) ohci_hcd vboxpci(O)
    vboxnetadp(O) vboxnetflt(O) v boxdrv(O) x86_pkg_temp_thermal kvm_intel kvm
    irqbypass iwldvm iwlwifi ehci_pci ehci_hcd tpm_tis tpm_tis_core tpm CPU: 0
    PID: 2193 Comm: iw Tainted: G O 4.12.12-gentoo #2 task:
    ffff880186fd5cc0 task.stack: ffffc90001b54000 RIP:
    0010:ieee80211_bss_info_change_notify+0x111/0x190 RSP: 0018:ffffc90001b57a10
    EFLAGS: 00010246 RAX: 0000000000000006 RBX: ffff8801052ce840 RCX:
    0000000000000064 RDX: 00000000fffffffc RSI: 0000000000040000 RDI:
    ffff8801052ce840 RBP: ffffc90001b57a38 R08: 0000000000000062 R09:
    0000000000000000 R10: ffff8802144b5000 R11: ffff880049dc4614 R12:
    0000000000040000 R13: 0000000000000064 R14: ffff8802105f0760 R15:
    ffffc90001b57b48 FS: 00007f92644b4580(0000) GS:ffff88021e200000(0000)
    knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 00007f9263c109f0 CR3: 00000001df850000 CR4: 00000000000406f0
    Call Trace:
    ieee80211_recalc_txpower+0x33/0x40
    ieee80211_set_tx_power+0x40/0x180
    nl80211_set_wiphy+0x32e/0x950

    Reported-by: Peter Große
    Signed-off-by: Peter Große

    Signed-off-by: Johannes Berg

    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Peter Große
     

19 Mar, 2018

1 commit

  • [ Upstream commit c7976f5272486e4ff406014c4b43e2fa3b70b052 ]

    In the ieee80211_setup_sdata() we check if the interface type is valid
    and, if not, call BUG(). This should never happen, but if there is
    something wrong with the code, it will not be caught until the bug
    happens when an interface is being set up. Calling BUG() is too
    extreme for this and a WARN_ON() would be better used instead. Change
    that.

    Signed-off-by: Luca Coelho
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Luca Coelho
     

03 Mar, 2018

1 commit

  • [ Upstream commit 736a80bbfda709fb3631f5f62056f250a38e5804 ]

    If there are multiple mesh stations with the same MAC address,
    they will both get confused and start throwing warnings.

    Obviously in this case nothing can actually work anyway, so just
    drop frames that look like they're from ourselves early on.

    Reported-by: Gui Iribarren
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Johannes Berg
     

28 Feb, 2018

1 commit

  • commit bee92d06157fc39d5d7836a061c7d41289a55797 upstream.

    gcc-8 warns about some obviously incorrect code:

    net/mac80211/cfg.c: In function 'cfg80211_beacon_dup':
    net/mac80211/cfg.c:2896:3: error: 'memcpy' source argument is the same as destination [-Werror=restrict]

    From the context, I conclude that we want to copy from beacon into
    new_beacon, as we do in the rest of the function.

    Cc: stable@vger.kernel.org
    Fixes: 73da7d5bab79 ("mac80211: add channel switch command and beacon callbacks")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Johannes Berg
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     

04 Feb, 2018

2 commits

  • [ Upstream commit fbbdad5edf0bb59786a51b94a9d006bc8c2da9a2 ]

    The previous path metric update from RANN frame has not considered
    the own link metric toward the transmitting mesh STA. Fix this.

    Reported-by: Michael65535
    Signed-off-by: Chun-Yeow Yeoh
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Chun-Yeow Yeoh
     
  • [ Upstream commit 7b6ddeaf27eca72795ceeae2f0f347db1b5f9a30 ]

    When connected to a QoS/WMM AP, mac80211 should use a QoS NDP
    for probing it, instead of a regular non-QoS one, fix this.

    Change all the drivers to *not* allow QoS NDP for now, even
    though it looks like most of them should be OK with that.

    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Johannes Berg
     

03 Nov, 2017

1 commit

  • …el/git/gregkh/driver-core

    Pull initial SPDX identifiers from Greg KH:
    "License cleanup: add SPDX license identifiers to some files

    Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the
    'GPL-2.0' SPDX license identifier. The SPDX identifier is a legally
    binding shorthand, which can be used instead of the full boiler plate
    text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart
    and Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset
    of the use cases:

    - file had no licensing information it it.

    - file was a */uapi/* one with no licensing information in it,

    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to
    license had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied
    to a file was done in a spreadsheet of side by side results from of
    the output of two independent scanners (ScanCode & Windriver)
    producing SPDX tag:value files created by Philippe Ombredanne.
    Philippe prepared the base worksheet, and did an initial spot review
    of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537
    files assessed. Kate Stewart did a file by file comparison of the
    scanner results in the spreadsheet to determine which SPDX license
    identifier(s) to be applied to the file. She confirmed any
    determination that was not immediately clear with lawyers working with
    the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:

    - Files considered eligible had to be source code files.

    - Make and config files were included as candidates if they contained
    >5 lines of source

    - File already had some variant of a license header in it (even if <5
    lines).

    All documentation files were explicitly excluded.

    The following heuristics were used to determine which SPDX license
    identifiers to apply.

    - when both scanners couldn't find any license traces, file was
    considered to have no license information in it, and the top level
    COPYING file license applied.

    For non */uapi/* files that summary was:

    SPDX license identifier # files
    ---------------------------------------------------|-------
    GPL-2.0 11139

    and resulted in the first patch in this series.

    If that file was a */uapi/* path one, it was "GPL-2.0 WITH
    Linux-syscall-note" otherwise it was "GPL-2.0". Results of that
    was:

    SPDX license identifier # files
    ---------------------------------------------------|-------
    GPL-2.0 WITH Linux-syscall-note 930

    and resulted in the second patch in this series.

    - if a file had some form of licensing information in it, and was one
    of the */uapi/* ones, it was denoted with the Linux-syscall-note if
    any GPL family license was found in the file or had no licensing in
    it (per prior point). Results summary:

    SPDX license identifier # files
    ---------------------------------------------------|------
    GPL-2.0 WITH Linux-syscall-note 270
    GPL-2.0+ WITH Linux-syscall-note 169
    ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
    ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
    LGPL-2.1+ WITH Linux-syscall-note 15
    GPL-1.0+ WITH Linux-syscall-note 14
    ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
    LGPL-2.0+ WITH Linux-syscall-note 4
    LGPL-2.1 WITH Linux-syscall-note 3
    ((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
    ((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1

    and that resulted in the third patch in this series.

    - when the two scanners agreed on the detected license(s), that
    became the concluded license(s).

    - when there was disagreement between the two scanners (one detected
    a license but the other didn't, or they both detected different
    licenses) a manual inspection of the file occurred.

    - In most cases a manual inspection of the information in the file
    resulted in a clear resolution of the license that should apply
    (and which scanner probably needed to revisit its heuristics).

    - When it was not immediately clear, the license identifier was
    confirmed with lawyers working with the Linux Foundation.

    - If there was any question as to the appropriate license identifier,
    the file was flagged for further research and to be revisited later
    in time.

    In total, over 70 hours of logged manual review was done on the
    spreadsheet to determine the SPDX license identifiers to apply to the
    source files by Kate, Philippe, Thomas and, in some cases,
    confirmation by lawyers working with the Linux Foundation.

    Kate also obtained a third independent scan of the 4.13 code base from
    FOSSology, and compared selected files where the other two scanners
    disagreed against that SPDX file, to see if there was new insights.
    The Windriver scanner is based on an older version of FOSSology in
    part, so they are related.

    Thomas did random spot checks in about 500 files from the spreadsheets
    for the uapi headers and agreed with SPDX license identifier in the
    files he inspected. For the non-uapi files Thomas did random spot
    checks in about 15000 files.

    In initial set of patches against 4.14-rc6, 3 files were found to have
    copy/paste license identifier errors, and have been fixed to reflect
    the correct identifier.

    Additionally Philippe spent 10 hours this week doing a detailed manual
    inspection and review of the 12,461 patched files from the initial
    patch version early this week with:

    - a full scancode scan run, collecting the matched texts, detected
    license ids and scores

    - reviewing anything where there was a license detected (about 500+
    files) to ensure that the applied SPDX license was correct

    - reviewing anything where there was no detection but the patch
    license was not GPL-2.0 WITH Linux-syscall-note to ensure that the
    applied SPDX license was correct

    This produced a worksheet with 20 files needing minor correction. This
    worksheet was then exported into 3 different .csv files for the
    different types of files to be modified.

    These .csv files were then reviewed by Greg. Thomas wrote a script to
    parse the csv files and add the proper SPDX tag to the file, in the
    format that the file expected. This script was further refined by Greg
    based on the output to detect more types of files automatically and to
    distinguish between header and source .c files (which need different
    comment types.) Finally Greg ran the script using the .csv files to
    generate the patches.

    Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
    Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
    Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"

    * tag 'spdx_identifiers-4.14-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
    License cleanup: add SPDX license identifier to uapi header files with a license
    License cleanup: add SPDX license identifier to uapi header files with no license
    License cleanup: add SPDX GPL-2.0 license identifier to files with no license

    Linus Torvalds
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

25 Oct, 2017

1 commit

  • For the reinstall prevention, the code I had added compares the
    whole key. It turns out though that iwlwifi firmware doesn't
    provide the TKIP TX MIC key as it's not needed in client mode,
    and thus the comparison will always return false.

    For client mode, thus always zero out the TX MIC key part before
    doing the comparison in order to avoid accepting the reinstall
    of the key with identical encryption and RX MIC key, but not the
    same TX MIC key (since the supplicant provides the real one.)

    Fixes: fdf7cb4185b6 ("mac80211: accept key reinstall without changing anything")
    Signed-off-by: Johannes Berg

    Johannes Berg
     

18 Oct, 2017

2 commits


16 Oct, 2017

1 commit

  • When a key is reinstalled we can reset the replay counters
    etc. which can lead to nonce reuse and/or replay detection
    being impossible, breaking security properties, as described
    in the "KRACK attacks".

    In particular, CVE-2017-13080 applies to GTK rekeying that
    happened in firmware while the host is in D3, with the second
    part of the attack being done after the host wakes up. In
    this case, the wpa_supplicant mitigation isn't sufficient
    since wpa_supplicant doesn't know the GTK material.

    In case this happens, simply silently accept the new key
    coming from userspace but don't take any action on it since
    it's the same key; this keeps the PN replay counters intact.

    Signed-off-by: Johannes Berg

    Johannes Berg
     

06 Sep, 2017

2 commits

  • When an RX BA session is started by the driver, and it has to tell
    mac80211 about it, the corresponding bit in tid_rx_manage_offl gets
    set and the BA session work is scheduled. Upon testing this bit, it
    will call __ieee80211_start_rx_ba_session(), thus deadlocking as it
    already holds the ampdu_mlme.mtx, which that acquires again.

    Fix this by adding ___ieee80211_start_rx_ba_session(), a version of
    the function that requires the mutex already held.

    Cc: stable@vger.kernel.org
    Fixes: 699cb58c8a52 ("mac80211: manage RX BA session offload without SKB queue")
    Reported-by: Matteo Croce
    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • Commit 7a7c0a6438b8 ("mac80211: fix TX aggregation start/stop callback race")
    added a cancellation of the ampdu work after the loop that stopped the
    Tx and Rx BA sessions. However, in some cases, e.g., during HW reconfig,
    the low level driver might call mac80211 APIs to complete the stopping
    of the BA sessions, which would queue the ampdu work to handle the actual
    completion. This work needs to be performed as otherwise mac80211 data
    structures would not be properly synced.

    Fix this by checking if BA session STOP_CB bit is set after the BA session
    cancellation and properly clean the session.

    Signed-off-by: Ilan Peer
    [Johannes: the work isn't flushed because that could do other things we
    don't want, and the locking situation isn't clear]
    Signed-off-by: Johannes Berg

    Ilan peer
     

05 Sep, 2017

4 commits

  • When HW ROC is supported it is possible that after the HW notified
    that the ROC has started, the ROC was cancelled and another ROC was
    added while the hw_roc_start worker is waiting on the mutex (since
    cancelling the ROC and adding another one also holds the same mutex).
    As a result, the hw_roc_start worker will continue to run after the
    new ROC is added but before it is actually started by the HW.
    This may result in notifying userspace that the ROC has started before
    it actually does, or in case of management tx ROC, in an attempt to
    tx while not on the right channel.

    In addition, when the driver will notify mac80211 that the second ROC
    has started, mac80211 will warn that this ROC has already been
    notified.

    Fix this by flushing the hw_roc_start work before cancelling an ROC.

    Cc: stable@vger.kernel.org
    Signed-off-by: Avraham Stern
    Signed-off-by: Luca Coelho
    Signed-off-by: Johannes Berg

    Avraham Stern
     
  • Since drv_wake_tx_queue() is normally called in the TX path, which
    is already in an RCU critical section, we should call it the same
    way in the aggregation code path, so if the driver expects to be
    able to use RCU, it'll already be protected without having to enter
    a nested critical section.

    Additionally, disable soft-IRQs, since not doing so could cause
    issues in a driver that relies on them already being disabled like
    in the other path.

    Fixes: ba8c3d6f16a1 ("mac80211: add an intermediate software queue implementation")
    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • This change adds null pointer check before dereferencing pointer dev on
    netif_tx_start_all_queues() when an interface is added.
    With iTXQ support, netif_tx_start_all_queues() is always called while
    an interface is added. however, the netdev queues are not associated
    and dev is null when the interface is either NL80211_IFTYPE_P2P_DEVICE
    or NL80211_IFTYPE_NAN.

    Signed-off-by: Chunho Lee
    Signed-off-by: Johannes Berg

    Chunho Lee
     
  • VHT MESH support was added, but the order of the IEs
    wasn't enforced. Fix that.

    Signed-off-by: Liad Kaufman
    Signed-off-by: Luca Coelho
    Signed-off-by: Johannes Berg

    Liad Kaufman