Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2489683imu; Thu, 24 Jan 2019 13:46:32 -0800 (PST) X-Google-Smtp-Source: ALg8bN5DUk5tiVy5JGdbUS5PXOHkLAsyfl6vuEa6H7JJXnL1np7JvK7lqHp7gvNA2y538kFNKHJW X-Received: by 2002:a63:5b1f:: with SMTP id p31mr7468795pgb.56.1548366392072; Thu, 24 Jan 2019 13:46:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548366392; cv=none; d=google.com; s=arc-20160816; b=KeKSVGCbab3+HVeGySjuwZfWfuyiDxePFZLpyV7jwYTxn+UId/hlrpIBEHJwx+11Km y9URtis5itZ0MG3C+W+IgMFqZ5CGtYKNwIFJ9IG/I7DjpvPqhZLeW56HN/2Hbk125CoV CcVJCZRKiFfQRZKftyUarE7XYnkyubY1HNVttRskQRzqVp3Jm5ICgIh4A4KgEEulzPdm 3ZrM5QEMnD7rjLLXeTSycJAhXDOYZiilGqkG8HWKbap2kXASTmpdnpel1g+3qLFQMUZu gFKbV0mTeYGfrWKJ9CSz0OWzo1m+WlYk1tp4/IjLt618kZV4bvWSwOoN8pl4kpDvH8Jm 408A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=TrDZii3mPD2cyirFklI+XY6foFu42Tl0biRwdMhEyFA=; b=wZnTVJ0ej0hPwMl+G87eH1tvgG9HL5T0wjNw1M9YOBP6vn3FSO/GGxVbfOGiYRQ3UD DMk/x05W0WnYTC6fLJKbTwTgZrDmROsP17Cth4f1VtA9M42kcP5kF0+tIiczHuuqbNBW S4EuVQyVV8ZOCnU1gZXEDoawFpnBLEH9qtRKbLoJGyO8THxl6fE//pbi3N9zhMunhIqr nQaxUpGHChbIGQi2KkbuPBdHZE6Em6r/PH13ctnijKpn3Ce7T60gFGaNNYgWcnvYr/1Z mUiJVX2NTVSryCiPOmCIpZ/BD9S2jyQN3Y7rNwwX+cebAhn9SebJDP12DdSVLCbhnHjv GyXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=drXtzS1I; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i63si22773902pgc.116.2019.01.24.13.46.16; Thu, 24 Jan 2019 13:46:32 -0800 (PST) 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; dkim=pass header.i=@google.com header.s=20161025 header.b=drXtzS1I; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727862AbfAXVqL (ORCPT + 99 others); Thu, 24 Jan 2019 16:46:11 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:33085 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726126AbfAXVqK (ORCPT ); Thu, 24 Jan 2019 16:46:10 -0500 Received: by mail-pl1-f194.google.com with SMTP id z23so3518486plo.0 for ; Thu, 24 Jan 2019 13:46:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=TrDZii3mPD2cyirFklI+XY6foFu42Tl0biRwdMhEyFA=; b=drXtzS1I1MQhgYis+j+C9ZLKFE15dpyaDIayCTwfdb1HmoBlvNF2L8OszIDYcvIvaF HU3yhq1SBBgYqmm/b5nufOzcklsuvP8sgNTtRo/OZhF0Z/xv4dYB/uG0y+N+J8r9Lff5 eR1rQUdxdRUHBGgrcD4ZWIEnYJfYhNqo0O8UBPOawLnQZ9qdvwhxoIKxTE4gtTrEdKeD cN2WcRPvwWy+4hfSp8j6pR7SkG6yPlUOC6A79pBN1Q5cqp3iXLMVzEPrb8+u6hLARmZd oyEmXMaxPGvUOs9STviKe12bMAvRjXlkv70N3AzMK2H+kR95nNMKbH9803Yoil/zzhw/ 0iDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=TrDZii3mPD2cyirFklI+XY6foFu42Tl0biRwdMhEyFA=; b=JcAk4uXzpEULg7M+7+de+PtJT+srLH9tiG44Mc6WH4/j6JCuBENDzRWjCsflWPS8Wr Y81/1wZK3wfkjr2G1KMzbEtpe26XXiTwrPKyTwmUpri9Q2+eOJ1mGzp7OJ+jUCbZlMrj ELjg6zzVjzoDjft62MiHqhB5CAY/RmK4X1Gscl+WrrvZsM70OUlzdh0fOES6fNImmX7u nSjVugXtmFaQi80inTKn/7GuSMZRsZBb1XXdwhhtImiJyOH16T/SpspmM1J8nBNZuvOM tAS+jpqd6QtYQfSlQ3fM1rj8Ta+Qto4mEi//U4mJBgBAAL+Oty3rdR04Ppgkrl47o4HY igQA== X-Gm-Message-State: AJcUukfIeK4hXcgwpUVrcz3+Xdrq0FyXy3l0952FYL/GRraYCJtS8gt9 LwD4tUFoerbXn0goS/mqOndhwQ== X-Received: by 2002:a17:902:5601:: with SMTP id h1mr8399241pli.160.1548366369953; Thu, 24 Jan 2019 13:46:09 -0800 (PST) Received: from google.com ([2620:15c:17:4:f0b1:8ff5:16a0:5f15]) by smtp.gmail.com with ESMTPSA id d21sm31792799pfo.162.2019.01.24.13.46.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Jan 2019 13:46:09 -0800 (PST) Date: Thu, 24 Jan 2019 13:46:05 -0800 From: Tom Roeder To: Paolo Bonzini Cc: Sean Christopherson , Radim =?utf-8?B?S3LEjW3DocWZ?= , Liran Alon , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, syzbot+ded1696f6b50b615b630@syzkaller.appspotmail.com Subject: Re: [RFC PATCH] kvm: x86/vmx: Use kzalloc for cached_vmcs12 Message-ID: <20190124214605.GA174751@google.com> References: <6f79d9be-fa76-3a06-2612-f44f3a18ece7@redhat.com> <20190114234728.49239-1-tmroeder@google.com> <20190115024304.GD5141@linux.intel.com> <20190115175111.GB68985@google.com> <20190123183322.GB160275@google.com> <7abea144-772d-bb3a-bd7d-a9117305c2fb@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7abea144-772d-bb3a-bd7d-a9117305c2fb@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 24, 2019 at 02:18:26AM +0100, Paolo Bonzini wrote: > On 23/01/19 19:33, Tom Roeder wrote: > > > > Even in vmx_set_nested_state, there are about 30 lines of code in > > between enter_vmx_operation and copy_from_user, and there are a couple > > of cases that cause vmx_set_nested_state to return with an error. So if > > we want to fix this by handling all the error paths, I think it might be > > cleanest to convert vmx_set_nested_state to use goto error handling, > > since that would allow us to clear the allocated memory in one place. > > I prefer to have kzalloc, and change vmx_get_nested_state to copy the > whole page including the trailing zeroes. OK, sending as a v2 patch in a new thread.