🇰🇷 한글 설명
Linux 커널의 qcom_battmgr 드라이버에서 펌웨어가 제공하는 문자열을 처리할 때 종료 문자가 누락될 수 있는 취약점이 발견되었습니다. 이로 인해 모델 번호, 일련번호 등의 데이터가 인접한 메모리 영역을 침범하여 사용자 공간으로 노출될 수 있습니다.
💡 쉬운 설명
배터리 정보를 관리하는 프로그램이 펌웨어로부터 잘못된 길이의 정보를 받았을 때, 데이터의 끝을 제대로 구분하지 못하는 문제입니다. 이로 인해 배터리 정보 외에 다른 중요한 메모리 내용이 함께 읽힐 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
power: supply: qcom_battmgr: terminate the strings from firmware
The qcom_battmgr_sc8280xp_strcpy() takes a Pascal-style string when the
firmware sends one. Otherwise it copies all BATTMGR_STRING_LEN bytes and
leaves the destination without a terminator.
Those destinations are model_number, serial_number and oem_info, each
BATTMGR_STRING_LEN and declared next to each other. They go out to user
space as val->strval, which power_supply_format_property() prints with
"%s", so a firmware string that fills the whole field makes that read run
into the following members.
Use strscpy() so the copy always terminates, the way the SM8350 path
already does for the same field.
📍 영향받는 시스템
Linux kernel (qcom_battmgr 드라이버를 사용하는 Qualcomm SC8280XP 기반 시스템)
⚔️ 공격 벡터
조작된 펌웨어를 통해 특정 길이의 문자열을 전달하여 메모리 경계 밖의 데이터를 읽도록 유도
🛡️ 대응 방법
strscpy() 함수를 사용하여 문자열 복사 시 항상 종료 문자가 포함되도록 커널 패치 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인