Re: [PATCH 3/4] KVM: VMX: Re-inject an ICEBP #DB as a privileged software exception
From: Chao Gao
Date: Fri Dec 04 2026 - 06:48:55 EST
On Thu, Dec 03, 2026 at 04:25:21PM +0800, Sohil Mehta wrote:
>> [Severity: Medium]
>> Can queueing an ICEBP #DB with a payload and EVENT_TYPE_PRIV_SWEXC corrupt
>> guest state if KVM exits to userspace (for example on a pending signal)
>> before injecting the exception?
>>
>
>The window seems real. It happens because patch 2 leaves a queued INT1
>out of the vCPU events like INT3 and INTO, but those don't carry a
>payload. So the payload of a #DB that isn't saved still leaks out, to
>userspace or into DR6. However, I don't see how the guest state can be
>corrupted.
>
>My LLM says:
> - Without KVM_CAP_EXCEPTION_PAYLOAD, KVM writes the payload to DR6 when
> userspace saves the vCPU state. After a restore, the guest
> re-executes the ICEBP, and the new #DB writes the same DR6 bits
> again.
I think it can be guest visible. After a restore, if an interrupt is
injected before the guest re-executes the ICEBP, the interrupt handler
can see the wrong DR6.
I am not sure how severe it is, though.
>This isn't really my area of expertise, so I would appreciate feedback
>on this. Does this seem worth fixing?
I think it is worth fixing. It isn't about how much impact a wrong DR6 has.
The logic of delivering the payload early should be explainable, and it
should only apply to hardware exceptions. Software exceptions, including
privileged ones, aren't saved/restored, so there is no reason to deliver
their payload early at all.