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 0AE30C433F5 for ; Thu, 5 May 2022 21:03:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1385452AbiEEVHT (ORCPT ); Thu, 5 May 2022 17:07:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232334AbiEEVHP (ORCPT ); Thu, 5 May 2022 17:07:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1138D5DE5C for ; Thu, 5 May 2022 14:03:34 -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 dfw.source.kernel.org (Postfix) with ESMTPS id A064461EFA for ; Thu, 5 May 2022 21:03:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C756DC385A4; Thu, 5 May 2022 21:03:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651784613; bh=JaZNcdOZ4SMQrsVEg6zw8opQg7AkFGaMyN5Aqvk60qI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KThFvShSluYM2Zk52rOfGeTBoJz7wnHjVoqDlXbPDUPPPOmYb5fe38ZYCtcvcjNxg IMZB+cwa673BX7CZc9BTkoFAw9kzODQbJrixNRh+KFDE/BygjmqQFUDHM9lm3yQuui bzADBuALnPDDQPhapDqljQmrOiht7yU6n96FAMNxy9W6G5CljogOz4h0CzJoGm4h/C gy63l8LDx0q7yk6HnDrWRp7Tof93A1EvN2W5cVMpQTkugNH7FeeqCZ+WbNA5PvQflY 8dNud1qruX7drF9znw8ffffRLoOXB3hnWtBABA6i7g9Nm4JENtT3ROHlynm3lWNykj onvlVDz6/dtGw== Date: Thu, 5 May 2022 14:03:30 -0700 From: Josh Poimboeuf To: Peter Zijlstra Cc: Josh Poimboeuf , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] objtool: Fix SLS checks Message-ID: <20220505210330.flb36r4emty2js3y@treble> References: <20220502181547.fzz2yre2p4akph4s@treble> <20220503211510.ytdv5l4l2zwjdwg7@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 Wed, May 04, 2022 at 09:26:47AM +0200, Peter Zijlstra wrote: > > I don't quite follow this 2nd sentence and how it's related here, since > > this function doesn't actually deal with direct jumps. > > Ah, my bad. Also, this wrong. > > I suppose this wants to be something like: > > if (i < insn->length && op == JMP32_INSN_OPCODE) > bytes[i++] = INT3_INSN_OPCODE; > > So this *can* be a jump, but typically won't be I suppose. Yep. > > Speaking of, I guess we'll eventually need to hack this SLS mess into > > jump labels :-/ > > Urgh... can't we reason that the straight line case is actually expected > to run with the given register state anyway and ignore this? Yeah, that makes sense. So for jump labels the SLS path would probably not be worse than a typical v1-style conditional branch misspeculation into the 'else' path, and we've already given up on worrying about those anyway. -- Josh