🇰🇷 한글 설명
Linux 커널의 w1: therm 드라이버 내 alarms_store 함수에서 오프바이원(off-by-one) 버퍼 오버플로 취약점이 발견되었습니다. sysfs 버퍼 할당 시 NUL 종료 문자를 고려하지 않아 strcpy() 호출 시 할당된 메모리 범위를 1바이트 초과하여 쓰기가 발생합니다.
💡 쉬운 설명
리눅스 시스템의 온도 조절 관련 기능에서 데이터를 저장할 때, 정해진 방 크기보다 1바이트 더 많은 데이터를 써서 메모리가 넘치는 오류가 있습니다. 이로 인해 시스템이 불안정해지거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
w1: therm: Fix off-by-one buffer overflow in alarms_store
The sysfs buffer passed to alarms_store() is allocated with 'size + 1'
bytes and a NUL terminator is appended. However, the 'size' argument
does not account for this extra byte. The original code then allocated
'size' bytes and used strcpy() to copy 'buf', which always writes one
byte past the allocated buffer since strcpy() copies until the NUL
terminator at index 'size'.
Fix this by parsing the 'buf' parameter directly using simple_strtoll()
without allocating any intermediate memory or string copying. This
removes the overflow while simplifying the code.
📍 영향받는 시스템
w1: therm 드라이버를 사용하는 Linux 커널 버전
⚔️ 공격 벡터
로컬 사용자가 sysfs 인터페이스를 통해 특정 값을 입력하여 메모리 오버플로 유발
🛡️ 대응 방법
커널을 최신 보안 패치가 적용된 버전으로 업데이트하거나, 해당 드라이버의 수정된 코드를 적용
🔧 검증 코드
출력된 커널 버전이 취약점이 해결된 최신 패치 버전인지 확인