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 7CD9020B814 for ; Tue, 1 Apr 2025 15:43: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=1743522186; cv=none; b=KKHXpkZ0RWoTM1WtWTfkQ1oMZAWCJ3DK1ZkETHz++aLVas9Ixm9Aj/6ZUK+BYHxNFu04X4wGvpExStbSyCsQFwFs0/MPbhPz+3G/QN/CugKl+dBJG4TW14Uwfp4mItC39LrftbFON6ylltr15wUjncUWYVJ0ovzdJ4+2c2rXwUo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743522186; c=relaxed/simple; bh=MiI68D+00HdT14dXRq6P1KhKjBgplRDcfTvKGo98iqY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=q5zenQXuSc+IlfKBZo6hpovVzCbV1JWq9+3prLLbWGAnveV3YAi3MMp16qNp28pJBicghDYoLgAAM2KrSXQbtroLV4E1TCL3V8rsZve9MonzBg7mnqKFAxxNDKsXjpQpmPprvjgpl3fuYhOfIJvuJyt/sstX5u7jgatIyrB968U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=GyiheOv+; 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="GyiheOv+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16201C4CEE5; Tue, 1 Apr 2025 15:43:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1743522186; bh=MiI68D+00HdT14dXRq6P1KhKjBgplRDcfTvKGo98iqY=; h=From:To:Cc:Subject:Date:Reply-to:From; b=GyiheOv+aXDxKZI6uiUtgX9217kwLgchYQ89U2wU08d36Q2xC9VUeDvRKe0+VzJcv AS3b8vPfgAHIqna6qKdN3Pr/8IhNjBSdezJGuSX3OnOv2h73+bBDu0maKtDjTsLJCw hY6/RsYAGxyxwfPF56ORb/8eTsWGg5rKKjBHb5lY= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-21910: wifi: cfg80211: regulatory: improve invalid hints checking Date: Tue, 1 Apr 2025 16:39:34 +0100 Message-ID: <2025040130-CVE-2025-21910-1f2f@gregkh> X-Mailer: git-send-email 2.49.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=5815; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=MiI68D+00HdT14dXRq6P1KhKjBgplRDcfTvKGo98iqY=; b=owGbwMvMwCRo6H6F97bub03G02pJDOlvODbVhUrMZHG4tkB7ntrj33f+/P8wf9K2VavWuir3h tZwi0lwdsSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBE4toZFhyyqXPUYMoy2HRc /S/31M+rdKe+Y2SYZ7fAV32/kq5C3dXNzFG+/1dP1gnwBgA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: wifi: cfg80211: regulatory: improve invalid hints checking Syzbot keeps reporting an issue [1] that occurs when erroneous symbols sent from userspace get through into user_alpha2[] via regulatory_hint_user() call. Such invalid regulatory hints should be rejected. While a sanity check from commit 47caf685a685 ("cfg80211: regulatory: reject invalid hints") looks to be enough to deter these very cases, there is a way to get around it due to 2 reasons. 1) The way isalpha() works, symbols other than latin lower and upper letters may be used to determine a country/domain. For instance, greek letters will also be considered upper/lower letters and for such characters isalpha() will return true as well. However, ISO-3166-1 alpha2 codes should only hold latin characters. 2) While processing a user regulatory request, between reg_process_hint_user() and regulatory_hint_user() there happens to be a call to queue_regulatory_request() which modifies letters in request->alpha2[] with toupper(). This works fine for latin symbols, less so for weird letter characters from the second part of _ctype[]. Syzbot triggers a warning in is_user_regdom_saved() by first sending over an unexpected non-latin letter that gets malformed by toupper() into a character that ends up failing isalpha() check. Prevent this by enhancing is_an_alpha2() to ensure that incoming symbols are latin letters and nothing else. [1] Syzbot report: ------------[ cut here ]------------ Unexpected user alpha2: A� WARNING: CPU: 1 PID: 964 at net/wireless/reg.c:442 is_user_regdom_saved net/wireless/reg.c:440 [inline] WARNING: CPU: 1 PID: 964 at net/wireless/reg.c:442 restore_alpha2 net/wireless/reg.c:3424 [inline] WARNING: CPU: 1 PID: 964 at net/wireless/reg.c:442 restore_regulatory_settings+0x3c0/0x1e50 net/wireless/reg.c:3516 Modules linked in: CPU: 1 UID: 0 PID: 964 Comm: kworker/1:2 Not tainted 6.12.0-rc5-syzkaller-00044-gc1e939a21eb1 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: events_power_efficient crda_timeout_work RIP: 0010:is_user_regdom_saved net/wireless/reg.c:440 [inline] RIP: 0010:restore_alpha2 net/wireless/reg.c:3424 [inline] RIP: 0010:restore_regulatory_settings+0x3c0/0x1e50 net/wireless/reg.c:3516 ... Call Trace: crda_timeout_work+0x27/0x50 net/wireless/reg.c:542 process_one_work kernel/workqueue.c:3229 [inline] process_scheduled_works+0xa65/0x1850 kernel/workqueue.c:3310 worker_thread+0x870/0xd30 kernel/workqueue.c:3391 kthread+0x2f2/0x390 kernel/kthread.c:389 ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The Linux kernel CVE team has assigned CVE-2025-21910 to this issue. Affected and fixed versions =========================== Issue introduced in 2.6.34 with commit 09d989d179d0c679043556dda77c51b41a2dae7e and fixed in 5.4.291 with commit 62b1a9bbfebba4b4c2bb6c1ede9ef7ecee7a9ff6 Issue introduced in 2.6.34 with commit 09d989d179d0c679043556dda77c51b41a2dae7e and fixed in 5.10.235 with commit da3f599517ef2ea851208df3229d07728d238dc5 Issue introduced in 2.6.34 with commit 09d989d179d0c679043556dda77c51b41a2dae7e and fixed in 5.15.179 with commit 6a5e3b23054cee3b92683d1467e3fa83921f5622 Issue introduced in 2.6.34 with commit 09d989d179d0c679043556dda77c51b41a2dae7e and fixed in 6.1.131 with commit f4112cb477c727a65787a4065a75ca593bb5b2f4 Issue introduced in 2.6.34 with commit 09d989d179d0c679043556dda77c51b41a2dae7e and fixed in 6.6.83 with commit 35ef07112b61b06eb30683a6563c9f6378c02476 Issue introduced in 2.6.34 with commit 09d989d179d0c679043556dda77c51b41a2dae7e and fixed in 6.12.19 with commit be7c5f00aa7f1344293e4d48d0e12be83a2f223d Issue introduced in 2.6.34 with commit 09d989d179d0c679043556dda77c51b41a2dae7e and fixed in 6.13.7 with commit 17aa34c84867f6cd181a5743e1c647e7766962a6 Issue introduced in 2.6.34 with commit 09d989d179d0c679043556dda77c51b41a2dae7e and fixed in 6.14 with commit 59b348be7597c4a9903cb003c69e37df20c04a30 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-2025-21910 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: net/wireless/reg.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/62b1a9bbfebba4b4c2bb6c1ede9ef7ecee7a9ff6 https://git.kernel.org/stable/c/da3f599517ef2ea851208df3229d07728d238dc5 https://git.kernel.org/stable/c/6a5e3b23054cee3b92683d1467e3fa83921f5622 https://git.kernel.org/stable/c/f4112cb477c727a65787a4065a75ca593bb5b2f4 https://git.kernel.org/stable/c/35ef07112b61b06eb30683a6563c9f6378c02476 https://git.kernel.org/stable/c/be7c5f00aa7f1344293e4d48d0e12be83a2f223d https://git.kernel.org/stable/c/17aa34c84867f6cd181a5743e1c647e7766962a6 https://git.kernel.org/stable/c/59b348be7597c4a9903cb003c69e37df20c04a30