🇰🇷 한글 설명
Linux 커널의 DAMON sysfs 인터페이스에서 memcg_path 파일에 대한 읽기 및 쓰기 작업 간의 경쟁 상태로 인해 Use-After-Free 취약점이 발생합니다. 사용자가 직접 파일을 읽거나 쓸 때 적절한 잠금(lock)이 적용되지 않아, 이미 해제된 메모리 버퍼에 접근할 수 있는 문제가 있습니다.
💡 쉬운 설명
컴퓨터 메모리 관리 시스템에서 데이터를 읽는 도중에 다른 명령이 데이터를 삭제해버려 발생하는 오류입니다. 이로 인해 시스템이 불안정해지거나 보안 공격에 악용될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
mm/damon/sysfs-schemes: protect memcg_path kfree() with damon_sysfs_lock
Patch series "mm/damon/sysfs-schemes: fix use-after-free for [memcg_]path".
Reads of 'memcg_path' and 'path' files in DAMON sysfs interface could race
with their writes, results in use-after-free. Fix those.
This patch (of 2):
damon_sysfs_scheme_filter->mmecg_path can be read and written by users,
via DAMON sysfs memcg_path file. It can also be indirectly read, for the
parameters {on,off}line committing to DAMON. The reads for parameters
committing are protected by damon_sysfs_lock to avoid the sysfs files
being destroyed while any of the parameters are being read. But the
user-driven direct reads and writes are not protected by any lock, while
the write is deallocating the memcg_path-pointing buffer. As a result,
the readers could read the already freed buffer (user-after-free). Note
that the user-reads don't race when the same open file is used by the
writer, due to kernfs's open file locking. Nonetheless, doing the reads
and writes with separate open files would be common. Fix it by protecting
both the user-direct reads and writes with damon_sysfs_lock.
📍 영향받는 시스템
Linux kernel (DAMON sysfs interface 사용 버전)
⚔️ 공격 벡터
DAMON sysfs의 memcg_path 파일을 별도의 파일 핸들로 동시에 읽고 쓰는 경쟁 상태 유도
🛡️ 대응 방법
damon_sysfs_lock을 사용하여 sysfs 파일의 읽기 및 쓰기 작업을 보호하는 최신 커널 패치 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 최신 보안 업데이트 버전인지 확인합니다.