Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1154931ybg; Tue, 2 Jun 2020 02:46:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgFdqfWesvq3ARKMGHateszRXFHS4ZxmvAddzNZW9SNWTbXOCTJTPSLn3rwm/S7VvEL4i1 X-Received: by 2002:a05:6402:362:: with SMTP id s2mr9164843edw.337.1591091178414; Tue, 02 Jun 2020 02:46:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591091178; cv=none; d=google.com; s=arc-20160816; b=jWJ8DCYsoiRZNdX6MMSm0fPocEHtF3BGke6xPU0gvMmy4rH1kU3rONYNYf2fJ6F0YF p01ujfpwJC6C7gQApWXKru+UCIDdrs75OzE8G9K49yYe7ScgeBe/uwE1RA2PN3+8E7Ch mgz4fR03otDfXF5VuUqy7vd/ioeBGK7YmehvaDLhmQ6DWGjLcDSCLZJdx9Uuq/Snn14U BQYHnkmYFREbtCCuZ8Ez94/Mr8GHg6KVReRqwnQSKD621RKTjYa5YfeTkgwfcfvZ7O3e vfG0NU2MBEoRHUkKRs/kC6KFIzJ37kC2uHLD0Jbq9MxInl4csSKOUE0poIOzgLvRf11H Fnhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=f/FIn/xczaJeGePujbt0xf56oNTzmB6hv0F5AGXANOY=; b=UObaUctMq0Lxp49YNoEe+zsMH0yWHAZuinSTIpFt5qvG5RXfTval+gh9wFblq425ps Z59llYIfA51rpRuMiCDYmTGjHITSVTmJjBHKpRM3tW/6n6gxyoS4eziIUnW5AZ6RF/hg RFtZgwbg4Ub6oknM+HdcO8fi2lduuuDO95xaqZ39BrxVThSUBxQRVIXjiHKPaKI50Q+N 9tiH8d3fSZjOUBIcB2nTMYAjI1+8d+qP9VNaLQV5g1eO3Y4UCmQ1fjQZoA75R2u6KoHt WNwW0LlzRa0pMCwCfl3d1DaMt3tWtVP3QmkoRHm2i07vGyMSK875WP4gnLoa2IaenKD+ NrGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=n9ailRcx; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z1si1183068edm.572.2020.06.02.02.45.55; Tue, 02 Jun 2020 02:46:18 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=n9ailRcx; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726461AbgFBJmC (ORCPT + 99 others); Tue, 2 Jun 2020 05:42:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726012AbgFBJmC (ORCPT ); Tue, 2 Jun 2020 05:42:02 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63643C061A0E for ; Tue, 2 Jun 2020 02:42:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=f/FIn/xczaJeGePujbt0xf56oNTzmB6hv0F5AGXANOY=; b=n9ailRcxmwDHuN4y39t3uAcBWn 4jijjsifTGp2bxjydLv6sdUvxJ30PH/t1EjdQAjky+LhhaliNE1cQIxCL9J8pJFhd4iFaXV0GYVx2 KDDtA6F6Y/AmzJxoXlu5gva8zPXq9DuJmiLo0XQM140SJ88nimPYx7hEO+dRlvMs396mB70AZ3MUN 3NIi6QfCe+K/BNhwhhJukY74bmW6GvDrN0dyHyITbstcKRjTLv24u9/zjB50lge9ey+5gF81I3iYr aF13PbWnReUkcA8jsLUNzroD04eNykXEVghK8X3aWbAA1juTRswfz+c4l0eCwaSmNqQw2upBfJI3q jVY3ySJw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jg3QW-0000NT-IR; Tue, 02 Jun 2020 09:41:44 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 52F053011B2; Tue, 2 Jun 2020 11:41:41 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 34B1A2B9905AB; Tue, 2 Jun 2020 11:41:41 +0200 (CEST) Date: Tue, 2 Jun 2020 11:41:41 +0200 From: Peter Zijlstra To: Marco Elver Cc: Dmitry Vyukov , Thomas Gleixner , syzbot , LKML , syzkaller-bugs , Ingo Molnar , Borislav Petkov , the arch/x86 maintainers , Oleg Nesterov , kasan-dev Subject: Re: PANIC: double fault in fixup_bad_iret Message-ID: <20200602094141.GR706495@hirez.programming.kicks-ass.net> References: <000000000000d2474c05a6c938fe@google.com> <87o8q6n38p.fsf@nanos.tec.linutronix.de> <20200529160711.GC706460@hirez.programming.kicks-ass.net> <20200529171104.GD706518@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 01, 2020 at 02:40:31PM +0200, Marco Elver wrote: > I think Peter wanted to send a patch to add __no_kcsan to noinstr: > https://lkml.kernel.org/r/20200529170755.GN706495@hirez.programming.kicks-ass.net > > In the same patch we can add __no_sanitize_address to noinstr. But: > > - We're missing a definition for __no_sanitize_undefined and > __no_sanitize_coverage. Do those function attributes actually work? Because the last time I played with some of that I didn't. Specifically: unmarked __always_inline functions must not generate instrumentation when they're inlined into a __no_*san function. (and that fails to build on some GCC versions, and I think fails to actually work on the rest of them, but I'd have to double check) > - We still need the above blanket no-instrument for x86 because of > GCC. We could guard it with "ifdef CONFIG_CC_IS_GCC". Right; so all of GCC is broken vs that function attribute stuff? Any plans of getting that fixed? Do we have GCC that care? Does the GCC plugin approach sound like a viable alternative implementation of all this? Anyway, we can make it: KASAN := SANITIZER_HAS_FUNCTION_ATTRIBUTES or something, and only make that 'y' when the compiler is sane. > Not sure what the best strategy is to minimize patch conflicts. For > now I could send just the patches to add missing definitions. If you'd > like me to send all patches (including modifying 'noinstr'), let me > know. If you're going to do patches anyway, might as well do that :-)