🇰🇷 한글 설명
Linux 커널의 Rust IRQ 등록 코드에서, Devres::new()가 값으로 반환되도록 변경되면서 request_irq() 호출 시점에 registration.inner가 아직 초기화되지 않은 상태로 IRQ가 활성화될 수 있습니다. 이로 인해 IRQ 콜백에서 초기화되지 않은 메모리를 읽을 수 있는 문제가 있습니다. 해당 문제는 RegistrationInner를 쿠키로 전달하도록 수정되어 해결되었습니다.
💡 쉬운 설명
리눅스 커널 안의 인터럽트 처리 코드가 아직 준비되지 않은 데이터를 읽을 수 있는 버그입니다. 이 버그는 메인라인 커널에는 해당되지 않고 특정 개발 브랜치에서만 발생합니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
rust: irq: pass RegistrationInner as cookie to request_irq
With commit ba268514ea14 ("rust: devres: fix race condition due to
nesting"), Devres::new() returns Result<Self> by value instead of
initializing in-place via PinInit. Because request_irq() is called
inside Devres::new(), registration.inner is still uninitialized when the
IRQ is enabled, so accessing registration.inner.device() in the IRQ
callback can read uninitialized memory.
Fix this by storing the Device and handler pointer in RegistrationInner
and passing RegistrationInner as the IRQ cookie after its fields are
initialized.
This is not needed in mainline because commit 98c63ce4d760 ("rust: irq:
make Registration compatible with lifetime-bound drivers") removed
Devres from irq::Registration and moved request_irq() after all fields
are initialized.
📍 영향받는 시스템
Rust 기반 IRQ 바인딩을 사용하는 특정 Linux 커널 개발/백포트 브랜치 (메인라인 미영향)
⚔️ 공격 벡터
로컬 사용자 또는 드라이버 수준에서 인터럽트 타이밍을 이용해 초기화되지 않은 커널 메모리를 읽는 방식으로 추정되며, 공개된 악용 사례는 확인되지 않음
🛡️ 대응 방법
수정 커밋이 포함된 최신 안정 커널로 업데이트하거나 배포판의 보안 패치를 적용
🔧 검증 코드
출력된 커널 버전이 수정 패치가 포함된 최신 안정 버전인지 배포판 보안 공지와 대조하여 확인하며, 해당 Rust IRQ 드라이버를 사용하지 않는 시스템이라면 영향이 없습니다.