Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4665247iob; Sun, 8 May 2022 21:09:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpr8qERV+d4xBLoQUutUW3LyTK2HMBVsrs/p89NMBppVjzYxWUJGYZGNfkOP8nUs6ME+2M X-Received: by 2002:a17:90a:7c4a:b0:1dc:f28f:4e06 with SMTP id e10-20020a17090a7c4a00b001dcf28f4e06mr9506017pjl.48.1652069398473; Sun, 08 May 2022 21:09:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652069398; cv=none; d=google.com; s=arc-20160816; b=xxi9Wb93/7cQYQS13C0kgHMEAmIVsG57dWwJ5gNUeggAg2BN/WhgbDZCEUJNlW5mEu CsimEG+6QK7tO/luSuB+6orW342p3jWZh4NYnMptFo+LsRuq28GL2eTjI3Ub5ZPqmuZX h3ukX6bpTMgKDuXIFISdHK7+BTOzljDXNciOYYVrPr5VeBNm7OXF4YnJqc6aomriJHUl Gd0hSfroFSTwTwFudlU/OPPeopdwqpbIrRZrIF8i/zcuqFwpsIP5hOttxYV3Mu3BLB2u t/CLfBAyiVVQDGfjWeC3a+UYdrJlBqgz6Jf1uNGQNGsOtIDnB+mtcA2MLQYy18iwBENE ut4g== 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=QOcQwCu0AQ04xXUPwsLwtzNM1VNtgbo0qmkBRMVdxmg=; b=UD9GVF4PlxUeUNdJzyESOlN+gGz3ddh8UK1fARJwXop9uxSQXjVnF0cPoMbVj9jjOG rIj2+qW+ADdVsc0nac11TxQcU66grd8+1F6YXpZi6NQd7X87iboDkGQ5xS8EJDbTy9L+ qmQI9gYnZaQn3z2ADMjNlJHae8nnrxNOgnFGgIocsTpcNXpzcEPhZMM5bjQj3ZZalOCv Ao2xCR9ZebOz/a6N+sJFI4TfFlqn1cfiavt1A8U5mt4ckMI9xKyqGQuaSL0Zr9hKBInM Vya1AiX2w+T7GKoS4nWFZjKxrnBvCSa9RRlAh5jFE0es/kKpOBwDbZIS9paI0ibjafRw Tevg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KThFvShS; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id m17-20020a170902db1100b0015eb6621630si12262323plx.307.2022.05.08.21.09.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 21:09:58 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KThFvShS; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CFC1910B3C5; Sun, 8 May 2022 21:08:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384592AbiEEVHT (ORCPT + 99 others); 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: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 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