1. 27 Jul, 2024 2 commits
  2. 26 Jul, 2024 9 commits
    • Mark Mentovai's avatar
      net: phy: realtek: add support for RTL8366S Gigabit PHY · 225990c4
      Mark Mentovai authored
      The PHY built in to the Realtek RTL8366S switch controller was
      previously supported by genphy_driver. This PHY does not implement MMD
      operations. Since commit 9b01c885 ("net: phy: c22: migrate to
      genphy_c45_write_eee_adv()"), MMD register reads have been made during
      phy_probe to determine EEE support. For genphy_driver, these reads are
      transformed into 802.3 annex 22D clause 45-over-clause 22
      mmd_phy_indirect operations that perform MII register writes to
      MII_MMD_CTRL and MII_MMD_DATA. This overwrites those two MII registers,
      which on this PHY are reserved and have another function, rendering the
      PHY unusable while so configured.
      
      Proper support for this PHY is restored by providing a phy_driver that
      declares MMD operations as unsupported by using the helper functions
      provided for that purpose, while remaining otherwise identical to
      genphy_driver.
      
      Fixes: 9b01c885 ("net: phy: c22: migrate to genphy_c45_write_eee_adv()")
      Reported-by: default avatarRussell Senior <russell@personaltelco.net>
      Closes: https://github.com/openwrt/openwrt/issues/15981
      Link: https://github.com/openwrt/openwrt/issues/15739Signed-off-by: default avatarMark Mentovai <mark@mentovai.com>
      Reviewed-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      225990c4
    • Johan Hovold's avatar
      wifi: ath12k: fix soft lockup on suspend · a47f3320
      Johan Hovold authored
      The ext interrupts are enabled when the firmware has been started, but
      this may never happen, for example, if the board configuration file is
      missing.
      
      When the system is later suspended, the driver unconditionally tries to
      disable interrupts, which results in an irq disable imbalance and causes
      the driver to spin indefinitely in napi_synchronize().
      
      Make sure that the interrupts have been enabled before attempting to
      disable them.
      
      Fixes: d8899132 ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
      Cc: stable@vger.kernel.org	# 6.3
      Signed-off-by: default avatarJohan Hovold <johan+linaro@kernel.org>
      Acked-by: default avatarJeff Johnson <quic_jjohnson@quicinc.com>
      Link: https://patch.msgid.link/20240709073132.9168-1-johan+linaro@kernel.orgSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      a47f3320
    • Sean Wang's avatar
      wifi: mt76: mt7921: fix null pointer access in mt792x_mac_link_bss_remove · 6557a28f
      Sean Wang authored
      Fix null pointer access in mt792x_mac_link_bss_remove.
      
      To prevent null pointer access, we should assign the vif to bss_conf in
      mt7921_add_interface. This ensures that subsequent operations on the BSS
      can properly reference the correct vif.
      
      [  T843] Call Trace:
      [  T843]  <TASK>
      [  T843]  ? __die+0x1e/0x60
      [  T843]  ? page_fault_oops+0x157/0x450
      [  T843]  ? srso_alias_return_thunk+0x5/0xfbef5
      [  T843]  ? srso_alias_return_thunk+0x5/0xfbef5
      [  T843]  ? search_bpf_extables+0x5a/0x80
      [  T843]  ? srso_alias_return_thunk+0x5/0xfbef5
      [  T843]  ? exc_page_fault+0x2bb/0x670
      [  T843]  ? srso_alias_return_thunk+0x5/0xfbef5
      [  T843]  ? lock_timer_base+0x71/0x90
      [  T843]  ? asm_exc_page_fault+0x26/0x30
      [  T843]  ? mt792x_mac_link_bss_remove+0x24/0x110 [mt792x_lib]
      [  T843]  ? mt792x_remove_interface+0x6e/0x90 [mt792x_lib]
      [  T843]  ? ieee80211_do_stop+0x507/0x7e0 [mac80211]
      [  T843]  ? ieee80211_stop+0x53/0x190 [mac80211]
      [  T843]  ? __dev_close_many+0xa5/0x120
      [  T843]  ? __dev_change_flags+0x18c/0x220
      [  T843]  ? dev_change_flags+0x21/0x60
      [  T843]  ? do_setlink+0xdf9/0x11d0
      [  T843]  ? srso_alias_return_thunk+0x5/0xfbef5
      [  T843]  ? srso_alias_return_thunk+0x5/0xfbef5
      [  T843]  ? security_sock_rcv_skb+0x33/0x50
      [  T843]  ? srso_alias_return_thunk+0x5/0xfbef5
      [  T843]  ? srso_alias_return_thunk+0x5/0xfbef5
      [  T843]  ? __nla_validate_parse+0x61/0xd10
      [  T843]  ? srso_alias_return_thunk+0x5/0xfbef5
      [  T843]  ? genl_done+0x53/0x80
      [  T843]  ? srso_alias_return_thunk+0x5/0xfbef5
      [  T843]  ? netlink_dump+0x357/0x410
      [  T843]  ? __rtnl_newlink+0x5d6/0x980
      [  T843]  ? srso_alias_return_thunk+0x5/0xfbef5
      [  T843]  ? genl_family_rcv_msg_dumpit+0xdf/0xf0
      [  T843]  ? srso_alias_return_thunk+0x5/0xfbef5
      [  T843]  ? __kmalloc_cache_noprof+0x44/0x210
      [  T843]  ? rtnl_newlink+0x42/0x60
      [  T843]  ? rtnetlink_rcv_msg+0x152/0x3f0
      [  T843]  ? mptcp_pm_nl_dump_addr+0x180/0x180
      [  T843]  ? rtnl_calcit.isra.0+0x130/0x130
      [  T843]  ? netlink_rcv_skb+0x56/0x100
      [  T843]  ? netlink_unicast+0x199/0x290
      [  T843]  ? netlink_sendmsg+0x21d/0x490
      [  T843]  ? __sock_sendmsg+0x78/0x80
      [  T843]  ? ____sys_sendmsg+0x23f/0x2e0
      [  T843]  ? srso_alias_return_thunk+0x5/0xfbef5
      [  T843]  ? copy_msghdr_from_user+0x68/0xa0
      [  T843]  ? ___sys_sendmsg+0x81/0xd0
      [  T843]  ? srso_alias_return_thunk+0x5/0xfbef5
      [  T843]  ? crng_fast_key_erasure+0xbc/0xf0
      [  T843]  ? srso_alias_return_thunk+0x5/0xfbef5
      [  T843]  ? get_random_bytes_user+0x126/0x140
      [  T843]  ? srso_alias_return_thunk+0x5/0xfbef5
      [  T843]  ? __fdget+0xb1/0xe0
      [  T843]  ? __sys_sendmsg+0x56/0xa0
      [  T843]  ? srso_alias_return_thunk+0x5/0xfbef5
      [  T843]  ? do_syscall_64+0x5f/0x170
      [  T843]  ? entry_SYSCALL_64_after_hwframe+0x55/0x5d
      [  T843]  </TASK>
      
      Fixes: 1541d63c ("wifi: mt76: mt7925: add mt7925_mac_link_bss_remove to remove per-link BSS")
      Reported-by: default avatarBert Karwatzki <spasswolf@web.de>
      Closes: https://lore.kernel.org/linux-wireless/2fee61f8c903d02a900ca3188c3742c7effd102e.camel@web.de/#bSigned-off-by: default avatarSean Wang <sean.wang@mediatek.com>
      Tested-by: default avatarBert Karwatzki <spasswolf@web.de>
      Link: https://patch.msgid.link/20240718234633.12737-1-sean.wang@kernel.orgSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      6557a28f
    • Baochen Qiang's avatar
      wifi: ath12k: fix reusing outside iterator in ath12k_wow_vif_set_wakeups() · 189d7aae
      Baochen Qiang authored
      Smatch throws below warning:
      
      	drivers/net/wireless/ath/ath12k/wow.c:434 ath12k_wow_vif_set_wakeups()
      	warn: reusing outside iterator: 'i'
      
      	drivers/net/wireless/ath/ath12k/wow.c
      	    411         default:
      	    412                 break;
      	    413         }
      	    414
      	    415         for (i = 0; i < wowlan->n_patterns; i++) {
      	                            ^^^^^^^^^^^^^^^^^^^^^^
      	Here we loop until ->n_patterns
      
      	    416                 const struct cfg80211_pkt_pattern *eth_pattern = &patterns[i];
      	    417                 struct ath12k_pkt_pattern new_pattern = {};
      	    418
      	    419                 if (WARN_ON(eth_pattern->pattern_len > WOW_MAX_PATTERN_SIZE))
      	    420                         return -EINVAL;
      	    421
      	    422                 if (ar->ab->wow.wmi_conf_rx_decap_mode ==
      	    423                     ATH12K_HW_TXRX_NATIVE_WIFI) {
      	    424                         ath12k_wow_convert_8023_to_80211(ar, eth_pattern,
      	    425                                                          &new_pattern);
      	    426
      	    427                         if (WARN_ON(new_pattern.pattern_len > WOW_MAX_PATTERN_SIZE))
      	    428                                 return -EINVAL;
      	    429                 } else {
      	    430                         memcpy(new_pattern.pattern, eth_pattern->pattern,
      	    431                                eth_pattern->pattern_len);
      	    432
      	    433                         /* convert bitmask to bytemask */
      	--> 434                         for (i = 0; i < eth_pattern->pattern_len; i++)
      	    435                                 if (eth_pattern->mask[i / 8] & BIT(i % 8))
      	    436                                         new_pattern.bytemask[i] = 0xff;
      
      	This loop re-uses i and the loop ends with i == eth_pattern->pattern_len.
      	This looks like a bug.
      
      Change to use a new iterator 'j' for the inner loop to fix it.
      
      Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
      
      Fixes: 4a3c212e ("wifi: ath12k: add basic WoW functionalities")
      Reported-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
      Closes: https://lore.kernel.org/all/d4975b95-9c43-45af-a0ab-80253f18c7f2@stanley.mountain/Signed-off-by: default avatarBaochen Qiang <quic_bqiang@quicinc.com>
      Acked-by: default avatarJeff Johnson <quic_jjohnson@quicinc.com>
      Link: https://patch.msgid.link/20240722033332.6273-1-quic_bqiang@quicinc.comSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      189d7aae
    • Johannes Berg's avatar
      wifi: cfg80211: correct S1G beacon length calculation · 6873cc44
      Johannes Berg authored
      The minimum header length calculation (equivalent to the start
      of the elements) for the S1G long beacon erroneously required
      only up to the start of u.s1g_beacon rather than the start of
      u.s1g_beacon.variable. Fix that, and also shuffle the branches
      around a bit to not assign useless values that are overwritten
      later.
      
      Reported-by: syzbot+0f3afa93b91202f21939@syzkaller.appspotmail.com
      Fixes: 9eaffe50 ("cfg80211: convert S1G beacon to scan results")
      Link: https://patch.msgid.link/20240724132912.9662972db7c1.I8779675b5bbda4994cc66f876b6b87a2361c3c0b@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      6873cc44
    • Veerendranath Jakkam's avatar
      wifi: cfg80211: fix reporting failed MLO links status with cfg80211_connect_done · baeaabf9
      Veerendranath Jakkam authored
      Individual MLO links connection status is not copied to
      EVENT_CONNECT_RESULT data while processing the connect response
      information in cfg80211_connect_done(). Due to this failed links
      are wrongly indicated with success status in EVENT_CONNECT_RESULT.
      
      To fix this, copy the individual MLO links status to the
      EVENT_CONNECT_RESULT data.
      
      Fixes: 53ad07e9 ("wifi: cfg80211: support reporting failed links")
      Signed-off-by: default avatarVeerendranath Jakkam <quic_vjakkam@quicinc.com>
      Reviewed-by: default avatarCarlos Llamas <cmllamas@google.com>
      Link: https://patch.msgid.link/20240724125327.3495874-1-quic_vjakkam@quicinc.com
      [commit message editorial changes]
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      baeaabf9
    • Johannes Berg's avatar
      wifi: mac80211: use monitor sdata with driver only if desired · 8f4fa087
      Johannes Berg authored
      In commit 0d9c2bee ("wifi: mac80211: fix monitor channel
      with chanctx emulation") I changed mac80211 to always have an
      internal monitor_sdata to have something to have the chanctx
      bound to.
      
      However, if the driver didn't also have the WANT_MONITOR flag
      this would cause mac80211 to allocate it without telling the
      driver (which was intentional) but also use it for later APIs
      to the driver without it ever having known about it which was
      _not_ intentional.
      
      Check through the code and only use the monitor_sdata in the
      relevant places (TX, MU-MIMO follow settings, TX power, and
      interface iteration) when the WANT_MONITOR flag is set.
      
      Cc: stable@vger.kernel.org
      Fixes: 0d9c2bee ("wifi: mac80211: fix monitor channel with chanctx emulation")
      Reported-by: default avatarZeroBeat <ZeroBeat@gmx.de>
      Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219086Tested-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
      Link: https://patch.msgid.link/20240725184836.25d334157a8e.I02574086da2c5cf0e18264ce5807db6f14ffd9c0@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      8f4fa087
    • Eric Dumazet's avatar
      sched: act_ct: take care of padding in struct zones_ht_key · 2191a54f
      Eric Dumazet authored
      Blamed commit increased lookup key size from 2 bytes to 16 bytes,
      because zones_ht_key got a struct net pointer.
      
      Make sure rhashtable_lookup() is not using the padding bytes
      which are not initialized.
      
       BUG: KMSAN: uninit-value in rht_ptr_rcu include/linux/rhashtable.h:376 [inline]
       BUG: KMSAN: uninit-value in __rhashtable_lookup include/linux/rhashtable.h:607 [inline]
       BUG: KMSAN: uninit-value in rhashtable_lookup include/linux/rhashtable.h:646 [inline]
       BUG: KMSAN: uninit-value in rhashtable_lookup_fast include/linux/rhashtable.h:672 [inline]
       BUG: KMSAN: uninit-value in tcf_ct_flow_table_get+0x611/0x2260 net/sched/act_ct.c:329
        rht_ptr_rcu include/linux/rhashtable.h:376 [inline]
        __rhashtable_lookup include/linux/rhashtable.h:607 [inline]
        rhashtable_lookup include/linux/rhashtable.h:646 [inline]
        rhashtable_lookup_fast include/linux/rhashtable.h:672 [inline]
        tcf_ct_flow_table_get+0x611/0x2260 net/sched/act_ct.c:329
        tcf_ct_init+0xa67/0x2890 net/sched/act_ct.c:1408
        tcf_action_init_1+0x6cc/0xb30 net/sched/act_api.c:1425
        tcf_action_init+0x458/0xf00 net/sched/act_api.c:1488
        tcf_action_add net/sched/act_api.c:2061 [inline]
        tc_ctl_action+0x4be/0x19d0 net/sched/act_api.c:2118
        rtnetlink_rcv_msg+0x12fc/0x1410 net/core/rtnetlink.c:6647
        netlink_rcv_skb+0x375/0x650 net/netlink/af_netlink.c:2550
        rtnetlink_rcv+0x34/0x40 net/core/rtnetlink.c:6665
        netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline]
        netlink_unicast+0xf52/0x1260 net/netlink/af_netlink.c:1357
        netlink_sendmsg+0x10da/0x11e0 net/netlink/af_netlink.c:1901
        sock_sendmsg_nosec net/socket.c:730 [inline]
        __sock_sendmsg+0x30f/0x380 net/socket.c:745
        ____sys_sendmsg+0x877/0xb60 net/socket.c:2597
        ___sys_sendmsg+0x28d/0x3c0 net/socket.c:2651
        __sys_sendmsg net/socket.c:2680 [inline]
        __do_sys_sendmsg net/socket.c:2689 [inline]
        __se_sys_sendmsg net/socket.c:2687 [inline]
        __x64_sys_sendmsg+0x307/0x4a0 net/socket.c:2687
        x64_sys_call+0x2dd6/0x3c10 arch/x86/include/generated/asm/syscalls_64.h:47
        do_syscall_x64 arch/x86/entry/common.c:52 [inline]
        do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f
      
      Local variable key created at:
        tcf_ct_flow_table_get+0x4a/0x2260 net/sched/act_ct.c:324
        tcf_ct_init+0xa67/0x2890 net/sched/act_ct.c:1408
      
      Fixes: 88c67aeb ("sched: act_ct: add netns into the key of tcf_ct_flow_table")
      Reported-by: syzbot+1b5e4e187cc586d05ea0@syzkaller.appspotmail.com
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Xin Long <lucien.xin@gmail.com>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Reviewed-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2191a54f
    • Ma Ke's avatar
      net: usb: sr9700: fix uninitialized variable use in sr_mdio_read · 08f3a5c3
      Ma Ke authored
      It could lead to error happen because the variable res is not updated if
      the call to sr_share_read_word returns an error. In this particular case
      error code was returned and res stayed uninitialized. Same issue also
      applies to sr_read_reg.
      
      This can be avoided by checking the return value of sr_share_read_word
      and sr_read_reg, and propagating the error if the read operation failed.
      
      Found by code review.
      
      Cc: stable@vger.kernel.org
      Fixes: c9b37458 ("USB2NET : SR9700 : One chip USB 1.1 USB2NET SR9700Device Driver Support")
      Signed-off-by: default avatarMa Ke <make24@iscas.ac.cn>
      Reviewed-by: default avatarShigeru Yoshida <syoshida@redhat.com>
      Reviewed-by: default avatarHariprasad Kelam <hkelam@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      08f3a5c3
  3. 25 Jul, 2024 29 commits