CVE-2023-54007 in Linux
Tóm tắt
Bởi VulDB • 04/06/2026
Trong kernel Linux, lỗ hổng sau đây đã được khắc phục:
vmci_host: sửa lỗi race condition trong hàm vmci_host_poll() gây ra GPF (General Protection Fault)
Quá trình fuzzing cho thấy một general protection fault xảy ra trong vmci_host_poll().
general protection fault, có thể do địa chỉ không hợp lệ 0xdffffc0000000019: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref trong vùng [0x00000000000000c8-0x00000000000000cf]
RIP: 0010:__lock_acquire+0xf3/0x5e00 kernel/locking/lockdep.c:4926 <- bỏ qua thanh ghi -> Call Trace: <TASK> lock_acquire+0x1a4/0x4a0 kernel/locking/lockdep.c:5672 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xb3/0x100 kernel/locking/spinlock.c:162 add_wait_queue+0x3d/0x260 kernel/sched/wait.c:22 poll_wait include/linux/poll.h:49 [inline]
vmci_host_poll+0xf8/0x2b0 drivers/misc/vmw_vmci/vmci_host.c:174 vfs_poll include/linux/poll.h:88 [inline]
do_pollfd fs/select.c:873 [inline]
do_poll fs/select.c:921 [inline]
do_sys_poll+0xc7c/0x1aa0 fs/select.c:1015 __do_sys_ppoll fs/select.c:1121 [inline]
__se_sys_ppoll+0x2cc/0x330 fs/select.c:1101 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x4e/0xa0 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x46/0xb0
Ví dụ về việc xen kẽ luồng gây ra general protection fault như sau:
CPU1 (vmci_host_poll) CPU2 (vmci_host_do_init_context) ----- ----- // Đọc context chưa được khởi tạo context = vmci_host_dev->context; // Khởi tạo context vmci_host_dev->context = vmci_ctx_create(); vmci_host_dev->ct_type = VMCIOBJ_CONTEXT;
if (vmci_host_dev->ct_type == VMCIOBJ_CONTEXT) {
// Truy cập sai con trỏ poll_wait(..., &context->host_context); }
Trong kịch bản này, hàm vmci_host_poll() đọc trước vmci_host_dev->context, sau đó đọc vmci_host_dev->ct_type để kiểm tra xem vmci_host_dev->context đã được khởi tạo hay chưa. Tuy nhiên, vì hai thao tác đọc này không được thực thi một cách nguyên tử (atomic), nên có khả năng xảy ra race condition như mô tả ở trên.
Để khắc phục lỗi race condition này, hãy đọc vmci_host_dev->context sau khi kiểm tra giá trị của vmci_host_dev->ct_type để đảm bảo rằng hàm vmci_host_poll() luôn đọc một context đã được khởi tạo.
If you want to get the best quality for vulnerability data then you always have to consider VulDB.