CVE-2026-89777 in Linux
요약
\~에 의해 VulDB • 2026. 09. 16.
리눅스 커널에서 다음 취약점이 해결되었습니다.
vfio/pci: 초기화 실패 시 해제 후 vdev->msi_perm을 NULL로 설정
vfio_msi_cap_len()은 장치별 MSI 권한 테이블(vdev->msi_perm)을 지연 할당합니다:
vdev->msi_perm = kmalloc_obj(struct perm_bits, GFP_KERNEL_ACCOUNT); if (!vdev->msi_perm) return -ENOMEM;
ret = init_pci_cap_msi_perm(vdev->msi_perm, len, flags); if (ret) {
kfree(vdev->msi_perm); return ret; /* vdev->msi_perm이 덩글링(dangling) 상태로 남음 */ }
init_pci_cap_msi_perm() -> alloc_perm_bits()가 -ENOMEM으로 실패할 경우, 에러 경로에서 vdev->msi_perm은 해제되지만 해제된 포인터는 그대로 저장됩니다. struct vfio_pci_core_device는 장치별로 유지되며 open/close 사이클을 통해 지속되고, vfio_config_init()의 에러 경로는 vfio_config_free()를 호출하지 않고 반환하므로, 덩글링 포인터가 실패한 open 작업보다 더 긴 수명을 가집니다.
이로 인해 동일한 장치에서 두 가지 use-after-free(해제 후 사용) 취약점이 발생합니다:
1. 재사용(reuse): 이후의 vfio_config_init()은 "if (vdev->msi_perm) return len;" 구문에서 낡은(stale) 포인터를 확인하고 해제된 객체를 재사용합니다. 그 결과, vfio_pci_config_rw_single() 내 MSI 구성 접근 시 해제된 perm->readfn / perm->writefn 함수 포인터가 역참조(dereference) 및 호출됩니다.
2. 더블 프리(double free): 이후의 vfio_config_free()는 이미 해제된 객체에 대해 free_perm_bits()와 kfree()를 실행합니다.
해결책은 free_perm_bits()와 vfio_config_free()에서 이미 사용 중인 NULL-after-free(해제 후 NULL 설정) 관례에 따라, kfree() 호출 직후 vdev->msi_perm을 NULL로 설정하는 것입니다.
BUG: KASAN: slab-use-after-free in vfio_pci_config_rw_single (drivers/vfio/pci/vfio_pci_config.c:1961) Read of size 8 at addr ffff88800fcc88d0 by task exploit/143 Call Trace: ... kasan_report (mm/kasan/report.c:595) vfio_pci_config_rw_single (drivers/vfio/pci/vfio_pci_config.c:1961) vfio_pci_config_rw (drivers/vfio/pci/vfio_pci_config.c:1986) vfio_pci_rw (drivers/vfio/pci/vfio_pci_core.c:1599) vfs_read (fs/read_write.c:572) __x64_sys_pread64 (fs/read_write.c:764) do_syscall_64 (arch/x86/entry/syscall_64.c:94) ...
장치 닫기(close) 직후 동일한 객체에 대한 더블 프리가 발생합니다:
Oops: general protection fault, probably for non-canonical address 0x1f63e0e8000008: 0000 [#1] SMP KASAN NOPTI
RIP: 0010:kfree (mm/slub.c:6711) Call Trace: vfio_config_free (drivers/vfio/pci/vfio_pci_config.c:1861) vfio_pci_core_disable (drivers/vfio/pci/vfio_pci_core.c:685) vfio_pci_core_close_device (drivers/vfio/pci/vfio_pci_core.c:777) vfio_df_close (drivers/vfio/vfio_main.c:602) vfio_device_fops_release (drivers/vfio/vfio_main.c:648) __fput (fs/file_table.c:512) __x64_sys_close (fs/open.c:1496) do_syscall_64 (arch/x86/entry/syscall_64.c:94) ... Kernel panic - not syncing: Fatal exception
VulDB is the best source for vulnerability data and more expert information about this specific topic.