From patchwork Mon Apr 27 01:41:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 47592 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 57D162121F for ; Mon, 27 Apr 2015 01:42:12 +0000 (UTC) Received: by wizk4 with SMTP id k4sf14527334wiz.2 for ; Sun, 26 Apr 2015 18:42:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=6tuJ/UoAX9XnPX4pF5xXzzT4XyMTQ0Vl3bggTxqWVso=; b=bo+753eEuPBI6Lt51PMFLW+8V4N8iWhCmst/mCp6dbBmKOKPvZB2vL/BUdKWz2Xp2p GxiGFt7rwlv56yUVVEiDADKI36tM6hfYEXrKAXcklgfQdGXDqk9wN1B/N+SriXJZY7AJ 6zPw/jkI0CHHEBkqcqgmejc89YKnHmJ3o/qhdcNU758psqUVThLCn7zzmdcICWudlKto UISIRIYDF4ZO/lPQmvw+y9UguaEjETRgd6aqtR4iJTYc0x2ocC6YNr9qrd/LfwZ8V75R LOEv2j9OrubiEtOY+G9LnTopf+krquULD64bl7zgfuH9SqSmShmV33S0xJKMRM78XHhP xL5w== X-Gm-Message-State: ALoCoQnbmrsvcmZ5X1Bie+nn50R7DM7QZhACw/n4JP7O8h0ZUsReS2Fzj7pGQdaFrV2ZDy++P4Fm X-Received: by 10.112.42.236 with SMTP id r12mr5916505lbl.2.1430098931633; Sun, 26 Apr 2015 18:42:11 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.30.74 with SMTP id q10ls723127lah.35.gmail; Sun, 26 Apr 2015 18:42:11 -0700 (PDT) X-Received: by 10.112.47.73 with SMTP id b9mr7974435lbn.46.1430098931128; Sun, 26 Apr 2015 18:42:11 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id i6si13699564lai.30.2015.04.26.18.42.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Apr 2015 18:42:11 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by laat2 with SMTP id t2so69334994laa.1 for ; Sun, 26 Apr 2015 18:42:11 -0700 (PDT) X-Received: by 10.152.8.78 with SMTP id p14mr8091045laa.19.1430098931009; Sun, 26 Apr 2015 18:42:11 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp1008199lbt; Sun, 26 Apr 2015 18:42:10 -0700 (PDT) X-Received: by 10.70.91.104 with SMTP id cd8mr17826514pdb.94.1430098929285; Sun, 26 Apr 2015 18:42:09 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ro6si27582230pab.194.2015.04.26.18.42.08; Sun, 26 Apr 2015 18:42:09 -0700 (PDT) Received-SPF: none (google.com: stable-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751932AbbD0BmH (ORCPT + 2 others); Sun, 26 Apr 2015 21:42:07 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:33434 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751890AbbD0BmH (ORCPT ); Sun, 26 Apr 2015 21:42:07 -0400 Received: by pacwv17 with SMTP id wv17so90335915pac.0 for ; Sun, 26 Apr 2015 18:42:06 -0700 (PDT) X-Received: by 10.70.50.199 with SMTP id e7mr17855507pdo.124.1430098926743; Sun, 26 Apr 2015 18:42:06 -0700 (PDT) Received: from localhost ([167.160.116.64]) by mx.google.com with ESMTPSA id o3sm9974295pds.1.2015.04.26.18.42.04 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 26 Apr 2015 18:42:05 -0700 (PDT) From: shannon.zhao@linaro.org To: stable@vger.kernel.org Cc: gregkh@linuxfoundation.org, christoffer.dall@linaro.org, shannon.zhao@linaro.org, Jan Kiszka Subject: [PATCH for 3.19.y stable 2/5] ARM: KVM: Fix size check in __coherent_cache_guest_page Date: Mon, 27 Apr 2015 09:41:16 +0800 Message-Id: <1430098879-5980-3-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1430098879-5980-1-git-send-email-shannon.zhao@linaro.org> References: <1430098879-5980-1-git-send-email-shannon.zhao@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: stable@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: shannon.zhao@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Jan Kiszka commit a050dfb21cc22ac0c666d52531040c1bc48184cc upstream. The check is supposed to catch page-unaligned sizes, not the inverse. Signed-off-by: Jan Kiszka Signed-off-by: Christoffer Dall Signed-off-by: Shannon Zhao --- arch/arm/include/asm/kvm_mmu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h index 1bca8f8..90052de 100644 --- a/arch/arm/include/asm/kvm_mmu.h +++ b/arch/arm/include/asm/kvm_mmu.h @@ -186,7 +186,7 @@ static inline void __coherent_cache_guest_page(struct kvm_vcpu *vcpu, pfn_t pfn, bool need_flush = !vcpu_has_cache_enabled(vcpu) || ipa_uncached; - VM_BUG_ON(size & PAGE_MASK); + VM_BUG_ON(size & ~PAGE_MASK); if (!need_flush && !icache_is_pipt()) goto vipt_cache;