🇰🇷 한글 설명
Linux 커널의 RDMA/rtrs 구성 요소에서 rtrs_srv_create_path_files() 함수 실행 중 오류가 발생할 경우, 메모리 해제 후 해당 메모리에 다시 접근하는 Use-After-Free 취약점이 존재합니다. sysfs 루트 폴더를 정리하기 전에 kobject_put()을 먼저 호출하여 srv_path 객체가 해제되기 때문에 발생합니다.
💡 쉬운 설명
시스템이 작업을 수행하다가 오류가 났을 때, 이미 사용이 끝난 메모리 공간을 다시 건드려서 발생하는 문제입니다. 이로 인해 시스템이 갑자기 멈추거나 해커가 시스템 권한을 탈취할 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
RDMA/rtrs: Fix use-after-free in path file creation cleanup
In the error path of rtrs_srv_create_path_files(), the sysfs root folders
may already have been created and srv_path->kobj may already have been
initialized. If a later step fails, the cleanup currently calls
kobject_put(&srv_path->kobj) before
rtrs_srv_destroy_once_sysfs_root_folders(srv_path).
kobject_put() may drop the last reference to srv_path->kobj and invoke the
release callback, rtrs_srv_release(), which frees srv_path. The following
call to rtrs_srv_destroy_once_sysfs_root_folders(srv_path) then
dereferences srv_path internally to access srv_path->srv, resulting in a
use-after-free.
This failure path is reached before rtrs_srv_create_path_files() returns
success, so the successful-path lifetime handling is not involved.
Fix this by destroying the sysfs root folders before calling
kobject_put(&srv_path->kobj), so srv_path is still valid while the helper
accesses it.
This issue was found by a static analysis tool I am developing.
📍 영향받는 시스템
RDMA/rtrs 기능을 사용하는 Linux 커널 버전
⚔️ 공격 벡터
RDMA 경로 파일 생성 과정에서 의도적으로 오류를 유발하여 메모리 참조 오류를 일으킴
🛡️ 대응 방법
kobject_put() 호출 전에 sysfs 루트 폴더를 먼저 파괴하도록 커널 패치를 적용함
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 해결된 최신 패치 버전인지 확인합니다.