Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp300226rwb; Thu, 18 Aug 2022 04:14:13 -0700 (PDT) X-Google-Smtp-Source: AA6agR6Qnzn/oUd5PZvd9VpJprFgMoz47xfh/dex/Gb5wiIgmbzrLWP0IhQbiZAcQgbNM37LxjKx X-Received: by 2002:a17:902:e5cc:b0:16f:1153:c519 with SMTP id u12-20020a170902e5cc00b0016f1153c519mr2417132plf.151.1660821253279; Thu, 18 Aug 2022 04:14:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660821253; cv=none; d=google.com; s=arc-20160816; b=UYrhF4yXgJTDM0fyXB16lhBmTqnPbC8h0bTaMjhWUuuCp5IVXZ7DfUQb6AAXip8yNN 0m7HDlOH2pbPfEGJznz+kjhnyc+SwTlqBRQZGxyUFvC1DS3nKpAD2GqWUUnX7rd7Cjac rmgKa5uxGe8cVuAH1cJ0TkA+ubdnLXNORhEePKBLgrv64qdhki7nFmOFWYhVL8LucKyW GC+tmuh1iu+dsoF1RDDS+HqBz29dhFp7poo5g2oTjToy/Y/0Uo4oLY1NYpEu4ue6rWQV 1VzxVAGw4dkndlNKox1OY82mPEgBOoGgeKdB/S9n+cjybJWKrpEl1nOQTUilhmey0eFf uLkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=JAOa0ChfVERJUOWkiQMYGLUFzmPebbpTN+VwHYZPi1Q=; b=Y9b1hUS7cTTxCx2HFJA1FTmj2idpHbT95IFemTvqo+v767FuYWiphE7S6E3ni3ouJr 9hyoc0/McnZP8pV/4h0ZmEQKAYzUfBx44KCthsH82iuK1WQrnZ7uKfo2ycWqwyYc4b2D ScRVVmLnoFH9J5avXF0daZ57RVEl8z+LgpkHWatDSbkNq1RgRSVFUeMNrcTxB9LI/bsf qTcrHwM3Ct650bYGOfPoHPLlF/dLVQAwYLq+HPn2Ev5p71kRNY6Ie2ujlrXcZsq5V+6G V9gQU9pr/y0J1bLbMU6qkErFH5+OBZBEouPtj/d3z4zXYDz1AtoEhsbSa76nIeGP+Q2C KfMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=Ucg1cqy5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g14-20020a056a000b8e00b0052db2bc7618si1379781pfj.324.2022.08.18.04.14.02; Thu, 18 Aug 2022 04:14:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=Ucg1cqy5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244268AbiHRLGh (ORCPT + 99 others); Thu, 18 Aug 2022 07:06:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244261AbiHRLGf (ORCPT ); Thu, 18 Aug 2022 07:06:35 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B270A0633 for ; Thu, 18 Aug 2022 04:06:33 -0700 (PDT) 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=JAOa0ChfVERJUOWkiQMYGLUFzmPebbpTN+VwHYZPi1Q=; b=Ucg1cqy5nlngkHQkEENC9fUkGt /zPDGPsdZ38a59wU6mokbUsI+YMD7XqoC8yswH/CGx9l9XLkbz/jpLwBsJk5XKPIb2FMUkPRUFD10 w6jk19/4MqSRwmCCAmGQdfoaelpmYt2dHVRVGNk6HnpkBFtfvxvzWuZGyE8kwWwONqRxpe/U3PmbK M7hawhspHNH9BlwqbxCaiRRIvOXWHkzQeDvzeluR1HNe+rAr1f+u3zElainsoKAWf9466rerbcdaG Nea3WAheaxSIKJ7VqziU7eH/8q4tBtHWsRdgDVniiNnUdP7S4fsZJkuKv3vKTpVWB96QoFVD8J6Ai fNnriTdw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOdLt-003Z3d-6q; Thu, 18 Aug 2022 11:06:18 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id BD27B980147; Thu, 18 Aug 2022 13:06:16 +0200 (CEST) Date: Thu, 18 Aug 2022 13:06:16 +0200 From: Peter Zijlstra To: Pengfei Xu Cc: Josh Poimboeuf , "Yang, Weijiang" , "Su, Heng" , linux-kernel@vger.kernel.org, Josh Poimboeuf , pbonzini@redhat.com, x86@kernel.org Subject: Re: [PATCH] x86/kvm, objtool: Avoid fastop ENDBR from being sealed Message-ID: References: <20220818011045.v4baekgxajylqxvh@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 18, 2022 at 03:38:45PM +0800, Pengfei Xu wrote: > And this "Missing ENDBR: andw_ax_dx+0x0/0x10 [kvm]" issue was > reproduced again after ran syzkaller 5min on ADL-P. Ha, indeed :/ > > > +/* > > > + * Create a dummy function pointer reference to prevent objtool from marking > > > + * the function as needing to be "sealed" (i.e. ENDBR converted to NOP by > > > + * apply_ibt_endbr()). > > > + */ > > > +#define IBT_NOSEAL(fname) \ > > > + ".pushsection .discard.endbr.noseal\n\t" \ > > > + _ASM_PTR fname "\n\t" \ > > > + ".popsection\n\t" > > > + objtool/check.c:validate_ibt(): if (!strncmp(sec->name, ".discard", 8) || ...) continue; So yeah, that'll just get ignored. So at the very least we need to special case this section.