🇰🇷 한글 설명
Linux 커널의 nsm 모듈에서 ioctl 호출 시 잠금(lock)을 획득하기 전 오류가 발생하더라도 잠금을 해제하려고 시도하는 취약점이 발견되었습니다. 이로 인해 잘못된 뮤텍스 해제(bad unlock balance)가 발생하여 커널의 안정성이 저해될 수 있습니다.
💡 쉬운 설명
프로그램이 문을 잠그기도 전에 열쇠를 돌려 문을 열려고 시도하는 것과 같은 오류입니다. 이 과정에서 시스템이 혼란을 겪어 오류가 발생하거나 멈출 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
misc: nsm: only unlock nsm_dev on post-lock error paths
nsm_dev_ioctl() jumps to the common out label even when the initial
copy_from_user() fails before nsm->lock has been taken. The error path
then blindly unlocks a mutex that was never acquired.
This issue was found by our static analysis tool and then manually
reviewed against the current tree.
The grounded PoC kept the miscdevice ioctl entry and the pre-lock
copy_from_user(&raw, argp, _IOC_SIZE(cmd)) failure path by issuing
NSM_IOCTL_RAW with an invalid user pointer. That failure reaches the
shared out label before mutex_lock(&nsm->lock). Lockdep reported:
WARNING: bad unlock balance detected!
exploit/193 is trying to release lock (&global_nsm.lock) at:
nsm_dev_ioctl+0x5f/0xcf [vuln_msv]
but there are no more locks to release!
no locks held by exploit/193.
Return immediately on the pre-lock copy_from_user() failure and keep the
common unlock label for the post-lock paths only.
📍 영향받는 시스템
Linux kernel (nsm 모듈이 포함된 버전)
⚔️ 공격 벡터
잘못된 사용자 포인터를 포함한 NSM_IOCTL_RAW ioctl 명령을 호출하여 오류 경로를 유도
🛡️ 대응 방법
커널 패치를 적용하여 copy_from_user 실패 시 즉시 반환하도록 수정된 최신 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인
📊 CVSS Vector String
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
💻 영향받는 소프트웨어
NVIDIA vGPU Guest Driver for Linux