🇰🇷 한글 설명
Linux 커널의 gpiochip_add_data_with_key() 함수에서 오류 발생 시 리소스 누수가 발생하는 취약점이 해결되었습니다. 특정 커밋 이후 장치 해제 콜백이 설정되지 않아 오류 처리 과정에서 참조 횟수가 감소하지 않는 문제가 있었습니다.
💡 쉬운 설명
컴퓨터 부품을 제어하는 소프트웨어에서 오류가 났을 때, 사용하던 메모리를 제대로 돌려주지 않고 계속 붙잡고 있는 버그입니다. 이 문제가 지속되면 시스템의 메모리가 점점 부족해질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
gpio: Fix resource leaks on errors in gpiochip_add_data_with_key()
Since commit aab5c6f20023 ("gpio: set device type for GPIO chips"),
`gdev->dev.release` is unset. As a result, the reference count to
`gdev->dev` isn't dropped on the error handling paths.
Drop the reference on errors.
Also reorder the instructions to make the error handling simpler.
Now gpiochip_add_data_with_key() roughly looks like:
>>> Some memory allocation. Go to ERR ZONE 1 on errors.
>>> device_initialize().
gpiodev_release() takes over the responsibility for freeing the
resources of `gdev->dev`. The subsequent error handling paths
shouldn't go through ERR ZONE 1 again which leads to double free.
>>> Some initialization mainly on `gdev`.
>>> The rest of initialization. Go to ERR ZONE 2 on errors.
>>> Chip registration success and exit.
>>> ERR ZONE 2. gpio_device_put() and exit.
>>> ERR ZONE 1.
📍 영향받는 시스템
Linux Kernel (commit aab5c6f20023 이후 버전 중 해당 패치가 적용되지 않은 버전)
⚔️ 공격 벡터
로컬 공격자가 특정 GPIO 관련 시스템 호출을 반복하여 메모리 누수를 유도할 수 있음
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 수정된 패치 버전인지 확인하십시오.