Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp798203rwb; Thu, 1 Dec 2022 08:29:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf6B+kMGhvaZ8mdZkiPCLFDCJ8V3Q3VQoVWBUvOTGL6sLM7ZxjGJpgSzmSKs5b6/xk6L6xYe X-Received: by 2002:a17:907:d48a:b0:7c0:9f24:af95 with SMTP id vj10-20020a170907d48a00b007c09f24af95mr7167323ejc.526.1669912171531; Thu, 01 Dec 2022 08:29:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669912171; cv=none; d=google.com; s=arc-20160816; b=SZm+S/RU/s5rXEwrWD+G5nMPcJHhIugCy1dzfqNmw+pvD2v4pQUQRp44AHtuQC0vsL ft8Wh4RY2o/sR5i1Zp7AkMb6/9u+wM98F1MYK2Yx2ZwmbhvmLkNqOwe0PohFSvUDwFnT 64cHtgSrb3SsNuJfAbsKcAwdhJQ6rH7bBzqqzCkeCYA5M8EA/nl3jEx+dsoQRb5B1ZIY L/iAYiW0SFNmK8VmQb+BMOVZyIq9EDuygRtCduQWQnJ88EJjwrUhJxOKrmbYM6Rn9s+z jbOGaGSu0LZ2mjz7mVkihiybhfE42Gd5CqcgMSb33TBZ0CoMc2EB0cX0WUqxJIrG0WED 8JWw== 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=DJn63ijABqaX2jSzYldLgtMX1wvMD+wjMrL7ejU3DM4=; b=DonctpU4RoffMPSe6NPpCcnwLuq1Cvl7va8PmqKgYd4zvZIF1lJEOUy+nmNqO3a242 0YfJCnFKmysdaclHkTKkwDL8OAZDVwfCHRW44wM1lowC9FYO62CgxFYOrFdANkkchfQZ 4FoGgxLRYd9XEhYgoXEpEVQ4t+1k8urXCnMKXkt5J6HfZtAL8IW8/YlodtUGle4diZOW p+kJwzw538fRkWJs9RAsDyrmQNhiW8PMoyEYQv4wRtvSJ2rN8pLT/7S/d8o+tLe1XjgQ RVJHEk7Fm+6QnziTC0X4QWCpcKwDhlgz0KutJF3ox4Oks6rsHI027Mruxg/TOGPRpmwk nrfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="jmk3F/NJ"; 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 sc38-20020a1709078a2600b007ade20fc40csi3972700ejc.810.2022.12.01.08.29.11; Thu, 01 Dec 2022 08:29:31 -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="jmk3F/NJ"; 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 S231843AbiLAQZ2 (ORCPT + 82 others); Thu, 1 Dec 2022 11:25:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232006AbiLAQZ1 (ORCPT ); Thu, 1 Dec 2022 11:25:27 -0500 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00BD39AE20 for ; Thu, 1 Dec 2022 08:25:25 -0800 (PST) Received: by mail-pl1-x62c.google.com with SMTP id d3so2102339plr.10 for ; Thu, 01 Dec 2022 08:25:25 -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=DJn63ijABqaX2jSzYldLgtMX1wvMD+wjMrL7ejU3DM4=; b=jmk3F/NJq35iV/doRjj3egs6c6k+X6EGEse4MdJIqMjLPyBNbo1AKFivgdvn9isEsu b2/fdEveK6CbqH6tF4SjKHNbD8g317v8VOBJ10LrTh8t8eG/36wa+kzxD+shOG6q69+h 61DU5kG4G81dhs7bHAQo1DboGFu1f9j9UT8cI= 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=DJn63ijABqaX2jSzYldLgtMX1wvMD+wjMrL7ejU3DM4=; b=p3Kwt6FqbaTOPAZahl3SXgnF8uGhQPfMCaC207Z0oAq52HbZ4232EKaER38kjHMrEH NDK9zsOD/6WoNz30skw56d0wh6gMWSGxrDXsT1KbkF9tKclvGYHeuW0dCXM4M92uIa82 7e8KJiJu7k1+YxLajwyJUKWMWksoV/BZfxBb0GOeHRt7jzolz4tkWKHMQDHAh85f3/8m wGzUYF/TFomR9QxnWBs6zK34UeA7xtIMgWMVYN6kumsBIMeiSkh3GjUUxaSlTUx8/Nz1 aJd55CAZl60nkB0pC2ycO33JYYIZKgWkuDIaZESZXR9/UZDxtItOLo1gB7BQKs3e0p+Y eWxQ== X-Gm-Message-State: ANoB5pkT7sO+MyD3uSVfuez7Pl2bmpHKZaKkoPOtnGNtu8P3v02mw0qz W2H1VFoWMKqn3UUMI1AB/QOcRQ== X-Received: by 2002:a17:902:db10:b0:189:5858:43c0 with SMTP id m16-20020a170902db1000b00189585843c0mr38387356plx.71.1669911925434; Thu, 01 Dec 2022 08:25:25 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id i22-20020a635416000000b00460ea630c1bsm2749336pgb.46.2022.12.01.08.25.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 08:25:24 -0800 (PST) From: coverity-bot X-Google-Original-From: coverity-bot Date: Thu, 1 Dec 2022 08:25:24 -0800 To: Sean Christopherson Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Borislav Petkov , Ingo Molnar , "H. Peter Anvin" , Thomas Gleixner , Paolo Bonzini , Sean Christopherson , kvm@vger.kernel.org, Dave Hansen , "Gustavo A. R. Silva" , linux-next@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Coverity: handle_vmclear(): Error handling issues Message-ID: <202212010825.C23022D@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 Dec 14 17:59:46 2018 +0100 55d2375e58a6 ("KVM: nVMX: Move nested code to dedicated files") Coverity reported the following: *** CID 1527765: Error handling issues (CHECKED_RETURN) arch/x86/kvm/vmx/nested.c:5269 in handle_vmclear() 5263 */ 5264 if (likely(!guest_cpuid_has_evmcs(vcpu) || 5265 !evmptr_is_valid(nested_get_evmptr(vcpu)))) { 5266 if (vmptr == vmx->nested.current_vmptr) 5267 nested_release_vmcs12(vcpu); 5268 vvv CID 1527765: Error handling issues (CHECKED_RETURN) vvv Calling "kvm_vcpu_write_guest" without checking return value (as is done elsewhere 7 out of 8 times). 5269 kvm_vcpu_write_guest(vcpu, 5270 vmptr + offsetof(struct vmcs12, 5271 launch_state), 5272 &zero, sizeof(zero)); 5273 } else if (vmx->nested.hv_evmcs && vmptr == vmx->nested.hv_evmcs_vmptr) { 5274 nested_release_evmcs(vcpu); 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: 1527765 ("Error handling issues") Fixes: 55d2375e58a6 ("KVM: nVMX: Move nested code to dedicated files") Thanks for your attention! -- Coverity-bot