From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF3AA3ACA74 for ; Tue, 28 Jul 2026 12:56:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785243401; cv=none; b=qUc1SV+OEw1scOXzbXN1l6mlLkI7LBlBpPstO1PbaFf+nfWxgrHLBDDDTRWQvLaIb0llzXoIVirPTJPx66HnIenuwdRYnb8EIGjApvBSTpuYQILIK+WCqtkFWt9HXGACBIrNzvQDwuBTy2kDM8G+uUtGfXrX1hmwKk7CqIh6RhE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785243401; c=relaxed/simple; bh=2mUG/5Gv8BPU0v6r9PAYr8uS3KM6Rl2rXwTOeCiroeM=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=ez3xZOO1tXm6XwCADguOqC5uiUSyBVpoCbipJ8x4Tukuf1NlqFdzGmeYU92kvTIHJGo42COC6uiXZHDgHtBr7AkvTswM5U4XMbzkjZo0Cov75fYZmEuBQej5ZgyGbSuv0W/DepukiT9T4GL3Vztz1h6q+UXrogbcZWsXoVl0mCo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=G7QpwFNu; arc=none smtp.client-ip=209.85.215.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="G7QpwFNu" Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-ca8aee88725so5832731a12.3 for ; Tue, 28 Jul 2026 05:56:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1785243399; x=1785848199; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=zWMkY+0t8YjnkN9cHKao+n9nE2vmLOdCEDy55XomyXg=; b=G7QpwFNuCzwFEzAb7aAD3+7azwYoXcIyovyyilXPiTEBof/5eUSfVJuCPVCszMK9ow WkF3vcQPMKvzqTG0QKrGtgbkpkWZQ0MQ1yDi9p4b+my0qjV3ETFNo9nZ0LMalk/TYjO1 K1n97iXkiIQIOa0K26li746vbg2otzhAOkoSHZOavc1BoZKbLsZC/AzvKIiLYwgtTPTd HKelCnMwiSjig7YHlAJQ7K6+xEwYi2+tGX6O8rNV+NKsXTQYhNXjScmwOpjAHo5FTnNC hCqgLfvYKnW0ADPyIQIigmOHEQmTM8tOhLmeisNvJDRztcfcgeb82aKmD19IFceMKTkN W1Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785243399; x=1785848199; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=zWMkY+0t8YjnkN9cHKao+n9nE2vmLOdCEDy55XomyXg=; b=nmhO1MTObvsaIVLDuEAeanns2v9BwpSq//ztrUG0+laYEGaQPMIIWZEnDIodFlqGlS W09fSUHloJTJuovH8h7xPjepoieOmREMNO6QoIVevpPfcL7pOemx5/NulBRKKTiPNPa6 p/LpA3sz75pjT1KqsSYpFcNrPMZADDSUI39TnOJM4JP35kre5qdckzT3DO+Df6Zqd+zI Tr1UNGMTWgB9yX9MJAocISHunzyt28gJpchh+x1Nh1CUlFy3GNxMBQHSJQQLZ8xKaeK8 g0HtWq/D5j1myBdoOxCIIKieYdW1pqAJ4g8QmNaPQG9JiYGZGr/3w4F4gW6Ys9F+E3SW zrdw== X-Forwarded-Encrypted: i=1; AHgh+RpaEXfqUo5cZsQ3AIjj8uEYAlGbvP/llGpdwWXULEiqdNUmT3f74jEIIqwybpzjTa15kXc=@vger.kernel.org X-Gm-Message-State: AOJu0Yw6DTlaJaAvFKNP3sPX0pzSlWTt/tQxI4tDsLIXXRIJV7y5+3P9 /j+FI34wL8KZRyvaeM5rrWB/V9tYXynTgngiZR7ncrvw8DuJjp3ufV6By5vyUzCMXdDbH4gPxqJ XkfXR/g== X-Received: from pgmm5.prod.google.com ([2002:a05:6a02:5505:b0:c91:e464:eab5]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:7f81:b0:3c3:b57b:6291 with SMTP id adf61e73a8af0-3c8aafd66bbmr3065895637.18.1785243398916; Tue, 28 Jul 2026 05:56:38 -0700 (PDT) Date: Tue, 28 Jul 2026 05:56:37 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: Message-ID: Subject: Re: [PATCH] KVM: x86: Cancel IOAPIC EOI work before freeing vCPUs From: Sean Christopherson To: Myeonghun Pak Cc: pbonzini@redhat.com, kvm@vger.kernel.org, security@kernel.org, stable@vger.kernel.org Content-Type: text/plain; charset="us-ascii" On Tue, Jul 28, 2026, Myeonghun Pak wrote: > The IOAPIC delayed EOI injection worker dereferences local APIC pointers > from the VM's APIC map. Since commit 17bcd7144263 ("KVM: x86: Free > vCPUs before freeing VM state"), kvm_arch_destroy_vm() frees vCPUs and > their local APICs before kvm_ioapic_destroy() synchronously cancels the > worker. > > Consequently, if the delayed work is pending when VM teardown starts, > the worker can run after a local APIC has been freed. ... > Fixes: 17bcd7144263 ("KVM: x86: Free vCPUs before freeing VM state") > Cc: stable@vger.kernel.org > Signed-off-by: Myeonghun Pak > --- > arch/x86/kvm/ioapic.c | 12 +++++++++++- > arch/x86/kvm/ioapic.h | 1 + > arch/x86/kvm/x86.c | 1 + > 3 files changed, 13 insertions(+), 1 deletion(-) > > AI disclosure: I used AI assistance during the audit and am treating the > issue as public as required by Documentation/process/security-bugs.rst. > The reproducer has not been posted publicly. Though that doesn't seem to matter much given you're the fourth person/group to independently report this bug. :-) A fix is already pending: https://lore.kernel.org/all/20260727171718.543491-1-seanjc@google.com Thanks!