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 627ACC00140 for ; Thu, 18 Aug 2022 15:17:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245742AbiHRPRO (ORCPT ); Thu, 18 Aug 2022 11:17:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245219AbiHRPRL (ORCPT ); Thu, 18 Aug 2022 11:17:11 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8FF07C1B3 for ; Thu, 18 Aug 2022 08:17:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 76105B8203A for ; Thu, 18 Aug 2022 15:17:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9111FC433D6; Thu, 18 Aug 2022 15:17:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660835828; bh=Tm/++sxgfnVoUcC4gyi/rncDNqWMbIga+LlQ3XDx8SM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rYBGymDhV0ftY4+m0bqDhyt0iCQnqsojgJGDO/hXCWjMFHjtcZffxBV2VTeyMTYwx WeI2euwwjNggqk9okmcQHh4pli8WOA5ZnTRDSUsxoG/PYOZycsOj+hwASeJcC3djG+ jzQEzOLg/HuXgcO7K2A2goqKiOpLGixWoivB81DvrSThl+KnfSgNN36+CHlswdy767 ftdh/OVO6GO2bjEgbV3KQoVUmILeqXpiCbgak0xXUkxNTGNC29Q+xcv+q+pLIPig0o L3mgj79EERloFuRWWP0IPMpHiKXiUwrmsluI3Nd+pVU89MpAg/B7gCxrVrkxy9OQtM Kc0SfJZvtEyTg== Date: Thu, 18 Aug 2022 08:17:05 -0700 From: Josh Poimboeuf To: Peter Zijlstra Cc: Pengfei Xu , "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: <20220818151705.alu2y52rknp2mgsa@treble> References: <20220818011045.v4baekgxajylqxvh@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 18, 2022 at 01:06:16PM +0200, Peter Zijlstra wrote: > 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. Indeed. I swear that patch worked last night. I also found that not all fastops use __FOP_FUNC(). Anyway I'll post a new (official) pair of patches shortly. -- Josh