From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3FCFC433F5 for ; Wed, 29 Sep 2021 07:42:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8EA12613A0 for ; Wed, 29 Sep 2021 07:42:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8EA12613A0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YILzuy6odA2ighSWTe+CFpESC39y83R6rRbs8EdplPs=; b=bUt9hGzJuhNxEQ WtCFfoX5CKQvKRIe60Ha2SU/mA+YEorPc/sCTkfnpNaqNb2RClESZSFwk//s92VBAUaOG5WFqsSTG XHiUN+R9oD/5oz+ix/tSe1nG18gpMJ7lopeXjdbz4basLPi/epLkFaTnar4qkBNTx/iYkohxKNQhU TlPrLUcP/7BCwTzGzXkNyq4Mzaz6X3spzLG0cldsOCtC+E4dYwPdBKNXaO8pg6S7V/HtSTTjkRh1J MXeSPFcVWVriW2q9tx6oxm/YA6k+kxG9hwLxAsRSXy44DUwRr1z3OCW3MFTumMjAoRkN2WuPkg5Dm MMgxBT9FQbTv3L7j9pog==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVUC5-00AI0S-4H; Wed, 29 Sep 2021 07:39:57 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVUC0-00AI0M-E0 for linux-arm-kernel@bombadil.infradead.org; Wed, 29 Sep 2021 07:39:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=VkS0cByfycR7IUntKmzAdGZYgQquvhdpPBQ2pD9v+cM=; b=mKSPGDpxkeRqEwh5TlZm4fZA2O 0ABC1F6qO7GglhEWW5N+wBKyl9AAPlkDYsHfEGLSk9vQ2TBuC8x1vnTJaTzT81NSLd7JupEAs5+k5 QSeZuXJ5I/3ePl7muEEi+tpiPmCMIrrisFx1Vr270buugAIkfBEhBTyase4hpvyVmqAil4ZRpAnB7 lghBHps1rpNJzWuOaZ/Ii+dmvLTf1p3vJRi8R6IIaQ+faluqeA1biQra4y/eoI/bPNwhU6yS0ug7/ uZ/slWJCpqeTyEStYf8zDAqYzw3cLkuaa+RnbfQc6chDsWfraJ92fCNe/eFAj7eiHJFrH7fpQCf4e AnBmu8vQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVUBw-006fNy-C1; Wed, 29 Sep 2021 07:39:48 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 8ACE930029A; Wed, 29 Sep 2021 09:39:47 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 404E52BBF9839; Wed, 29 Sep 2021 09:39:47 +0200 (CEST) Date: Wed, 29 Sep 2021 09:39:47 +0200 From: Peter Zijlstra To: Josh Poimboeuf Cc: Mark Rutland , Dmitry Vyukov , syzbot , Linux ARM , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, viro@zeniv.linux.org.uk, will@kernel.org, x86@kernel.org Subject: Re: [syzbot] upstream test error: KASAN: invalid-access Read in __entry_tramp_text_end Message-ID: References: <000000000000a3cf8605cb2a1ec0@google.com> <20210921165134.GE35846@C02TD0UTHF1T.local> <20210927170122.GA9201@C02TD0UTHF1T.local> <20210927171812.GB9201@C02TD0UTHF1T.local> <20210928103543.GF1924@C02TD0UTHF1T.local> <20210929013637.bcarm56e4mqo3ndt@treble> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210929013637.bcarm56e4mqo3ndt@treble> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Sep 28, 2021 at 06:36:37PM -0700, Josh Poimboeuf wrote: > On Tue, Sep 28, 2021 at 11:35:43AM +0100, Mark Rutland wrote: > > > In the other x86 thread Josh Poimboeuf suggested to use asm goto to a > > > cold part of the function instead of .fixup: > > > https://lore.kernel.org/lkml/20210927234543.6waods7rraxseind@treble/ > > > This sounds like a more reliable solution that will cause less > > > maintenance burden. Would it work for arm64 as well? > > > > Maybe we can use that when CC_HAS_ASM_GOTO_OUTPUT is avaiable, but in > > general we can't rely on asm goto supporting output arguments (and IIRC > > GCC doesn't support that at all), so we'd still have to support the > > current fixup scheme. gcc-11 has it > Even without CC_HAS_ASM_GOTO_OUTPUT it should still be possible to hack > something together if you split the original insn asm and the extable > asm into separate statements, like: > > diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h > index 6b52182e178a..8f62469f2027 100644 > --- a/arch/x86/include/asm/msr.h > +++ b/arch/x86/include/asm/msr.h > @@ -137,20 +139,21 @@ static inline unsigned long long native_read_msr_safe(unsigned int msr, > { > DECLARE_ARGS(val, low, high); > > + *err = 0; > + asm volatile("417: rdmsr\n" > + : EAX_EDX_RET(val, low, high) > + : "c" (msr)); > + asm_volatile_goto(_ASM_EXTABLE(417b, %l[Efault]) :::: Efault); That's terrible :-) Could probably do with a comment, but might just work.. > + > +done: > if (tracepoint_enabled(read_msr)) > do_trace_read_msr(msr, EAX_EDX_VAL(val, low, high), *err); > return EAX_EDX_VAL(val, low, high); > + > +Efault: > + *err = -EIO; > + ZERO_ARGS(val, low, high); > + goto done; > } > > /* Can be uninlined because referenced by paravirt */ > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel