🇰🇷 한글 설명
Linux 커널의 fsverity에서 struct fsverity_info가 rhashtable에서 제거된 직후 즉시 해제되어, 동시에 다른 inode에 대해 __fsverity_get_info()를 호출하는 RCU 읽기 측에서 use-after-free가 발생할 수 있습니다. 이를 해결하기 위해 해당 구조체의 해제를 RCU 유예 방식으로 변경했습니다.
💡 쉬운 설명
리눅스 커널의 파일 무결성 검증 기능에서 메모리를 너무 일찍 해제하는 버그가 있었습니다. 이로 인해 다른 작업이 이미 사라진 데이터를 참조하여 시스템이 불안정해지거나 비정상 동작할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
fsverity: RCU-delay the freeing of struct fsverity_info
__fsverity_get_info() calls rhashtable_lookup_fast(), which just uses
rcu_read_lock() and doesn't directly synchronize with
fsverity_remove_info().
For the same inode this isn't a problem: its fsverity_info is removed
only at inode eviction time or upon failure to enable verity, when the
inode no longer needs its fsverity_info and it will no longer be
accessed via that inode.
However, this is broken and can cause a use-after-free for concurrent
__fsverity_get_info() for *different* inodes. Those rely on following
fsverity_info::rhash_head in the rhashtable under rcu_read_lock() only.
They also use fsverity_info::inode to do the key comparison.
Fix this by RCU-delaying the freeing of 'struct fsverity_info' after
it's been removed from the rhashtable.
📍 영향받는 시스템
fsverity를 사용하는 Linux 커널 (수정 이전 버전, 정확한 영향 버전은 커널 패치 기록 확인 필요)
⚔️ 공격 벡터
fsverity 기능이 활성화된 파일 시스템에서 동시에 여러 inode의 무결성 정보를 조회·제거하는 작업을 유발하여 메모리 손상이나 커널 크래시를 일으킬 수 있는 로컬 조건
🛡️ 대응 방법
커널을 해당 수정이 포함된 최신 안정 버전 또는 배포판 보안 업데이트로 업그레이드하고 재부팅
🔧 검증 코드
출력된 커널 버전을 배포판 보안 공지 또는 upstream 패치 기록과 비교하여 수정 커밋이 포함된 버전인지 확인하며, 해당 버전 이상이면 패치된 것입니다.