Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4051835ybb; Mon, 23 Mar 2020 12:32:16 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt72hKhZ3fJ6KRq/TbauD8xUyTIrKOdtJxFPstE1NYwymzmgTn3/BwTrSsq2VdlfLzmM1AM X-Received: by 2002:a9d:70d0:: with SMTP id w16mr6203034otj.9.1584991936157; Mon, 23 Mar 2020 12:32:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584991936; cv=none; d=google.com; s=arc-20160816; b=aSNTxYYcyEzOZs8/aBBaJOSEylQTXXCWS5yPQVteKiygoGdoQoLDjs8l/n/lfOgAE7 6GA6NhCSgux2HU1NpXydFE1mVjr46i4b0CRXgMa5G4kAiUceBfMuZE0GenLR80IYFR99 ZpV4sSxbveQcSyVcoELncHwUVxoei+onjkfsX8jpiryENCti89QoEydVtPUXPFkmcXjR mZgAhxguPYpc9Clzg3+923JZdYYh8t0G6xtf2/n8VOZcW87jRZYyJMy5NziuqckwFKS1 uaWUpOKCERpG4ZI2gIvWTOUsgMz0vgACgT6KYLIzntuasAtJi/FlocPEJFyBPHBxMUe7 8YgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=DSiiinnDsM5Ld5HkYiOfO11ZFTG2X1EpUiB46MpxJGU=; b=KEMn+AZrjt9r1ICCbTXUNT0klL3o+tUW5+tNI16paaPuLj/BX7AfmY1DsIGKJscm20 6Quy19dH6MyNjciJ2Ng7qKKhtfgPVz9SdSKrbuyx1CR3csSmr48e7i3H9Z4IFbB0n2uL ACV5IMQYsVHlp2d0de6n5YfIs6wCHqol/yPVmadCg9PFVLit+Fivtc2ryuLIn2vrGaXk Th/mervk1hNXzK8bjWkTEoNVea6kETgSN7riRHmJd1Whae30iSi44zoNbpSKMmmcoJT4 +cZHe2bNoMOlu5zDuHllb5vmVQs51d7KJddvf+PK/KBNTaWa4+FxxhxwZSvUbiBpFP+4 F6og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=gRoKlRBy; 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 d8si8652701oti.306.2020.03.23.12.32.04; Mon, 23 Mar 2020 12:32:16 -0700 (PDT) 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=gRoKlRBy; 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 S1727868AbgCWTbL (ORCPT + 99 others); Mon, 23 Mar 2020 15:31:11 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:36160 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727600AbgCWTbK (ORCPT ); Mon, 23 Mar 2020 15:31:10 -0400 Received: by mail-pf1-f193.google.com with SMTP id i13so8011908pfe.3 for ; Mon, 23 Mar 2020 12:31:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DSiiinnDsM5Ld5HkYiOfO11ZFTG2X1EpUiB46MpxJGU=; b=gRoKlRByEmrdJ+1XGErh+VIj4YLl+vePxDE3A6fdOgcivVHRUViqrAbPzcxgGwhnhi bDM7UdOSCZI2AanpF39P+26KWSMv64vH6zbFjifBY035FpxkJyg50JoPEEElYgex9cgN 9CAjArYhHoB9Bu7JPxm1FkN70XxmMi8JbGjY0HLVPqLM46MNUvvozDj/u3qI/T+/Wx0U 6tOdvkDE034k26A2alpGO62lAKoInSYVqNIcj2zQDg6PjnCM+ogcxVMG0HOnjjdFGu4U VPaM+4pMJDSqWW2pTxo/G/ZVIKnoNkFhib1S/AB2zBUIsDRq+u839k1sy+GLdQV/ma50 3sIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DSiiinnDsM5Ld5HkYiOfO11ZFTG2X1EpUiB46MpxJGU=; b=KQYYFqzp7Q278Ewfu3x+zjwnLKRbigbo9k2DkcKpjoi+uvhG/hEbcCUTkiTWadGzgH WYgjsx8oC/OaZwi8f9mKn3j7ivROJKS9ZkZTH3gdXVZ+ij9VMBfkkNdRy+3zYYCKmgfD mtQpZBfvPTWCHIVkFfu0jn76Xvo5/NCOXhePn1ynZUFF4O6+l2qcFd5zcSAfSRlZ5FHG /umJ4+eZw9niY7WZFlEAZMJ2bQYG5gz/W7NTXRShT9ygPwF+uFvhYdsc3YHRKiha3kia 6gKd12AMGTrNXUN20AhSwB1y0MiyDPYzdVUIu0nbew44qA6mhsrU2SV7+qnTuvarAQQK SAXA== X-Gm-Message-State: ANhLgQ1gsKgKosaH8ffj3QoNCmzOQ3rqnGHDoHSsQFbj1h5zHSfKDXza dZG9sBsDe4K0lKVcNTDlXMHYWZ/E6Y/n3mPZNQYhSQ== X-Received: by 2002:aa7:8b54:: with SMTP id i20mr25380850pfd.39.1584991867491; Mon, 23 Mar 2020 12:31:07 -0700 (PDT) MIME-Version: 1.0 References: <000000000000277a0405a16bd5c9@google.com> <5058aabe-f32d-b8ef-57ed-f9c0206304c5@redhat.com> <20200323163925.GP28711@linux.intel.com> In-Reply-To: From: Nick Desaulniers Date: Mon, 23 Mar 2020 12:30:53 -0700 Message-ID: Subject: Re: BUG: unable to handle kernel NULL pointer dereference in handle_external_interrupt_irqoff To: Alexander Potapenko Cc: Dmitry Vyukov , Paolo Bonzini , syzbot , clang-built-linux , Borislav Petkov , "H. Peter Anvin" , Jim Mattson , Joerg Roedel , KVM list , LKML , Ingo Molnar , syzkaller-bugs , Thomas Gleixner , Vitaly Kuznetsov , Wanpeng Li , "the arch/x86 maintainers" , Sean Christopherson Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 23, 2020 at 11:49 AM Nick Desaulniers wrote: > > So maybe we can find why > commit 76b043848fd2 ("x86/retpoline: Add initial retpoline support") > added THUNK_TARGET with and without "m" constraint, and either: > - remove "m" from THUNK_TARGET. (Maybe this doesn't compile somewhere) > or > - use my above recommendation locally avoiding THUNK_TARGET. We can > use "r" rather than "a" (what Clang would have picked) or "b (what GCC > would have picked) to give the compilers maximal flexibility. So I've sent a patch for the latter; my reason for not pursuing the former is: 1. I assume that the thunk target could be spilled, or a pointer, and we'd like to keep flexibility for the general case of inline asm that doesn't modify the stack pointer. 2. `entry` is local to `handle_external_interrupt_irqoff`; it's not being passed in via pointer as a function parameter. 3. register pressure is irrelevant if the resulting code is incorrect. -- Thanks, ~Nick Desaulniers