Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp1569072rdb; Sat, 26 Aug 2023 07:55:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEsLcS6Yg9gBAZq3LyOjeS+XuNeI+qDPklqdADHTgLreeO1/eLvWLm49FgUx6vou+jOyc9m X-Received: by 2002:a17:90b:1882:b0:267:ffcf:e9e3 with SMTP id mn2-20020a17090b188200b00267ffcfe9e3mr20375324pjb.46.1693061748548; Sat, 26 Aug 2023 07:55:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693061748; cv=none; d=google.com; s=arc-20160816; b=icKZ6uwcQbVgOuHzpMmSAhHX/2XkE+Uybj+2MD5RxYdeQU9HG8Ur3+NBX7rvAe5FZT GL2mPYTGijBItxbzT87ZgdBMDK3ljlIw0UWu9aLIZAH4niNpzCIpWDiCU0XeUh0OWcg/ iCFBW2yHpuDSWLdV3UeIZ+AhCoE88wqMLDRXB+qx7wVc9V1daUhwoG2gFfctj/xu8VVN NCaUaH9S8Nb+gIfJc+LZkUMHE+qqHcfT6Zm3Po7GNpcVX/aYSC3njiwHwX47hqnAOy0J W8LzLdLdwJPoO/YRZdFCo5Rqv2tDiJY+jyxAix3+9cT4AmsZMhzIBIGNqbwwDlcaoRHM OFHg== 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=mCJx0DjaRY+QklwhqdUW8rgqjHvFq9EtzxMB4xKX2dk=; fh=qpssRWmeIkdngSKZX+cLWbO87MumMIXTOMwLrQbqlzo=; b=ADQPQ/5sUEH9RCt/dmR6JBpxEDHXOH7KBGCAZymzLuITDiErGihtGljoBdsWPfa2+R acFu9vhFROgXEV9+O9G4umxnf0+hccvJZERA78spUWn9SUrV9aPpwQ7cMlOqePFsn1N3 jl4wwRfxU5XiaNJ8JWoJQvykyc4UXoBrujxJolQxt9qNi6EEzRg3vyZzE9CTrVTjdtch 1byZhHiMGTNYwiol7iymTZc25Gz/mngtYKsvJEUs1Q+3KuX8FDsDGxbHv4FNf5agQAJ/ b07Uabz5ngg7EhK9L8T9dX7hQa7+rSDFwIA1E4VmgMBkzjGSp/YNPWue099KxLQTkxoh bwWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FdnT6nQ5; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q15-20020a17090a430f00b0026d44b5f978si3785459pjg.98.2023.08.26.07.55.27; Sat, 26 Aug 2023 07:55:48 -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=@linuxfoundation.org header.s=korg header.b=FdnT6nQ5; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232597AbjHZLYy (ORCPT + 99 others); Sat, 26 Aug 2023 07:24:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232549AbjHZLYk (ORCPT ); Sat, 26 Aug 2023 07:24:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DFFE19A0; Sat, 26 Aug 2023 04:24:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DDDB861881; Sat, 26 Aug 2023 11:24:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE4D2C433C8; Sat, 26 Aug 2023 11:24:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1693049077; bh=4xY2yHBfvVm2yFqr0cbJeko4G4N9NujIbsiZ5iVIA8A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FdnT6nQ5e9blAjttL1iEm2EJFXxQNLkgNeqmOdGQ81kXjnoTTuqODc38tkDI8GRL0 qn2FGzMRg7UCWnjAiQexrgKE2CoebJNZDB7USDd39s01vqLX/PSY4I65EBZvaOXfZV WbLVDvSg8sY8Sv8fp9f8E1lRxNYEF1NLS/6gdLfo= Date: Sat, 26 Aug 2023 13:24:33 +0200 From: Greg KH To: Josh Poimboeuf Cc: Borislav Petkov , "Paul E. McKenney" , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, x86@kernel.org, peterz@infradead.org, keescook@chromium.org, elver@google.com, dvyukov@google.com, glider@google.com Subject: Re: [BUG] missing return thunk: __ret+0x5/0x7e-__ret+0x0/0x7e: e9 f6 ff ff ff Message-ID: <2023082618-pulse-wildcat-6746@gregkh> References: <4dc3d0ec-b827-4bce-8927-cfa5d837fd03@paulmck-laptop> <20230816181720.GNZN0SsKi/B4eCsZHu@fat_crate.local> <2023082458-vividness-habitable-cbc8@gregkh> <20230825232657.psb7c7x2tdgzciqw@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230825232657.psb7c7x2tdgzciqw@treble> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 Fri, Aug 25, 2023 at 04:26:57PM -0700, Josh Poimboeuf wrote: > On Thu, Aug 24, 2023 at 03:52:56PM +0200, Greg KH wrote: > > On Wed, Aug 16, 2023 at 08:17:20PM +0200, Borislav Petkov wrote: > > > Hey Paul, > > > > > > On Wed, Aug 16, 2023 at 10:54:09AM -0700, Paul E. McKenney wrote: > > > > I hit the splat at the end of this message in recent mainline, and has > > > > appeared some time since v6.5-rc1. Should I be worried? > > > > > > does it go away if you try the latest tip:x86/urgent branch? > > > > Note, this problem is showing up in the 6.1.y branch right now, due to > > one objtool patch not being able to be backported there easily (i.e. I > > tried and gave up.) > > > > 4ae68b26c3ab ("objtool/x86: Fix SRSO mess") being the commit that I > > can't seem to get to work properly, my attempt can be seen here: > > https://lore.kernel.org/r/2023082212-pregnant-lizard-80e0@gregkh > > > --- a/tools/objtool/arch/x86/decode.c > > +++ b/tools/objtool/arch/x86/decode.c > > @@ -796,8 +796,11 @@ bool arch_is_retpoline(struct symbol *sy > > > > bool arch_is_rethunk(struct symbol *sym) > > { > > - return !strcmp(sym->name, "__x86_return_thunk") || > > - !strcmp(sym->name, "srso_untrain_ret") || > > - !strcmp(sym->name, "srso_safe_ret") || > > - !strcmp(sym->name, "retbleed_return_thunk"); > > + return !strcmp(sym->name, "__x86_return_thunk"); > > +} > > + > > +bool arch_is_embedded_insn(struct symbol *sym) > > +{ > > + return !strcmp(sym->name, "retbleed_return_thunk") || > > + !strcmp(sym->name, "srso_safe_ret"); > > This wouldn't work with the current 6.1.y branch, I assume you had some > other patches applied before this. e.g., the patch renaming __ret to > retbleed_return_thunk. Yes, I did. > > } > > --- a/tools/objtool/check.c > > +++ b/tools/objtool/check.c > > @@ -418,7 +418,7 @@ static int decode_instructions(struct ob > > } > > > > list_for_each_entry(func, &sec->symbol_list, list) { > > - if (func->type != STT_FUNC || func->alias != func) > > + if (func->embedded_insn || func->alias != func) > > continue; > > This hunk looks like a bug. This might be the source of your problems. Ah, I guessed wrong on that change, my fault :( > The below patch seems to work on stock 6.1.47. Or if you have other > SRSO patches pending, point me to them and I can look at porting this > one to fit. I got this to apply on top of the latest series (-rc) and it passes test-builds here. I'll do a release now without it and then queue this up, along with some other fixes for reported problems in previous releases, and release it so that the CI systems can go at it. Many thanks for this! greg k-h