lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <603f4cc58f697a3e1e5896f9bd2478e6@kernel.org>
Date:   Mon, 24 Aug 2020 13:55:40 +0100
From:   Marc Zyngier <maz@...nel.org>
To:     Will Deacon <will@...nel.org>
Cc:     gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org,
        suzuki.poulose@....com, james.morse@....com, pbonzini@...hat.com,
        kernel-team@...roid.com, stable@...r.kernel.org
Subject: Re: [PATCH stable-4.4.y backport] KVM: arm/arm64: Don't reschedule in
 unmap_stage2_range()

On 2020-08-24 12:28, Will Deacon wrote:
> Upstream commits fdfe7cbd5880 ("KVM: Pass MMU notifier range flags to
> kvm_unmap_hva_range()") and b5331379bc62 ("KVM: arm64: Only reschedule
> if MMU_NOTIFIER_RANGE_BLOCKABLE is not set") fix a "sleeping from 
> invalid
> context" BUG caused by unmap_stage2_range() attempting to reschedule 
> when
> called on the OOM path.
> 
> Unfortunately, these patches rely on the MMU notifier callback being
> passed knowledge about whether or not blocking is permitted, which was
> introduced in 4.19. Rather than backport this considerable amount of
> infrastructure just for KVM on arm, instead just remove the conditional
> reschedule.
> 
> Cc: <stable@...r.kernel.org> # v4.4 only
> Cc: Marc Zyngier <maz@...nel.org>
> Cc: Suzuki K Poulose <suzuki.poulose@....com>
> Cc: James Morse <james.morse@....com>
> Signed-off-by: Will Deacon <will@...nel.org>
> ---
>  arch/arm/kvm/mmu.c | 8 --------
>  1 file changed, 8 deletions(-)
> 
> diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
> index e0267532bd4e..edd392fdc14b 100644
> --- a/arch/arm/kvm/mmu.c
> +++ b/arch/arm/kvm/mmu.c
> @@ -300,14 +300,6 @@ static void unmap_range(struct kvm *kvm, pgd_t 
> *pgdp,
>  		next = kvm_pgd_addr_end(addr, end);
>  		if (!pgd_none(*pgd))
>  			unmap_puds(kvm, pgd, addr, next);
> -		/*
> -		 * If we are dealing with a large range in
> -		 * stage2 table, release the kvm->mmu_lock
> -		 * to prevent starvation and lockup detector
> -		 * warnings.
> -		 */
> -		if (kvm && (next != end))
> -			cond_resched_lock(&kvm->mmu_lock);
>  	} while (pgd++, addr = next, addr != end);
>  }

Acked-by: Marc Zyngier <maz@...nel.org>

         M.
-- 
Jazz is not dead. It just smells funny...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ