From patchwork Mon May 4 01:25:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 47935 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5826420553 for ; Mon, 4 May 2015 01:28:24 +0000 (UTC) Received: by labgx2 with SMTP id gx2sf42522691lab.1 for ; Sun, 03 May 2015 18:28:23 -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=KmT+9qC+VeLojR6NvTWgz+RyaeJL736LgXSMhCL3MfQ=; b=h17bEqXqImKqwCXMsYxLJavGuWZcqZZPLuwJyVnqxsI0RMxODxwTzKVxfPlj5T0pJ0 JhYTQecGooz9/Mty9LXupShKVxuddWrMyQfp+CBoSL+9z9MnpohvaD/iYQHFN85PmwDL TqY6l3Xn8rlcMEso9jK/5eRj4j6AkjJr0M2dQhQn3YcO6o/sksKF4I1DkrsRcgKp+5zs 2Hwjdph6og8TbKB5kVN3Cp/U5DNyC/JbDgDAtzvPYNXq3FmJjMsKdFSoZHteLNG0nS6C UA1infXWsTRMX2mp4c609CELwCXNzXEOh/AUfwLIi0gfDu+xVJxuZmKCltgCo2p3mwIr nTjw== X-Gm-Message-State: ALoCoQkUXeNkplaBhbfYu+SPg2F/5/jN6O6B27wwK2TLrGhXgt2rZ8IMBPCo4SZ4UGBIZc+/yADy X-Received: by 10.152.37.101 with SMTP id x5mr16912962laj.5.1430702903165; Sun, 03 May 2015 18:28:23 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.30.37 with SMTP id p5ls723170lah.9.gmail; Sun, 03 May 2015 18:28:23 -0700 (PDT) X-Received: by 10.112.198.74 with SMTP id ja10mr5180541lbc.19.1430702903022; Sun, 03 May 2015 18:28:23 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id lk7si9059974lac.61.2015.05.03.18.28.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 May 2015 18:28:23 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by lbbzk7 with SMTP id zk7so95535309lbb.0 for ; Sun, 03 May 2015 18:28:22 -0700 (PDT) X-Received: by 10.152.4.137 with SMTP id k9mr17393036lak.29.1430702902937; Sun, 03 May 2015 18:28:22 -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 l1csp1406177lbt; Sun, 3 May 2015 18:28:22 -0700 (PDT) X-Received: by 10.70.103.230 with SMTP id fz6mr38235683pdb.1.1430702901099; Sun, 03 May 2015 18:28:21 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id es7si17680936pbd.123.2015.05.03.18.28.20; Sun, 03 May 2015 18:28:21 -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 S1751314AbbEDB2T (ORCPT + 2 others); Sun, 3 May 2015 21:28:19 -0400 Received: from mail-pd0-f174.google.com ([209.85.192.174]:34443 "EHLO mail-pd0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751570AbbEDB2T (ORCPT ); Sun, 3 May 2015 21:28:19 -0400 Received: by pdbqa5 with SMTP id qa5so149515399pdb.1 for ; Sun, 03 May 2015 18:28:19 -0700 (PDT) X-Received: by 10.70.63.1 with SMTP id c1mr30403249pds.90.1430702899051; Sun, 03 May 2015 18:28:19 -0700 (PDT) Received: from localhost ([180.150.153.1]) by mx.google.com with ESMTPSA id k4sm10991178pdg.87.2015.05.03.18.28.17 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 03 May 2015 18:28:17 -0700 (PDT) From: shannon.zhao@linaro.org To: stable@vger.kernel.org Cc: sasha.levin@oracle.com, christoffer.dall@linaro.org, shannon.zhao@linaro.org, Jan Kiszka Subject: [PATCH for 3.18.y stable 19/22] ARM: KVM: Fix size check in __coherent_cache_guest_page Date: Mon, 4 May 2015 09:25:23 +0800 Message-Id: <1430702726-2056-20-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1430702726-2056-1-git-send-email-shannon.zhao@linaro.org> References: <1430702726-2056-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.217.169 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 f95c124..d409c9c 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;