🇰🇷 한글 설명
Linux 커널의 F2FS 파일 시스템에서 __update_iostat_latency() 함수 호출 시 iotype에 대한 유효성 검사가 누락되어 메모리 오염이 발생할 수 있는 취약점입니다. META_FLUSH와 NR_PAGE_TYPE 간의 혼동으로 인해 배열 범위를 벗어난 쓰기 작업이 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터의 저장 장치를 관리하는 프로그램에서 데이터 종류를 잘못 구분하여, 정해진 메모리 공간을 넘어서 데이터를 기록하는 오류가 발견되었습니다. 이로 인해 시스템이 불안정해지거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
f2fs: fix to avoid potential memory corruption in __update_iostat_latency()
Add iotype sanity check to avoid potential memory corruption.
This is to fix the compile error below:
fs/f2fs/iostat.c:231 __update_iostat_latency() error: buffer overflow
'io_lat->peak_lat[type]' 3 <= 3
vim +228 fs/f2fs/iostat.c
211 static inline void __update_iostat_latency(struct bio_iostat_ctx
*iostat_ctx,
212 enum iostat_lat_type type)
213 {
214 unsigned long ts_diff;
215 unsigned int page_type = iostat_ctx->type;
216 struct f2fs_sb_info *sbi = iostat_ctx->sbi;
217 struct iostat_lat_info *io_lat = sbi->iostat_io_lat;
218 unsigned long flags;
219
220 if (!sbi->iostat_enable)
221 return;
222
223 ts_diff = jiffies - iostat_ctx->submit_ts;
224 if (page_type >= META_FLUSH)
^^^^^^^^^^
225 page_type = META;
226
227 spin_lock_irqsave(&sbi->iostat_lat_lock, flags);
@228 io_lat->sum_lat[type][page_type] += ts_diff;
^^^^^^^^^
Mixup between META_FLUSH and NR_PAGE_TYPE leads to memory corruption.
📍 영향받는 시스템
F2FS 파일 시스템을 사용하는 Linux 커널 버전
⚔️ 공격 벡터
로컬 공격자가 조작된 I/O 요청을 통해 메모리 오염 유도
🛡️ 대응 방법
F2FS iostat 관련 패치가 적용된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 해결된 최신 보안 패치 버전인지 확인합니다.