Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp791246imm; Mon, 9 Jul 2018 10:41:17 -0700 (PDT) X-Google-Smtp-Source: AAOMgpezYfG3iXnaHepq81cq3brFKQFNWMMb7Vda8811R8WTk+NcLednADYW0y0AdreU2oHqKEfG X-Received: by 2002:a63:d401:: with SMTP id a1-v6mr4600370pgh.414.1531158077426; Mon, 09 Jul 2018 10:41:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531158077; cv=none; d=google.com; s=arc-20160816; b=L7a2N7ZldMuIIxUld1Gmkh9mOdu/6oCg5WolXXIDqsKRdukG2rZibBwdC13KrwYzjq dA5AcjG2H3cpntk8oeBKPXV+BuU46xRPhFbOzoMdrj1n1wkHk49EmMc5iDub2jAafZdZ I6NtXb3qmfnswNYEfOGubk3IPUiXNQ6ACPNOZL0b2d3m6XEl1vK2wt5mdB6kI05eCBk+ IkmjifpgfBQkJQ3HGmtTINA7IzjX9F4Z6VTeP6Am3u4RRg7qDaU26SbOTyh0xd8sSqOn 8PQbSmmQycj5M+ryktsvosDqn6NgNZ21dN6X6X9Sa6NxCcmv5gg+o9qNCc7x1AsVS1IB TzvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=CSbjdp0nqUUg7ilLpn7JLWVTXxpQJsg2wY0capTi0P4=; b=nZNUHvYvakmMyEjIeN4Yoa6kUpdCVclCZxEkp+vJlFXUurGvFseV3aPk7Z2zlB0khW 2XolA2nTW7Ks1Kdmx6rte7Ns0uc47jfXUmcpUkVbgerFhwIUxAbX08o4ODV++5Hzm4BG la4Ovalmlet5cZ87AT96DcFfwZvTLJC/pBi47Kx/X3HvAh1BB4SEmgNUE6ohKmp8TD6p 9ndITO4qo/vZd8OXLjFbYfssERZfn1EkfIQ/vlEEbfpFgO0fg3jQV5vUI0OViVTbGabi NRqlTBf893jpi34D3yNhV0dLzlLDyUHRNaUCV/bN2YsBQIZUz6Wd9SsaLtj3X5/omqEI wEOA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o9-v6si14681665plk.434.2018.07.09.10.41.01; Mon, 09 Jul 2018 10:41:17 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933860AbeGIRkV (ORCPT + 99 others); Mon, 9 Jul 2018 13:40:21 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:59422 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933594AbeGIRkS (ORCPT ); Mon, 9 Jul 2018 13:40:18 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D5028406E971; Mon, 9 Jul 2018 17:40:17 +0000 (UTC) Received: from vitty.brq.redhat.com (unknown [10.43.2.155]) by smtp.corp.redhat.com (Postfix) with ESMTP id E8F192166BA2; Mon, 9 Jul 2018 17:40:15 +0000 (UTC) From: Vitaly Kuznetsov To: x86@kernel.org Cc: "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "Michael Kelley (EOSG)" , devel@linuxdriverproject.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] x86/hyper-v: check cpumask_to_vpset() return value in hyperv_flush_tlb_others_ex() Date: Mon, 9 Jul 2018 19:40:11 +0200 Message-Id: <20180709174012.17429-2-vkuznets@redhat.com> In-Reply-To: <20180709174012.17429-1-vkuznets@redhat.com> References: <20180709174012.17429-1-vkuznets@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 09 Jul 2018 17:40:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 09 Jul 2018 17:40:17 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'vkuznets@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 -- 2.14.4