🇰🇷 한글 설명
Linux 커널의 memstick 드라이버에서 메모리 스틱 카드의 블록 수를 검증하지 않아 발생하는 취약점입니다. 공격자가 조작된 블록 수를 보고하는 카드를 삽입할 경우, 배열 범위를 초과하여 메모리(struct msb_data)를 오염시킬 수 있습니다.
💡 쉬운 설명
가짜 정보를 담은 메모리 스틱을 컴퓨터에 연결하면, 컴퓨터의 중요한 메모리 영역이 망가질 수 있는 문제입니다. 이로 인해 시스템이 멈추거나 보안이 뚫릴 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
memstick: ms_block: reject a card that reports too many blocks
msb_ftl_initialize() computes the zone count from the card block count
with no bound:
msb->zone_count = msb->block_count / MS_BLOCKS_IN_ZONE;
...
for (i = 0; i < msb->zone_count; i++)
msb->free_block_count[i] = MS_BLOCKS_IN_ZONE;
msb->block_count is a card value. msb_read_boot_blocks() reads
number_of_blocks from the card boot page and byte swaps it.
free_block_count is a fixed int[MS_MAX_ZONES]. MS_MAX_ZONES is 16, so the
valid indices are 0 to 15. The init loop above indexes it by zone_count.
msb_mark_block_used() and msb_mark_block_unused() index it by
pba / MS_BLOCKS_IN_ZONE, for pba up to block_count - 1. A card may report
up to 65535 blocks. A block_count above 8192 (MS_MAX_ZONES *
MS_BLOCKS_IN_ZONE) lets the pba index reach 16. That writes past
free_block_count[] and corrupts struct msb_data. A larger count runs the
init loop past the end too.
A real Memory Stick has at most 16 zones. So it has at most 8192 blocks.
msb_ftl_initialize() now rejects a card that reports more than
MS_MAX_ZONES * MS_BLOCKS_IN_ZONE blocks.
📍 영향받는 시스템
Linux kernel (memstick driver 사용 시스템)
⚔️ 공격 벡터
조작된 블록 수(8192개 초과)를 보고하는 악의적인 메모리 스틱(USB 등)을 시스템에 연결
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 msb_ftl_initialize()의 블록 수 검증 로직을 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 이후의 버전인지 확인