Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2115603imm; Mon, 16 Jul 2018 02:26:46 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfGz8mg3kWlF+oMZ151IfH9Bd82QAi1f+s5eZiR6+pjysMXg2Lc4/mIZpUzcQagzFqJ444N X-Received: by 2002:a62:954:: with SMTP id e81-v6mr17242507pfd.231.1531733206836; Mon, 16 Jul 2018 02:26:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531733206; cv=none; d=google.com; s=arc-20160816; b=g8Lf1oB93wzYnA8hYGACr+u5OgNmW0i0ddr/d4x9+qSHwI9NQ/cc/yd2m3enCojhL5 Cer/tNWsnBgZosabq2GptpEb3csP+bXcVaox8/mjoAKy0+7n8C1xkXrjjxDWBXnySPgo SD1l34jnhJTa5CGWfLlASTsL5IsM2kBEFAJ/vtJZj+WTRCZQsCFQ08miqTV1+s/EIFJ1 GqV5fMmzNstaSTddZ/D6i3qgQJ84o0yvMg15Cko6ojywiw3TZ2o307XDGXXwNkMCb+ma loSlAQY+je8+te+Nzx5SZLzS9mEz/oHncyK1+celVeM1IyH4lHqkzPJEVLKhbH0kzi+X H+qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=3MVlIIOhybiXi/HAJgXtqIeVAXbHADByLfxc+z+JB6w=; b=sx9HAUkM/54qO9y/xYh1ow6uhKY70sxbF63dDNoVYZReZqVtwe7BB5Y0oc14u0KPgI KmM9R8jd5MxdOmobnAIFS0kyf00VgiDbK9+ZHUOiz6ZkwQObRCYuKrqDlVDjPOFJ1kd8 C/kmQ44jzGL3Jdo2rTS3BHaiGb9E9QaMfEukE6s7fK3153gzEAyKNNMKkzXzkwcMNrDu fnRF4camU9xGWWPUNhiQZUgsYgwETGG9Z5Ci8HpziH75Dy6O1c606d7WALItihP736hw DF8RlRdUclT00RRg4GSB5lqdcMjNOU+j/XQQweIXme67haITzfX74Xd/F7ATMkLsKcZa rLSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 25-v6si28279912pfp.108.2018.07.16.02.26.32; Mon, 16 Jul 2018 02:26:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729871AbeGPJvi (ORCPT + 99 others); Mon, 16 Jul 2018 05:51:38 -0400 Received: from terminus.zytor.com ([198.137.202.136]:33787 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728324AbeGPJvi (ORCPT ); Mon, 16 Jul 2018 05:51:38 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w6G9Oukl1084000 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 16 Jul 2018 02:24:56 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w6G9OuTe1083997; Mon, 16 Jul 2018 02:24:56 -0700 Date: Mon, 16 Jul 2018 02:24:56 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Vitaly Kuznetsov Message-ID: Cc: hpa@zytor.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, kys@microsoft.com, sthemmin@microsoft.com, Michael.H.Kelley@microsoft.com, mingo@kernel.org, haiyangz@microsoft.com, vkuznets@redhat.com, mikelley@microsoft.com Reply-To: mingo@kernel.org, haiyangz@microsoft.com, vkuznets@redhat.com, mikelley@microsoft.com, hpa@zytor.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, sthemmin@microsoft.com, kys@microsoft.com, Michael.H.Kelley@microsoft.com In-Reply-To: <20180709174012.17429-2-vkuznets@redhat.com> References: <20180709174012.17429-2-vkuznets@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/hyperv] x86/hyper-v: Check cpumask_to_vpset() return value in hyperv_flush_tlb_others_ex() Git-Commit-ID: 0f0caa52cd4a48a44f6cdc77bf83272bbb450727 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 0f0caa52cd4a48a44f6cdc77bf83272bbb450727 Gitweb: https://git.kernel.org/tip/0f0caa52cd4a48a44f6cdc77bf83272bbb450727 Author: Vitaly Kuznetsov AuthorDate: Mon, 9 Jul 2018 19:40:11 +0200 Committer: Thomas Gleixner CommitDate: Mon, 16 Jul 2018 11:19:48 +0200 x86/hyper-v: Check cpumask_to_vpset() return value in hyperv_flush_tlb_others_ex() Commit 1268ed0c474a ("x86/hyper-v: Fix the circular dependency in IPI enlightenment") made cpumask_to_vpset() return '-1' when there is a CPU with unknown VP index in the supplied set. This needs to be checked before we pass 'nr_bank' to hypercall. Fixes: 1268ed0c474a ("x86/hyper-v: Fix the circular dependency in IPI enlightenment") Signed-off-by: Vitaly Kuznetsov Signed-off-by: Thomas Gleixner Reviewed-by: Michael Kelley Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: "Michael Kelley (EOSG)" Cc: devel@linuxdriverproject.org Cc: "H. Peter Anvin" Link: https://lkml.kernel.org/r/20180709174012.17429-2-vkuznets@redhat.com --- arch/x86/hyperv/mmu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/hyperv/mmu.c b/arch/x86/hyperv/mmu.c index 0d90e515ec98..453d2355cd61 100644 --- a/arch/x86/hyperv/mmu.c +++ b/arch/x86/hyperv/mmu.c @@ -186,6 +186,8 @@ static u64 hyperv_flush_tlb_others_ex(const struct cpumask *cpus, flush->hv_vp_set.format = HV_GENERIC_SET_SPARSE_4K; nr_bank = cpumask_to_vpset(&(flush->hv_vp_set), cpus); + if (nr_bank < 0) + return U64_MAX; /* * We can flush not more than max_gvas with one hypercall. Flush the