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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B37C2C00140 for ; Thu, 18 Aug 2022 11:06:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244270AbiHRLGh (ORCPT ); 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: 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.