Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3067626ybt; Mon, 29 Jun 2020 14:25:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFt3ud2v6okVNjaO4t/06GGJ6kOc+wkelVaFgvZqG2hW0Y89Y+ppI/tmNFDRC+S/PJEFUX X-Received: by 2002:a50:d78f:: with SMTP id w15mr20440673edi.245.1593465955128; Mon, 29 Jun 2020 14:25:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593465955; cv=none; d=google.com; s=arc-20160816; b=VKUnfhGp+DExRRoe3u0JS4GxNhGi8fJyfgkXDjVCTCFyoUy7ZIW+s5Rw8tuLnT5wz1 vpphoCkpo4uBELkN8K9wufLIHi6ivqjTPoiIcTq9BXwSPs28WEwMRIG9U817tzsE1Zps Y/cJtQdr4IubF05ip4Zrfn3euCIxlpMcZ+JgG/JpIVBemjDuWVFmOlOcxViNkVGiCZI5 iVWhWgTb22dXmMYHyNdPWdjsavNojC+2KDKXIYWX7/l4AXHP2ewWd8JDfrrXXBbIVx0/ 0G/Lnr2C3Av+kwOE9HvIqCEMllCMOQ3682IDL+W+CJwn5vduJ/NBSUv+rBjBiT4ZRXA8 II6Q== 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:ironport-sdr:ironport-sdr; bh=OVC0xD1VrIqOA0zaBkHEPsL/fSizih9h1oBQN8fmHm0=; b=zjftxsB6IFuGOnJfgK/7gDDLH/lX4gFZGlY4i1P6+e1HYvLWvcBPnuiUjgiEIGMlGb hao61KsapjqcynPsB3nPF1cqpnlQUKM0JwzNnHAufDea5tQz8hbNdm66bFyvbmHpu+Xj pU3MrC07QuBSb3kGp2mT5fpFIsldNtxOgiQ8918KyMX5lXC7J9H6oYmt/GPy2bt1tBmW 6XQadEVbu+Iq2MkpRZXWzLYdUBg1/vjRGeA4aEa65WoYBrbKxEo8WWCvJnhHnPcxcoHp X+yd+qRcUlBXjAmZi/MJI+pQwlVTKFhpHM7UjHKR+XyIGWJ+rUGJ9n/oUKwoHBY8v4AK ihWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y1si423268edt.101.2020.06.29.14.25.32; Mon, 29 Jun 2020 14:25:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729152AbgF2Sua (ORCPT + 99 others); Mon, 29 Jun 2020 14:50:30 -0400 Received: from mga06.intel.com ([134.134.136.31]:65036 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728989AbgF2Su3 (ORCPT ); Mon, 29 Jun 2020 14:50:29 -0400 IronPort-SDR: 3HsAtCcAK206/0dLM5Y5p9QJWiqL9Mqqy0uFotOEhnjUVyWY1GwetYl/z8ZXmdZhUgkRBjhvdA QwlWfvvtM6KA== X-IronPort-AV: E=McAfee;i="6000,8403,9666"; a="207497668" X-IronPort-AV: E=Sophos;i="5.75,295,1589266800"; d="scan'208";a="207497668" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jun 2020 08:35:25 -0700 IronPort-SDR: pUypuiC+OyJPqwDrCxOgRJO5xsFjlcTMhcZ2ZIIjmeac+XqYlbQiMUEWHK8+4HTA8kW4ZtW2eT Jtxl6HzIG9EQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,295,1589266800"; d="scan'208";a="264863710" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.152]) by fmsmga007.fm.intel.com with ESMTP; 29 Jun 2020 08:35:25 -0700 Date: Mon, 29 Jun 2020 08:35:24 -0700 From: Sean Christopherson To: Andrey Konovalov Cc: Paolo Bonzini , syzbot , Borislav Petkov , "H. Peter Anvin" , Jim Mattson , joro@8bytes.org, KVM list , LKML , Ingo Molnar , syzkaller-bugs , Thomas Gleixner , vkuznets@redhat.com, wanpengli@tencent.com, the arch/x86 maintainers Subject: Re: KASAN: out-of-bounds Read in kvm_arch_hardware_setup Message-ID: <20200629153524.GB12312@linux.intel.com> References: <000000000000a0784a05a916495e@google.com> <04786ba2-4934-c544-63d1-4d5d36dc5822@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 29, 2020 at 05:29:56PM +0200, Andrey Konovalov wrote: > On Mon, Jun 29, 2020 at 5:25 PM Paolo Bonzini wrote: > > > > The reproducer has nothing to do with KVM: > > > > # https://syzkaller.appspot.com/bug?id=c356395d480ca736b00443ad89cd76fd7d209013 > > # See https://goo.gl/kgGztJ for information about syzkaller reproducers. > > #{"repeat":true,"procs":1,"sandbox":"","fault_call":-1,"close_fds":false,"segv":true} > > r0 = openat$fb0(0xffffffffffffff9c, &(0x7f0000000180)='/dev/fb0\x00', 0x0, 0x0) > > ioctl$FBIOPUT_VSCREENINFO(r0, 0x4601, &(0x7f0000000000)={0x0, 0x80, 0xc80, 0x0, 0x2, 0x1, 0x4, 0x0, {0x0, 0x0, 0x1}, {0x0, 0x0, 0xfffffffc}, {}, {}, 0x0, 0x40}) > > > > but the stack trace does. On the other hand, the address seems okay: > > > > kvm_cpu_caps+0x24/0x50 > > > > and there are tons of other kvm_cpu_cap_get calls that aren't causing > > KASAN to complain. The variable is initialized from > > > > kvm_arch_hardware_setup > > hardware_setup (in arch/x86/kvm/vmx/vmx.c) > > vmx_set_cpu_caps > > kvm_set_cpu_caps > > > > with a simple memcpy that writes the entire array. Does anyone understand > > what is going on here? > > Most likely a bug in /dev/fb handlers caused a memory corruption in > kvm related memory. That's my assumption as well. There's another syzbot failure[*] that points at KVM but whose reproducer is a single FBIOPUT_VSCREENINFO. In that case, the pointer from "&cpu_data(smp_processor_id())" is NULL, i.e. highly unlikely to be a KVM bug. [*] https://lkml.kernel.org/r/000000000000077a6505a8bf57b2@google.com > > Paolo > > > > On 27/06/20 22:01, syzbot wrote: > > > BUG: KASAN: out-of-bounds in kvm_cpu_cap_get arch/x86/kvm/cpuid.h:292 [inline] > > > BUG: KASAN: out-of-bounds in kvm_cpu_cap_has arch/x86/kvm/cpuid.h:297 [inline] > > > BUG: KASAN: out-of-bounds in kvm_init_msr_list arch/x86/kvm/x86.c:5362 [inline] > > > BUG: KASAN: out-of-bounds in kvm_arch_hardware_setup+0xb05/0xf40 arch/x86/kvm/x86.c:9802 > > > Read of size 4 at addr ffffffff896c3134 by task syz-executor614/6786 > > > > > > CPU: 1 PID: 6786 Comm: syz-executor614 Not tainted 5.7.0-syzkaller #0 > > > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 > > > Call Trace: > > > > > > __dump_stack lib/dump_stack.c:77 [inline] > > > dump_stack+0x1e9/0x30e lib/dump_stack.c:118 > > > print_address_description+0x66/0x5a0 mm/kasan/report.c:383 > > > __kasan_report mm/kasan/report.c:513 [inline] > > > kasan_report+0x132/0x1d0 mm/kasan/report.c:530 > > > kvm_cpu_cap_get arch/x86/kvm/cpuid.h:292 [inline] > > > kvm_cpu_cap_has arch/x86/kvm/cpuid.h:297 [inline] > > > kvm_init_msr_list arch/x86/kvm/x86.c:5362 [inline] > > > kvm_arch_hardware_setup+0xb05/0xf40 arch/x86/kvm/x86.c:9802 > > > > > > > > > The buggy address belongs to the variable: > > > kvm_cpu_caps+0x24/0x50 > > > > > > Memory state around the buggy address: > > > ffffffff896c3000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > > > ffffffff896c3080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > > >> ffffffff896c3100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > > > ^ > > > ffffffff896c3180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > > > ffffffff896c3200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > > > ================================================================== > > > > -- > > You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group. > > To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bugs+unsubscribe@googlegroups.com. > > To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller-bugs/04786ba2-4934-c544-63d1-4d5d36dc5822%40redhat.com.