Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752901AbdLENyP (ORCPT ); Tue, 5 Dec 2017 08:54:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33722 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750810AbdLENyH (ORCPT ); Tue, 5 Dec 2017 08:54:07 -0500 Subject: Re: [PATCH v2] KVM: VMX: Fix rflags cache during vCPU reset To: Wanpeng Li , Jim Mattson Cc: "linux-kernel@vger.kernel.org" , kvm , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Wanpeng Li , Nadav Amit , Dmitry Vyukov References: <1511218341-6221-1-git-send-email-wanpeng.li@hotmail.com> From: Paolo Bonzini Message-ID: <049b65c8-63a2-4c67-b66f-3b063038e3f8@redhat.com> Date: Tue, 5 Dec 2017 14:54:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 05 Dec 2017 13:54:07 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 468 Lines: 13 On 05/12/2017 01:53, Wanpeng Li wrote: >> That seems like a convoluted path to produce an illegal RFLAGS value. >> What's to prevent syzkaller from simply clearing bit 1 of RFLAGS with >> the KVM_SET_REGS ioctl? > Yeah, it can happen. Which do you prefer, ioctl fails or | > X86_EFLAGS_FIXED unconditionally in the ioctl handler in kvm? I suspect somebody might be passing an all-zero regs struct to KVM_SET_REGS, so ORing X86_EFLAGS_FIXED is better. Thanks, Paolo