🇰🇷 한글 설명
Linux 커널의 md(Multiple Device) 드라이버에서 레이스 컨디션(Race Condition)으로 인해 NULL 포인터 역참조가 발생할 수 있는 취약점입니다. 스페어 장치 구성 변경 시 배열이 일시 중지되지 않은 상태에서 동기화 작업이 진행되면, I/O 작업 중인 장치가 제거되면서 시스템 충돌을 유발할 수 있습니다.
💡 쉬운 설명
컴퓨터의 저장 장치를 관리하는 프로그램에서 여러 작업이 동시에 일어날 때 순서가 꼬여 발생하는 오류입니다. 이로 인해 시스템이 갑자기 멈추거나 꺼질 수 있는 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
md: recheck spare changes before starting sync
remove_spares() and remove_and_add_spares() modify the array's rdev
configuration. These operations are only safe after the array has been
suspended.
md_start_sync() checks whether spare configuration changes are needed
before taking reconfig_mutex. However, the rdev state can change before
the mutex is acquired, so the initial check can become stale. In that
case, md_choose_sync_action() may remove or replace rdevs while normal
I/O is still accessing them.
The race can occur as follows:
raid10d Worker Normal IO
____________ _______________________ ______________________
raid10_write_request()
wait_blocked_dev()
set Blocked
set Faulty
Skip Faulty rdev
rrdev->nr_pending++
.repl_bio = bio
removeable_rdev = false .
array not suspended .
lock mddev goto err_handle
lock mddev (wait)
.
update sb .
clear Blocked .
.
unlock mddev .
lock mddev (acquires)
remove_spares()
removeable_rdev = true
raid10_remove_disk()
rdev = replacement
replacement = NULL
rdev_dec_pending(NULL)
unlock mddev (NULL)->nr_pending--
In this case, rdev_dec_pending() is called with a NULL pointer,
resulting in a NULL pointer dereference when attempting to decrement
nr_pending.
Fix this by suspending the array when spare configuration changes are
needed, including for non-read-write arrays, and checking again after
taking reconfig_mutex. If the array was not already suspended and a
change is now needed, release the mutex, suspend the array, and
reacquire the mutex before continuing.
📍 영향받는 시스템
Linux Kernel (md driver 사용 시스템)
⚔️ 공격 벡터
로컬 공격자가 특정 I/O 패턴과 장치 구성 변경을 유도하여 레이스 컨디션 발생
🛡️ 대응 방법
스페어 구성 변경 시 배열을 일시 중지(suspend)하고 재확인하는 로직이 포함된 최신 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 최신 보안 업데이트 버전인지 확인