🇰🇷 한글 설명
리눅스 커널의 OF(Open Firmware) 레이어에서 장치 제거와 OF 노드 파괴 과정 사이의 동기화 문제로 인해 발생합니다. 장치 제거 작업이 비동기적으로 처리되는 과정에서 참조 횟수(refcount) 관리가 어긋나 메모리 누수 경고가 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터 부품을 제거하는 과정에서 소프트웨어가 부품이 완전히 사라졌는지 확인하지 않고 다음 작업을 진행하여 발생하는 문제입니다. 이로 인해 시스템 메모리가 제대로 정리되지 않고 낭비될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
of: dynamic: Synchronize of_changeset_destroy() with the devlink removals
In the following sequence:
1) of_platform_depopulate()
2) of_overlay_remove()
During the step 1, devices are destroyed and devlinks are removed.
During the step 2, OF nodes are destroyed but
__of_changeset_entry_destroy() can raise warnings related to missing
of_node_put():
ERROR: memory leak, expected refcount 1 instead of 2 ...
Indeed, during the devlink removals performed at step 1, the removal
itself releasing the device (and the attached of_node) is done by a job
queued in a workqueue and so, it is done asynchronously with respect to
function calls.
When the warning is present, of_node_put() will be called but wrongly
too late from the workqueue job.
In order to be sure that any ongoing devlink removals are done before
the of_node destruction, synchronize the of_changeset_destroy() with the
devlink removals.
📍 영향받는 시스템
Linux Kernel (of: dynamic 관련 모듈 사용 시스템)
⚔️ 공격 벡터
로컬 시스템에서 장치 드라이버나 OF 오버레이를 조작하여 메모리 누수를 유발하는 방식
🛡️ 대응 방법
리눅스 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 of_changeset_destroy()와 devlink 제거 간의 동기화를 적용해야 합니다.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인합니다.