[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <170629112001.3098038.14027986117394347629.b4-ty@google.com>
Date: Tue, 30 Jan 2024 16:59:15 -0800
From: Sean Christopherson <seanjc@...gle.com>
To: Sean Christopherson <seanjc@...gle.com>, Paolo Bonzini <pbonzini@...hat.com>
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] KVM: Harden against unpaired kvm_mmu_notifier_invalidate_range_end()
calls
On Tue, 09 Jan 2024 16:42:39 -0800, Sean Christopherson wrote:
> When handling the end of an mmu_notifier invalidation, WARN if
> mn_active_invalidate_count is already 0 do not decrement it further, i.e.
> avoid causing mn_active_invalidate_count to underflow/wrap. In the worst
> case scenario, effectively corrupting mn_active_invalidate_count could
> cause kvm_swap_active_memslots() to hang indefinitely.
>
> end() calls are *supposed* to be paired with start(), i.e. underflow can
> only happen if there is a bug elsewhere in the kernel, but due to lack of
> lockdep assertions in the mmu_notifier helpers, it's all too easy for a
> bug to go unnoticed for some time, e.g. see the recently introduced
> PAGEMAP_SCAN ioctl().
>
> [...]
Applied to kvm-x86 generic, thanks!
[1/1] KVM: Harden against unpaired kvm_mmu_notifier_invalidate_range_end() calls
https://github.com/kvm-x86/linux/commit/d489ec956583
--
https://github.com/kvm-x86/linux/tree/next
Powered by blists - more mailing lists