🇰🇷 한글 설명
Linux 커널의 posix-clock에서 pc_clock_settime() 함수의 불균형 잠금 취약점입니다. get_clock_desc() 호출 후 에러 경로에서 rwsem 읽기 잠금과 파일 참조 카운트를 제대로 해제하지 않습니다. timespec64_valid_strict() 검사를 먼저 수행하여 해결됩니다.
💡 쉬운 설명
Linux 시스템에서 시간 설정 함수가 제대로 잠금을 풀지 않아 시스템이 응답하지 않을 수 있습니다. 커널 업데이트로 해결할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
posix-clock: posix-clock: Fix unbalanced locking in pc_clock_settime()
If get_clock_desc() succeeds, it calls fget() for the clockid's fd,
and get the clk->rwsem read lock, so the error path should release
the lock to make the lock balance and fput the clockid's fd to make
the refcount balance and release the fd related resource.
However the below commit left the error path locked behind resulting in
unbalanced locking. Check timespec64_valid_strict() before
get_clock_desc() to fix it, because the "ts" is not changed
after that.
[
[email protected]: fixed commit message typo]
📍 영향받는 시스템
Linux kernel (posix-clock 모듈 활성화된 모든 버전)
⚔️ 공격 벡터
로컬 사용자가 posix clock 함수를 호출하여 불균형 잠금 상태 유발
🛡️ 대응 방법
Linux 커널을 최신 버전으로 업데이트하거나 보안 패치 적용
🔧 검증 코드
커널 버전을 확인하고 timespec64_valid_strict() 함수가 pc_clock_settime() 시작 부분에 있으면 패치 적용된 것입니다.
uname -r && grep -q 'timespec64_valid_strict' /usr/src/linux/kernel/time/posix-clock.c 2>/dev/null && echo 'patched' || echo 'check_required'