Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp814409rwb; Thu, 1 Dec 2022 08:41:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf7sQKX4zAbrW6hAAbswSTNCtNJaSjCTbLZUynAGhzi4ucWyV+h2vV4VAl0RaYfw+vnYn7ZJ X-Received: by 2002:aa7:c042:0:b0:462:2f5a:8618 with SMTP id k2-20020aa7c042000000b004622f5a8618mr61069048edo.42.1669912879356; Thu, 01 Dec 2022 08:41:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669912879; cv=none; d=google.com; s=arc-20160816; b=J5o7F3VIvXEYxrt+FxQaCNuAxfmNcKpl6yqnbIXER2+TOVP+NjnPsLnelpox1x8Qpu e9Lm+91C4vyxhbTz2ePFbublUCVUWx+8FvWiLSOYTpmprNHywjxc2vCQYWSmsAz0c4nf 1LBZzmize8EWyA/LeIILU9mlS9QYAAKtwBiWVfKoPb4k6apKVngYaNKwlZsWiJ7siPV5 Da+h49vvAisIFpUN8Jz6+46KFtxjClyIVueJiyQK4c1RHuaJwkqQF1BpSduJWVt586RP Nb1fnVHwewF71EX0kFUYlRZIr/0rAk4UbIDaIVV6abCz6q0hAc5OArl855H/nBNZH98C 36Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:date:from:dkim-signature; bh=0bNjt9tPvWgAx7JuBIs6WMfVNC7BuK2Z8wYiC6YvDlc=; b=vzehUVaj2TBfqEPxBJxbsBiTf0XMjY9M/LqpaCgKpJsqMklXSm031ch2KfrdaldMLC 276l1xqp9OTbTYSCHuV/Yzf57dfObGyngZZtXrZajI5/kdxZukx55rSQW69PKENiZo9X djOquV8j8U6DRuQqTIssjd6fPWCfEWOW3mTKUmGy24st8XAuWMdPRQ8A/U6Id3NpQMhH Y8PTN5cSX6kTpdCRqKqIepyittoN/Kg24dD7EEovAAPOdVa16cJKUn5nKUvgqE9juQVO lzQEhScSeSB0ZY3YMMmkz+WmwNBs4+Xa2STjRSKGNSj/28NotDaZZqxrhpVu691jjtuG wwnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VXztHXDr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s5-20020a056402164500b0046af4b03015si3856541edx.8.2022.12.01.08.40.57; Thu, 01 Dec 2022 08:41:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VXztHXDr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232203AbiLAQZq (ORCPT + 82 others); Thu, 1 Dec 2022 11:25:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232191AbiLAQZo (ORCPT ); Thu, 1 Dec 2022 11:25:44 -0500 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24142A47ED for ; Thu, 1 Dec 2022 08:25:43 -0800 (PST) Received: by mail-pj1-x1029.google.com with SMTP id x13-20020a17090a46cd00b00218f611b6e9so2575000pjg.1 for ; Thu, 01 Dec 2022 08:25:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-disposition:mime-version:message-id:subject:cc:to:date:from :from:to:cc:subject:date:message-id:reply-to; bh=0bNjt9tPvWgAx7JuBIs6WMfVNC7BuK2Z8wYiC6YvDlc=; b=VXztHXDrR+xZo4L8X3MpJ1iSe68L5W8VPgrlv2eWUV7G/C3sQ+034nFFbvokv8oUTf mYtIJ3uQxzekOo6H7n4IyoC7CxHBC7O2zJ8CN56LBRR/Ra4ssbY/PUuUVYVaiu0jaa8F csCQ4uiFCpLWd4uWutUPT00ApYrbSt/L1qZW0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0bNjt9tPvWgAx7JuBIs6WMfVNC7BuK2Z8wYiC6YvDlc=; b=nPgNjZvFB9bReL6mwEwPd/h1+7wsGzaBpnLV8O3v0NtMqChYojo+dt9cl/5+40WzDT SKjnKnV5bvyOni8yFxdxpTQBczi3NxHLR7zBR1bkwnVQvJoE/4PWqGXq7aJoWG2Uwg2U TI4S0oESZffgfSzDuP3+oKD0kHXbkqeihWHcIt04vNUa32nWUw1sxLeLoNjs/OM6Th0c KbH+zwryv1pADGTu53Smtpx6azyA1qLSxFSBxfupKRFtn7s+c2ZmzBSIdSqbGUAQT1ue 17TRX9J0kRQcgThIowHH47ywaB8eOGXmL2pRHAmuNuTAtzMwW3KHJhziuaO7zCWwKqwI Nv4w== X-Gm-Message-State: ANoB5plo5kOTkTloSAd3xP3t9tAMAEx+4tKxWvZTN/2X9T7/G8JPNa+T fqGOT5bQ7fmO/FJj1q8n7WH6jg== X-Received: by 2002:a17:902:74c3:b0:189:71ff:cfb5 with SMTP id f3-20020a17090274c300b0018971ffcfb5mr28712391plt.7.1669911942606; Thu, 01 Dec 2022 08:25:42 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id t3-20020a1709027fc300b00187022627d8sm3831161plb.62.2022.12.01.08.25.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 08:25:42 -0800 (PST) From: coverity-bot X-Google-Original-From: coverity-bot Date: Thu, 1 Dec 2022 08:25:41 -0800 To: Vitaly Kuznetsov Cc: Sean Christopherson , x86@kernel.org, linux-kernel@vger.kernel.org, Borislav Petkov , Ingo Molnar , "H. Peter Anvin" , Thomas Gleixner , Paolo Bonzini , kvm@vger.kernel.org, Dave Hansen , "Gustavo A. R. Silva" , linux-next@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Coverity: kvm_hv_flush_tlb(): Uninitialized variables Message-ID: <202212010825.9FB75F1F@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello! This is an experimental semi-automated report about issues detected by Coverity from a scan of next-20221201 as part of the linux-next scan project: https://scan.coverity.com/projects/linux-next-weekly-scan You're getting this email because you were associated with the identified lines of code (noted below) that were touched by commits: Fri Nov 18 12:59:05 2022 -0500 260970862c88 ("KVM: x86: hyper-v: Handle HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST{,EX} calls gently") Coverity reported the following: *** CID 1527764: Uninitialized variables (UNINIT) arch/x86/kvm/hyperv.c:2024 in kvm_hv_flush_tlb() 2018 * Hyper-V TLFS doesn't explicitly forbid non-empty sparse vCPU 2019 * banks (and, thus, non-zero 'var_cnt') for the 'all vCPUs' 2020 * case (HV_GENERIC_SET_ALL). Always adjust data_offset and 2021 * consumed_xmm_halves to make sure TLB flush entries are read 2022 * from the correct offset. 2023 */ vvv CID 1527764: Uninitialized variables (UNINIT) vvv Using uninitialized value "data_offset". 2024 data_offset += hc->var_cnt * sizeof(sparse_banks[0]); 2025 consumed_xmm_halves += hc->var_cnt; 2026 } 2027 2028 if (hc->code == HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE || 2029 hc->code == HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX || If this is a false positive, please let us know so we can mark it as such, or teach the Coverity rules to be smarter. If not, please make sure fixes get into linux-next. :) For patches fixing this, please include these lines (but double-check the "Fixes" first): Reported-by: coverity-bot Addresses-Coverity-ID: 1527764 ("Uninitialized variables") Fixes: 260970862c88 ("KVM: x86: hyper-v: Handle HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST{,EX} calls gently") Thanks for your attention! -- Coverity-bot