🇰🇷 한글 설명
Linux 커널의 btrfs 파일 시스템에서 오류 발생 시 bioc_list 메모리가 해제되지 않고 누수되는 취약점이 발견되었습니다. btrfs_insert_raid_extent() 함수 오류나 입출력(IO) 오류 발생 시 메모리 자원이 적절히 정리되지 않는 문제가 있었습니다. 이를 해결하기 위해 새로운 정리 헬퍼 함수를 도입하여 모든 상황에서 메모리가 해제되도록 수정되었습니다.
💡 쉬운 설명
컴퓨터의 파일 저장 방식 중 하나인 btrfs에서 오류가 날 때 사용하던 메모리를 제대로 돌려주지 않고 계속 붙잡고 있는 문제가 있었습니다. 이 문제가 반복되면 컴퓨터의 메모리가 부족해질 수 있는데, 이를 방지하기 위해 메모리를 깨끗이 정리하는 기능을 추가했습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
btrfs: fix the possible bioc_list memory leak during error
There are two possible ways to leak bioc memory on
btrfs_ordered_extent::bioc_list:
- An error occurred for btrfs_insert_one_raid_extent()
Then the function btrfs_insert_raid_extent() immediately return
without freeing any bioc in the bioc_list.
- An ordered extent hit an IO error
In that case the ordered extent will have BTRFS_ORDERED_IOERR set, and
skip the call on btrfs_insert_raid_extent() completely.
Fix the problem by:
- Introduce a new helper, btrfs_cleanup_ordered_bioc_list()
Which will remove all bioc from the bioc_list, and release the bioc.
- Call the above helper for btrfs_insert_raid_extent()
So that the cleanup helper is always called no matter what.
- Call the above helper for btrfs_finish_one_ordered()
This is called just before the final release on the ordered extent.
This was reported by Sashiko when reviewing another patch.
📍 영향받는 시스템
Linux kernel (btrfs 파일 시스템을 사용하는 버전)
⚔️ 공격 벡터
직접적인 공격보다는 시스템 오류 상황을 유도하여 점진적인 메모리 고갈을 일으키는 방식
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 수정된 패치 버전인지 확인