Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6296F2FF67C for ; Mon, 15 Sep 2025 14:22:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757946126; cv=none; b=UIom9RFkPt8b2MC6kSJbgu2PUxdt2rSUYCaVhzQgFlrViA77w8RWiouYNcB4Nmns0SpCV3wtljU2w9ZMVhEzIYPA+zqAi466tWoEY46at0Hn+GQqX/AmhK9b07rl94EU5qksMHQc+Dx2jTzVzLC5/pF8llZNK2S8c+8hGLEjmtY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757946126; c=relaxed/simple; bh=6EnXg3d6N+OnyQKCUUIU+M83v54C2uJDtiD/9RdG9j4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Qb+NKoy74PSw9Bd9tzLMJHwhgOavMU5cLAwXjDCtRxLsxDQt9+ECR9sKIuOfo/K8tS75D8SsPc2FaDk/u0zrmtBooegaDs7B/jKLVAsUjE82pkuUCpf9PMk1MoPdcRx3VwMxwZCGMyWNjH9LcTUwa31IVA8krbNYvrj8fweWP5Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=l9Zxq3xi; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="l9Zxq3xi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCF03C4CEF1; Mon, 15 Sep 2025 14:22:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1757946125; bh=6EnXg3d6N+OnyQKCUUIU+M83v54C2uJDtiD/9RdG9j4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=l9Zxq3xintsSO7A2GcrLEPvGCMhdfLanRSaVMiR16QFLvOc1SrIc7cU6d+kwLCy8P yWAO1xi3BRNauB8fdjKJPJLfATDkhewZVREYEUQXlSljWAfbQDReezJZI87PUAA8sl 83+ksL9Pd6VoFB6UjvlHvfAbcCnOZmzjv9MCgx1U= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50279: wifi: rtlwifi: Fix global-out-of-bounds bug in _rtl8812ae_phy_set_txpower_limit() Date: Mon, 15 Sep 2025 16:21:21 +0200 Message-ID: <2025091506-CVE-2022-50279-412b@gregkh> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=4868; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=DQWs8PxqFtx91dcmDkJ3UgxXeoTc8RUTHs8SYWw/CXE=; b=owGbwMvMwCRo6H6F97bub03G02pJDBknFC51m5gt3ZzJPKGtO0j32I37H93n5jFzV/ix19TOt Pj0Z5ZQRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzEX5BhQQfznHUHFvkUFyud uPutksl8ouUOJ4b5IbNZJC7ynPk088bZ45uefPlZ/s7tBgA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: wifi: rtlwifi: Fix global-out-of-bounds bug in _rtl8812ae_phy_set_txpower_limit() There is a global-out-of-bounds reported by KASAN: BUG: KASAN: global-out-of-bounds in _rtl8812ae_eq_n_byte.part.0+0x3d/0x84 [rtl8821ae] Read of size 1 at addr ffffffffa0773c43 by task NetworkManager/411 CPU: 6 PID: 411 Comm: NetworkManager Tainted: G D 6.1.0-rc8+ #144 e15588508517267d37 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), Call Trace: ... kasan_report+0xbb/0x1c0 _rtl8812ae_eq_n_byte.part.0+0x3d/0x84 [rtl8821ae] rtl8821ae_phy_bb_config.cold+0x346/0x641 [rtl8821ae] rtl8821ae_hw_init+0x1f5e/0x79b0 [rtl8821ae] ... The root cause of the problem is that the comparison order of "prate_section" in _rtl8812ae_phy_set_txpower_limit() is wrong. The _rtl8812ae_eq_n_byte() is used to compare the first n bytes of the two strings from tail to head, which causes the problem. In the _rtl8812ae_phy_set_txpower_limit(), it was originally intended to meet this requirement by carefully designing the comparison order. For example, "pregulation" and "pbandwidth" are compared in order of length from small to large, first is 3 and last is 4. However, the comparison order of "prate_section" dose not obey such order requirement, therefore when "prate_section" is "HT", when comparing from tail to head, it will lead to access out of bounds in _rtl8812ae_eq_n_byte(). As mentioned above, the _rtl8812ae_eq_n_byte() has the same function as strcmp(), so just strcmp() is enough. Fix it by removing _rtl8812ae_eq_n_byte() and use strcmp() barely. Although it can be fixed by adjusting the comparison order of "prate_section", this may cause the value of "rate_section" to not be from 0 to 5. In addition, commit "21e4b0726dc6" not only moved driver from staging to regular tree, but also added setting txpower limit function during the driver config phase, so the problem was introduced by this commit. The Linux kernel CVE team has assigned CVE-2022-50279 to this issue. Affected and fixed versions =========================== Issue introduced in 3.18 with commit 21e4b0726dc671c423e2dc9a85364716219c4502 and fixed in 4.19.276 with commit fc3442247716fc426bbcf62ed65e086e48a6d44f Issue introduced in 3.18 with commit 21e4b0726dc671c423e2dc9a85364716219c4502 and fixed in 5.4.235 with commit 28ea268d95e57cdf6394a058f0d854206d478772 Issue introduced in 3.18 with commit 21e4b0726dc671c423e2dc9a85364716219c4502 and fixed in 5.10.173 with commit 1e950b9a841bc96e98ee25680d5c7aa305120be1 Issue introduced in 3.18 with commit 21e4b0726dc671c423e2dc9a85364716219c4502 and fixed in 5.15.99 with commit 0c962dcd6bf64b78eaffc09e497a2beb4e48bc32 Issue introduced in 3.18 with commit 21e4b0726dc671c423e2dc9a85364716219c4502 and fixed in 6.1.16 with commit f1fe40120de6ad4ffa8299fde035a5feba10d4fb Issue introduced in 3.18 with commit 21e4b0726dc671c423e2dc9a85364716219c4502 and fixed in 6.2.3 with commit 057b52461dc005ecd85a3e4998913b1492ec0f72 Issue introduced in 3.18 with commit 21e4b0726dc671c423e2dc9a85364716219c4502 and fixed in 6.3 with commit 117dbeda22ec5ea0918254d03b540ef8b8a64d53 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2022-50279 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/fc3442247716fc426bbcf62ed65e086e48a6d44f https://git.kernel.org/stable/c/28ea268d95e57cdf6394a058f0d854206d478772 https://git.kernel.org/stable/c/1e950b9a841bc96e98ee25680d5c7aa305120be1 https://git.kernel.org/stable/c/0c962dcd6bf64b78eaffc09e497a2beb4e48bc32 https://git.kernel.org/stable/c/f1fe40120de6ad4ffa8299fde035a5feba10d4fb https://git.kernel.org/stable/c/057b52461dc005ecd85a3e4998913b1492ec0f72 https://git.kernel.org/stable/c/117dbeda22ec5ea0918254d03b540ef8b8a64d53