🇰🇷 한글 설명
Linux 커널의 cxl 드라이버에서 cxl_register_afu/adapter() 함수 실패 시 device_register()가 실패했는데도 device_unregister()를 호출하여 등록되지 않은 장치를 제거하려다 NULL 포인터 역참조가 발생할 수 있습니다. 이를 해결하기 위해 device_del()과 put_device()로 나누어 에러 경로에서 put_device()를 사용하도록 수정되었습니다.
💡 쉬운 설명
Linux 커널의 CXL 장치 등록 실패 처리 과정에서 아직 등록되지 않은 장치를 제거하려 해서 시스템이 비정상 동작할 수 있는 결함입니다. 커널 업데이트로 올바른 해제 절차가 적용되어 해결됩니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
cxl: fix possible null-ptr-deref in cxl_guest_init_afu|adapter()
If device_register() fails in cxl_register_afu|adapter(), the device
is not added, device_unregister() can not be called in the error path,
otherwise it will cause a null-ptr-deref because of removing not added
device.
As comment of device_register() says, it should use put_device() to give
up the reference in the error path. So split device_unregister() into
device_del() and put_device(), then goes to put dev when register fails.
📍 영향받는 시스템
CXL 드라이버를 포함한 수정 이전의 Linux 커널 버전 (CXL 하드웨어 사용 환경)
⚔️ 공격 벡터
로컬 환경에서 CXL 장치 등록 실패 상황을 유발해야 하며, 원격 공격 경로는 명확하지 않음
🛡️ 대응 방법
배포판 제공 커널을 CVE-2022-50481 수정이 포함된 최신 버전으로 업데이트하고 재부팅
🔧 검증 코드
커널 버전이 수정 패치가 포함된 버전 이상인지 배포판 보안 공지와 대조하고, cxl 모듈이 로드되지 않았다면 해당 취약점 영향이 없음을 의미합니다.
uname -r && (grep -i cxl /proc/modules 2>/dev/null || echo 'cxl 모듈 미로드')