20 Jan, 2021

1 commit

  • [ Upstream commit 152a8a6c017bfdeda7f6d052fbc6e151891bd9b6 ]

    Without crc32 support, this fails to link:

    arm-linux-gnueabi-ld: net/wireless/scan.o: in function `cfg80211_scan_6ghz':
    scan.c:(.text+0x928): undefined reference to `crc32_le'

    Fixes: c8cb5b854b40 ("nl80211/cfg80211: support 6 GHz scanning")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Arnd Bergmann
     

30 Dec, 2020

1 commit

  • [ Upstream commit ba5c25236bc3d399df82ebe923490ea8d2d35cf2 ]

    The for-loop iterates with a u8 loop counter and compares this
    with the loop upper limit of request->n_ssids which is an int type.
    There is a potential infinite loop if n_ssids is larger than the
    u8 loop counter, so fix this by making the loop counter an int.

    Addresses-Coverity: ("Infinite loop")
    Fixes: c8cb5b854b40 ("nl80211/cfg80211: support 6 GHz scanning")
    Signed-off-by: Colin Ian King
    Link: https://lore.kernel.org/r/20201029222407.390218-1-colin.king@canonical.com
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin

    Colin Ian King
     

26 Dec, 2020

1 commit

  • commit 2d9463083ce92636a1bdd3e30d1236e3e95d859e upstream.

    syzbot discovered a bug in which an OOB access was being made because
    an unsuitable key_idx value was wrongly considered to be acceptable
    while deleting a key in nl80211_del_key().

    Since we don't know the cipher at the time of deletion, if
    cfg80211_validate_key_settings() were to be called directly in
    nl80211_del_key(), even valid keys would be wrongly determined invalid,
    and deletion wouldn't occur correctly.
    For this reason, a new function - cfg80211_valid_key_idx(), has been
    created, to determine if the key_idx value provided is valid or not.
    cfg80211_valid_key_idx() is directly called in 2 places -
    nl80211_del_key(), and cfg80211_validate_key_settings().

    Reported-by: syzbot+49d4cab497c2142ee170@syzkaller.appspotmail.com
    Tested-by: syzbot+49d4cab497c2142ee170@syzkaller.appspotmail.com
    Suggested-by: Johannes Berg
    Signed-off-by: Anant Thazhemadam
    Link: https://lore.kernel.org/r/20201204215825.129879-1-anant.thazhemadam@gmail.com
    Cc: stable@vger.kernel.org
    [also disallow IGTK key IDs if no IGTK cipher is supported]
    Signed-off-by: Johannes Berg
    Signed-off-by: Greg Kroah-Hartman

    Anant Thazhemadam
     

04 Dec, 2020

1 commit

  • In case we have old supplicant, the akm field is uninitialized.

    Signed-off-by: Sara Sharon
    Signed-off-by: Luca Coelho
    Link: https://lore.kernel.org/r/iwlwifi.20201129172929.930f0ab7ebee.Ic546e384efab3f4a89f318eafddc3eb7d556aecb@changeid
    Signed-off-by: Johannes Berg

    Sara Sharon
     

30 Oct, 2020

2 commits

  • Fix follow warning:
    [net/wireless/reg.c:3619]: (warning) %d in format string (no. 2)
    requires 'int' but the argument type is 'unsigned int'.

    Reported-by: Hulk Robot
    Signed-off-by: Ye Bin
    Link: https://lore.kernel.org/r/20201009070215.63695-1-yebin10@huawei.com
    Signed-off-by: Johannes Berg

    Ye Bin
     
  • There's a race condition in the netdev registration in that
    NETDEV_REGISTER actually happens after the netdev is available,
    and so if we initialize things only there, we might get called
    with an uninitialized wdev through nl80211 - not using a wdev
    but using a netdev interface index.

    I found this while looking into a syzbot report, but it doesn't
    really seem to be related, and unfortunately there's no repro
    for it (yet). I can't (yet) explain how it managed to get into
    cfg80211_release_pmsr() from nl80211_netlink_notify() without
    the wdev having been initialized, as the latter only iterates
    the wdevs that are linked into the rdev, which even without the
    change here happened after init.

    However, looking at this, it seems fairly clear that the init
    needs to be done earlier, otherwise we might even re-init on a
    netns move, when data might still be pending.

    Signed-off-by: Johannes Berg
    Link: https://lore.kernel.org/r/20201009135821.fdcbba3aad65.Ie9201d91dbcb7da32318812effdc1561aeaf4cdc@changeid
    Signed-off-by: Johannes Berg

    Johannes Berg
     

11 Oct, 2020

1 commit


09 Oct, 2020

1 commit


08 Oct, 2020

2 commits

  • In nl80211_parse_key(), key.idx is first initialized as -1.
    If this value of key.idx remains unmodified and gets returned, and
    nl80211_key_allowed() also returns 0, then rdev_del_key() gets called
    with key.idx = -1.
    This causes an out-of-bounds array access.

    Handle this issue by checking if the value of key.idx after
    nl80211_parse_key() is called and return -EINVAL if key.idx < 0.

    Cc: stable@vger.kernel.org
    Reported-by: syzbot+b1bb342d1d097516cbda@syzkaller.appspotmail.com
    Tested-by: syzbot+b1bb342d1d097516cbda@syzkaller.appspotmail.com
    Signed-off-by: Anant Thazhemadam
    Link: https://lore.kernel.org/r/20201007035401.9522-1-anant.thazhemadam@gmail.com
    Signed-off-by: Johannes Berg

    Anant Thazhemadam
     
  • As discovered by syzbot, cfg80211 was accepting S1G
    channel widths on non-S1G bands. Add a check for this, and
    consolidate the 1MHz frequency check as it ends up being a
    subset of the others.

    Reported-by: syzbot+92715a0eccd6c881bc32@syzkaller.appspotmail.com
    Fixes: 11b34737b18a ("nl80211: support setting S1G channels")
    Signed-off-by: Thomas Pedersen
    Link: https://lore.kernel.org/r/20201005165122.17583-1-thomas@adapt-ip.com
    Signed-off-by: Johannes Berg

    Thomas Pedersen
     

03 Oct, 2020

1 commit


02 Oct, 2020

2 commits

  • When dumping wiphy information, we try to split the data into
    many submessages, but for old userspace we still support the
    old mode where this doesn't happen.

    However, in this case we were not resetting our state correctly
    and dumping multiple messages for each wiphy, which would have
    broken such older userspace.

    This was broken pretty much immediately afterwards because it
    only worked in the original commit where non-split dumps didn't
    have any more data than split dumps...

    Fixes: fe1abafd942f ("nl80211: re-add channel width and extended capa advertising")
    Signed-off-by: Johannes Berg
    Link: https://lore.kernel.org/r/20200928130717.3e6d9c6bada2.Ie0f151a8d0d00a8e1e18f6a8c9244dd02496af67@changeid
    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • When wiphy dumps cannot be split, such as in events or with
    older userspace that doesn't support it, the size can today
    be too big.

    Reduce it, by doing two things:

    1) remove data that couldn't have been present before the
    split capability was introduced since it's new, such as
    HE capabilities

    2) as suggested by Martin Willi, remove management frame
    subtypes from the split dumps, as just (1) isn't even
    enough due to other new code capabilities. This is fine
    as old consumers (really just wpa_supplicant) didn't
    check this data before they got support for split dumps.

    Reported-by: Martin Willi
    Suggested-by: Martin Willi
    Signed-off-by: Johannes Berg
    Tested-by: Martin Willi
    Link: https://lore.kernel.org/r/20200928130655.53bce7873164.I71f06c9a221cd0630429a1a56eeae68a13beca61@changeid
    Signed-off-by: Johannes Berg

    Johannes Berg
     

28 Sep, 2020

10 commits

  • Allow the user to configure below Spatial Reuse Parameter Set element.
    * Non-SRG OBSS PD Max Offset
    * SRG BSS Color Bitmap
    * SRG Partial BSSID Bitmap

    Signed-off-by: Rajkumar Manoharan
    Link: https://lore.kernel.org/r/1601278091-20313-2-git-send-email-rmanohar@codeaurora.org
    Signed-off-by: Johannes Berg

    Rajkumar Manoharan
     
  • The SRG min and max offset won't present when SRG Information Present of
    SR control field of Spatial Reuse Parameter Set element set to 0. Per
    spec. IEEE802.11ax D7.0, SRG OBSS PD Min Offset ≤ SRG OBSS PD Max
    Offset. Hence fix the constrain check to allow same values in both
    offset and also call appropriate nla_get function to read the values.

    Fixes: 796e90f42b7e ("cfg80211: add support for parsing OBBS_PD attributes")
    Signed-off-by: Rajkumar Manoharan
    Link: https://lore.kernel.org/r/1601278091-20313-1-git-send-email-rmanohar@codeaurora.org
    Signed-off-by: Johannes Berg

    Rajkumar Manoharan
     
  • The the __freq_reg_info() never returns NULL and the callers don't check
    for NULL. This initialization to set "reg_rule = NULL;" is just there
    to make GCC happy but it's not required in current GCCs.

    The problem is that Smatch sees the initialization and concludes that
    this function can return NULL so it complains that the callers are not
    checking for it.

    Smatch used to be able to parse this correctly but we recently changed
    the code from:

    - for (bw = MHZ_TO_KHZ(20); bw >= min_bw; bw = bw / 2) {
    + for (bw = MHZ_TO_KHZ(bws[i]); bw >= min_bw; bw = MHZ_TO_KHZ(bws[i--])) {

    Originally Smatch used to understand that this code always iterates
    through the loop once, but the change from "MHZ_TO_KHZ(20)" to
    "MHZ_TO_KHZ(bws[i])" is too complicated for Smatch.

    Signed-off-by: Dan Carpenter
    Link: https://lore.kernel.org/r/20200923084203.GC1454948@mwanda
    Signed-off-by: Johannes Berg

    Dan Carpenter
     
  • Recently channels gained a potential frequency offset, so
    include this in the per-channel survey info.

    Signed-off-by: Thomas Pedersen
    Link: https://lore.kernel.org/r/20200922022818.15855-16-thomas@adapt-ip.com
    [add the offset only if non-zero]
    Signed-off-by: Johannes Berg

    Thomas Pedersen
     
  • The sending STA type is implicit based on beacon or probe
    response content. If sending STA was an S1G STA, adjust
    the Information Element location accordingly.

    Signed-off-by: Thomas Pedersen
    Link: https://lore.kernel.org/r/20200922022818.15855-9-thomas@adapt-ip.com
    Signed-off-by: Johannes Berg

    Thomas Pedersen
     
  • Extract the BSS primary channel from the S1G Operation
    element.

    Signed-off-by: Thomas Pedersen
    Link: https://lore.kernel.org/r/20200922022818.15855-7-thomas@adapt-ip.com
    [remove the goto bits]
    Signed-off-by: Johannes Berg

    Thomas Pedersen
     
  • The S1G beacon is an extension frame as opposed to
    management frame for the regular beacon. This means we may
    have to occasionally cast the frame buffer to a different
    header type. Luckily this isn't too bad as scan results
    mostly only care about the IEs.

    Signed-off-by: Thomas Pedersen
    Link: https://lore.kernel.org/r/20200922022818.15855-6-thomas@adapt-ip.com
    Signed-off-by: Johannes Berg

    Thomas Pedersen
     
  • NL80211_ATTR_S1G_CAPABILITY can be passed along with
    NL80211_ATTR_S1G_CAPABILITY_MASK to NL80211_CMD_ASSOCIATE
    to indicate S1G capabilities which should override the
    hardware capabilities in eg. the association request.

    Signed-off-by: Thomas Pedersen
    Link: https://lore.kernel.org/r/20200922022818.15855-4-thomas@adapt-ip.com
    [johannes: always require both attributes together, commit message]
    Signed-off-by: Johannes Berg

    Thomas Pedersen
     
  • The vendor namespaces argument isn't described here, add it.

    Signed-off-by: Johannes Berg
    Link: https://lore.kernel.org/r/20200924192511.2bf5cc761d3a.I9b4579ab3eebe3d7889b59eea8fa50d683611bab@changeid
    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • Support 6 GHz scanning, by
    * a new scan flag to scan for colocated BSSes advertised
    by (and found) APs on 2.4 & 5 GHz
    * doing the necessary reduced neighbor report parsing for
    this, to find them
    * adding the ability to split the scan request in case the
    device by itself cannot support this.

    Also add some necessary bits in mac80211 to not break with
    these changes.

    Signed-off-by: Tova Mussai
    Signed-off-by: Johannes Berg
    Link: https://lore.kernel.org/r/20200918113313.232917c93af9.Ida22f0212f9122f47094d81659e879a50434a6a2@changeid
    Signed-off-by: Johannes Berg

    Tova Mussai
     

23 Sep, 2020

1 commit

  • Two minor conflicts:

    1) net/ipv4/route.c, adding a new local variable while
    moving another local variable and removing it's
    initial assignment.

    2) drivers/net/dsa/microchip/ksz9477.c, overlapping changes.
    One pretty prints the port mode differently, whilst another
    changes the driver to try and obtain the port mode from
    the port node rather than the switch node.

    Signed-off-by: David S. Miller

    David S. Miller
     

18 Sep, 2020

9 commits

  • This patch adds new attributes to support unsolicited broadcast
    probe response transmission used for in-band
    discovery in 6GHz band (IEEE P802.11ax/D6.0 26.17.2.3.2, AP behavior for
    fast passive scanning).
    The new attribute, NL80211_ATTR_UNSOL_BCAST_PROBE_RESP, is nested which
    supports following parameters:
    (1) NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT - Packet interval
    (2) NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL - Template data

    Signed-off-by: Aloka Dixit
    Link: https://lore.kernel.org/r/010101747a946698-aac263ae-2ed3-4dab-9590-0bc7131214e1-000000@us-west-2.amazonses.com
    Signed-off-by: Johannes Berg

    Aloka Dixit
     
  • FILS discovery attribute, NL80211_ATTR_FILS_DISCOVERY, is nested which
    supports following parameters as given in IEEE Std 802.11ai-2016,
    Annex C.3 MIB detail:
    (1) NL80211_FILS_DISCOVERY_ATTR_INT_MIN - Minimum packet interval
    (2) NL80211_FILS_DISCOVERY_ATTR_INT_MAX - Maximum packet interval
    (3) NL80211_FILS_DISCOVERY_ATTR_TMPL - Template data

    Signed-off-by: Aloka Dixit
    Link: https://lore.kernel.org/r/20200805011838.28166-2-alokad@codeaurora.org
    [fix attribute and other names, use NLA_RANGE(), use policy only once]
    Link: https://lore.kernel.org/r/010101747a7b38a8-306f06b2-9061-4baf-81c1-054a42a18e22-000000@us-west-2.amazonses.com
    Signed-off-by: Johannes Berg

    Aloka Dixit
     
  • S1G channels have a single width defined per frequency, so
    derive it from the channel flags with
    ieee80211_s1g_channel_width().

    Also support setting an S1G channel where control frequency may
    differ from operating, and add some basic validation to
    ensure the control channel is with the operating.

    Signed-off-by: Thomas Pedersen
    Link: https://lore.kernel.org/r/20200908190323.15814-6-thomas@adapt-ip.com
    Signed-off-by: Johannes Berg

    Thomas Pedersen
     
  • The S1G beacon has a different header size than regular
    beacons, so adjust the beacon head validator.

    Signed-off-by: Thomas Pedersen
    Link: https://lore.kernel.org/r/20200908190323.15814-5-thomas@adapt-ip.com
    Signed-off-by: Johannes Berg

    Thomas Pedersen
     
  • S1G channels have a minimum bandwidth of 1Mhz, and there
    is a 1:1 mapping of allowed bandwidth to channel number.

    Signed-off-by: Thomas Pedersen
    Link: https://lore.kernel.org/r/20200908190323.15814-4-thomas@adapt-ip.com
    Signed-off-by: Johannes Berg

    Thomas Pedersen
     
  • S1G supports 5 channel widths: 1, 2, 4, 8, and 16. One
    channel width is allowed per frequency in each operating
    class, so it makes more sense to advertise the specific
    channel width allowed.

    Signed-off-by: Thomas Pedersen
    Link: https://lore.kernel.org/r/20200908190323.15814-3-thomas@adapt-ip.com
    Signed-off-by: Johannes Berg

    Thomas Pedersen
     
  • There is no caller in tree any more.

    Signed-off-by: YueHaibing
    Link: https://lore.kernel.org/r/20200829115506.17828-1-yuehaibing@huawei.com
    Signed-off-by: Johannes Berg

    YueHaibing
     
  • We shouldn't accept any channels bigger than 233, fix that.

    Reported-by: Amar
    Fixes: d1a1646c0de7 ("cfg80211: adapt to new channelization of the 6GHz band")
    Signed-off-by: Johannes Berg
    Link: https://lore.kernel.org/r/20200917115222.312ba6f1d461.I3a8c8fbcc3cc019814fd9cd0aced7eb591626136@changeid
    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • When LIB80211_CRYPT_CCMP is enabled and CRYPTO is disabled, it results in unmet
    direct dependencies config warning. The reason is that LIB80211_CRYPT_CCMP
    selects CRYPTO_AES and CRYPTO_CCM, which are subordinate to CRYPTO. This is
    reproducible with CRYPTO disabled and R8188EU enabled, where R8188EU selects
    LIB80211_CRYPT_CCMP but does not select or depend on CRYPTO.

    Honor the kconfig menu hierarchy to remove kconfig dependency warnings.

    Fixes: a11e2f85481c ("lib80211: use crypto API ccm(aes) transform for CCMP processing")
    Signed-off-by: Necip Fazil Yildiran
    Link: https://lore.kernel.org/r/20200909095452.3080-1-fazilyildiran@gmail.com
    Signed-off-by: Johannes Berg

    Necip Fazil Yildiran
     

05 Sep, 2020

1 commit

  • We got slightly different patches removing a double word
    in a comment in net/ipv4/raw.c - picked the version from net.

    Simple conflict in drivers/net/ethernet/ibm/ibmvnic.c. Use cached
    values instead of VNIC login response buffer (following what
    commit 507ebe6444a4 ("ibmvnic: Fix use-after-free of VNIC login
    response buffer") did).

    Signed-off-by: Jakub Kicinski

    Jakub Kicinski
     

04 Sep, 2020

1 commit

  • Pull networking fixes from David Miller:

    1) Use netif_rx_ni() when necessary in batman-adv stack, from Jussi
    Kivilinna.

    2) Fix loss of RTT samples in rxrpc, from David Howells.

    3) Memory leak in hns_nic_dev_probe(), from Dignhao Liu.

    4) ravb module cannot be unloaded, fix from Yuusuke Ashizuka.

    5) We disable BH for too lokng in sctp_get_port_local(), add a
    cond_resched() here as well, from Xin Long.

    6) Fix memory leak in st95hf_in_send_cmd, from Dinghao Liu.

    7) Out of bound access in bpf_raw_tp_link_fill_link_info(), from
    Yonghong Song.

    8) Missing of_node_put() in mt7530 DSA driver, from Sumera
    Priyadarsini.

    9) Fix crash in bnxt_fw_reset_task(), from Michael Chan.

    10) Fix geneve tunnel checksumming bug in hns3, from Yi Li.

    11) Memory leak in rxkad_verify_response, from Dinghao Liu.

    12) In tipc, don't use smp_processor_id() in preemptible context. From
    Tuong Lien.

    13) Fix signedness issue in mlx4 memory allocation, from Shung-Hsi Yu.

    14) Missing clk_disable_prepare() in gemini driver, from Dan Carpenter.

    15) Fix ABI mismatch between driver and firmware in nfp, from Louis
    Peens.

    * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (110 commits)
    net/smc: fix sock refcounting in case of termination
    net/smc: reset sndbuf_desc if freed
    net/smc: set rx_off for SMCR explicitly
    net/smc: fix toleration of fake add_link messages
    tg3: Fix soft lockup when tg3_reset_task() fails.
    doc: net: dsa: Fix typo in config code sample
    net: dp83867: Fix WoL SecureOn password
    nfp: flower: fix ABI mismatch between driver and firmware
    tipc: fix shutdown() of connectionless socket
    ipv6: Fix sysctl max for fib_multipath_hash_policy
    drivers/net/wan/hdlc: Change the default of hard_header_len to 0
    net: gemini: Fix another missing clk_disable_unprepare() in probe
    net: bcmgenet: fix mask check in bcmgenet_validate_flow()
    amd-xgbe: Add support for new port mode
    net: usb: dm9601: Add USB ID of Keenetic Plus DSL
    vhost: fix typo in error message
    net: ethernet: mlx4: Fix memory allocation in mlx4_buddy_init()
    pktgen: fix error message with wrong function name
    net: ethernet: ti: am65-cpsw: fix rmii 100Mbit link mode
    cxgb4: fix thermal zone device registration
    ...

    Linus Torvalds
     

27 Aug, 2020

5 commits

  • Let drivers advertise support for AP-mode SAE authentication offload
    with a new NL80211_EXT_FEATURE_SAE_OFFLOAD_AP flag.

    Signed-off-by: Chung-Hsien Hsu
    Signed-off-by: Chi-Hsien Lin
    Link: https://lore.kernel.org/r/20200817073316.33402-4-stanley.hsu@cypress.com
    Signed-off-by: Johannes Berg

    Chung-Hsien Hsu
     
  • We want to reuse the attributes for other counters such as BSS color
    change. Rename them to more generic names.

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

    John Crispin
     
  • This patch adds the nl80211 structs, definitions, policies and parsing
    code required to pass fixed HE rate, GI and LTF settings.

    Signed-off-by: Miles Hu
    Signed-off-by: John Crispin
    Link: https://lore.kernel.org/r/20200804081630.2013619-1-john@phrozen.org
    [fix comment]
    Signed-off-by: Johannes Berg

    Miles Hu
     
  • Some usable channels are located in the union of adjacent
    regulatory rules, for example channel 144 in Germany.

    Enable them, by also checking if a channel spans two adjacent
    regulatory rules/frequency ranges.

    All flags involved are disabling things, therefore we can build
    the maximum by or-ing them together. Furthermore, take the maximum
    of DFS CAC time values and the minimum of allowed power of both
    adjacent channels in order to comply with both regulatory rules at
    the same time.

    Signed-off-by: Markus Theil
    Link: https://lore.kernel.org/r/20200803144353.305538-2-markus.theil@tu-ilmenau.de
    [remove unrelated comment changes]
    Signed-off-by: Johannes Berg

    Markus Theil
     
  • As a preparation to handle adjacent rule channels,
    factor out handling channels located in a single
    regulatory rule.

    Signed-off-by: Markus Theil
    Link: https://lore.kernel.org/r/20200803144353.305538-1-markus.theil@tu-ilmenau.de
    Signed-off-by: Johannes Berg

    Markus Theil