🇰🇷 한글 설명
Linux 커널의 tegra241-cmdqv IOMMU 드라이버에서 VINTF 초기화 및 해제 과정 중 동기화 문제가 발생합니다. 이로 인해 인터럽트 서비스 루틴(ISR)이 해제 중인 메모리에 접근하거나 초기화되지 않은 데이터를 참조하여 NULL 포인터 역참조 또는 Use-After-Free 취약점이 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터 부품을 관리하는 프로그램이 부품을 끄거나 켤 때, 작업 순서가 꼬여서 이미 사라진 정보를 읽으려고 시도하는 문제입니다. 이 과정에서 시스템이 갑자기 멈추거나 보안 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
iommu/tegra241-cmdqv: Synchronize the error ISR against VINTF (de)init
A user VINTF is torn down by tegra241_cmdqv_deinit_vintf(), which runs from
the destroy callback and from the init-failure unwind in the alloc handler.
It clears the cmdqv->vintfs[] slot and lets the iommufd core free it, but
nothing serializes that against the error interrupt: tegra241_cmdqv_isr()
reads cmdqv->vintfs[idx] and dereferences the vintf. A concurrent error can
make the ISR read a slot mid-clear (a NULL deref) or use a vintf which is
about to be freed (a use-after-free).
deinit_vintf() also returns idx to the IDA before clearing the slot, so a
concurrent create that reuses idx can publish its new vintf into the slot,
only for this teardown to erase it again with the stale NULL store.
On the other end, tegra241_cmdqv_init_vintf() publishes a new vintf with a
plain store to the cmdqv->vintfs[] slot, and the ISR dereferences fields of
a published vintf such as vintf->base. A plain store gives no ordering on a
weakly-ordered CPU, and a stale VINTF_ERR_MAP bit on a reused idx can make
the ISR pick a vintf the moment it is published, before its fields are set
or tegra241_vintf_hw_init() runs.
The cmdqv->vintfs[0] slot stays NULL until tegra241_cmdqv_init_structures()
first creates VINTF0, so the slot 0 read needs the same NULL check.
Publish every slot with an smp_store_release(), and read each slot in the
ISR with an smp_load_acquire() under a NULL check, so the ISR always sees
a fully built vintf or NULL. Also make deinit_vintf() clear the slot, and
synchronize_irq() prior to returning idx to the IDA, so no vintf is freed
under a running handler and no reused idx is clobbered.
📍 영향받는 시스템
Linux kernel (tegra241-cmdqv driver component)
⚔️ 공격 벡터
로컬 공격자가 특정 IOMMU 설정 및 인터럽트를 유도하여 커널 메모리 오류 유발
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 smp_store_release 및 smp_load_acquire 동기화 적용
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 해결된 최신 패치 버전인지 확인합니다.