🇰🇷 한글 설명
Linux 커널의 hwmon 모듈 내 pec_store 함수에서 Use-After-Free(UAF) 취약점이 발견되었습니다. 칩 쓰기 작업 중 오류가 발생할 경우 뮤텍스(mutex)가 해제되기 전에 장치 객체가 먼저 해제되어, 이후 뮤텍스 잠금 해제 시 해제된 메모리에 접근을 시도하는 문제가 있습니다.
💡 쉬운 설명
컴퓨터 부품을 제어하는 프로그램에서 작업 도중 오류가 나면, 이미 삭제된 메모리 영역을 다시 건드리려다 시스템이 충돌하거나 보안 문제가 생길 수 있는 결함입니다. 이를 방지하기 위해 메모리 관리 방식을 더 안전한 코드로 수정했습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
hwmon: Fix potential UAF in pec_store
Sashiko reports:
In pec_store(), a guard(mutex)(&hwdev->lock) is taken. If the chip write
operation returns an error other than -EOPNOTSUPP, the code jumps to the
put label, which calls put_device(hdev). If this drops the final reference,
the device is freed. When the function then returns, the guard cleanup
function runs and attempts to unlock the freed mutex.
Use scoped_guard() instead of guard() to avoid the problem.
📍 영향받는 시스템
Linux kernel (hwmon 모듈을 사용하는 시스템)
⚔️ 공격 벡터
특정 하드웨어 제어 명령을 통해 의도적인 오류를 유발하여 메모리 해제 후 접근(UAF) 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트 (guard 대신 scoped_guard 사용 적용 버전)
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인하십시오.