🇰🇷 한글 설명
Linux 커널 cfg80211 무선 규제 모듈에서, 사용자 공간으로부터 전달된 잘못된 국가 코드가 검증을 우회해 user_alpha2[]에 저장될 수 있는 문제가 수정되었습니다. isalpha()가 라틴 문자 외의 문자도 허용하고, toupper() 변환 과정에서 문자가 변형되어 경고(WARNING)가 발생하는 결함이며, is_an_alpha2()를 강화해 라틴 알파벳만 허용하도록 보완되었습니다.
💡 쉬운 설명
무선 랜 규제 설정에 잘못된 국가 코드가 들어가면 커널이 경고를 띄우고 오작동할 수 있습니다. 이번 수정으로 라틴 알파벳이 아닌 잘못된 입력은 거부되도록 막혔습니다.
🇺🇸 원문 (English)
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:
<TASK>
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
</TASK>
📍 영향받는 시스템
패치 적용 전 Linux 커널(cfg80211 무선 규제 기능을 사용하는 무선 랜 장치가 있는 시스템)
⚔️ 공격 벡터
로컬 사용자 공간 프로세스가 잘못된 문자로 된 규제 힌트를 전달해 커널 경고(WARNING)를 유발하고 서비스 거부 상태를 만들 수 있음
🛡️ 대응 방법
배포판 제공 최신 Linux 커널로 업데이트하고 재부팅하여 수정 사항을 적용
🔧 검증 코드
출력된 커널 버전이 배포판의 보안 업데이트된 패치 버전(해당 CVE 수정 포함)과 같거나 높은지 배포판 보안 공지와 대조해 확인