Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3751909imm; Mon, 8 Oct 2018 08:58:54 -0700 (PDT) X-Google-Smtp-Source: ACcGV60+7FQAfh4+9JtWbKnL11vI59CJNLyQ/Rqio9w7ZKr4Mm+SC+dCIeIktUhszZbW7LERhV85 X-Received: by 2002:a62:adc:: with SMTP id 89-v6mr25840052pfk.56.1539014334112; Mon, 08 Oct 2018 08:58:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539014334; cv=none; d=google.com; s=arc-20160816; b=hLGdvfFP/4/DhnzdSDmlHX2BDtUNfegPIzo+PcxzidoOZb1DWlGdeAnZQBmTVKHpAd WvcCbO2OKaie+igCf0H5US9R8EmltrsiAaUxhViF8vEQoCqLmBCbN/X8MXpdzPvtn7Hr T8hlMpJYa6vGuFogG7l+iNTPHUacBp5K+urQNrsQ2XF6ak077kDycr1mcEd/mIw06tSW JbouN8PLB2C6YB8rF5jYyqMPWRd8BiWAEjIiMplubDfw8Q9+zplvYrPsppj5/DtPVJPY rkk5bUKlRqxYguJDpf/SHSaeaipjB4CPvT/+x+s6Udhm0+JyJ/ZKEB6sEoKRSEqZz0j8 w4fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=eK4fDbrsjTJidp5MHrzu3rt5LFl7HH2NjGNM9RULQ/c=; b=WWgN/M/loUPhRFcdzp/ORoXnGdpBOrtNn6Ni7AmNs+B8duv9cvs2kotdoHJoOdTqnT WajjU+K2UaksUJsY917sd4StwVaBB+iF2AG/dymOiHGcS79yc1dV+55dUPVWNwB6AfBx lXdRToBYySRw0rURA3FIml7apsjyur6B9wI5CIPeKTYibrD3FGdFesRynSW/ZXL3hcIe +EFF5dfpgMmk7AIV/CPme02HnYGPCVnfq1h7lQ+Rt1f3oNMzcYj9NhmOaXtMGiyfNmK1 xJrmNntMUljosxi7TuxWJhJ+NzzniMuDY4W8YQ81ymlsKebafu+4yG/eKHucb/Oe57kt 0vGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=eB8y+K6s; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s13-v6si19944659pfc.149.2018.10.08.08.58.38; Mon, 08 Oct 2018 08:58:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=eB8y+K6s; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726723AbeJHXKu (ORCPT + 99 others); Mon, 8 Oct 2018 19:10:50 -0400 Received: from merlin.infradead.org ([205.233.59.134]:58180 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726396AbeJHXKt (ORCPT ); Mon, 8 Oct 2018 19:10:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=eK4fDbrsjTJidp5MHrzu3rt5LFl7HH2NjGNM9RULQ/c=; b=eB8y+K6sKRnxiVusKwaNKLHNVn MgXjfGTAsmA0nBm3iZc6dF64HFGMMqm2CMftpwZyyYPhpLIxYicd5NxXtA3gU8F2RhQhiwIG6HsJx pcLtPjbCfBTb+KE4sGsOCBJIm8xthMtLIdO0YiV3XtGWqwvHS61QPpZSBWHv58wYyDhTXh6laeSge ci2yk+FQC3dNXVJNGdgbdQT6TAaJxSTrFera1UGiDrsFRILtHSsiBKOp7tVMjDoMvSOL4Ubw75rg4 USReVb/VBnVOqx9qAxW/6L2yPCmNyg16nD4BEt9raUuLS04nRSlHSQrzllHE6kEUGok7eilG/KBRC ftotf2ZA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1g9Xux-00068k-3i; Mon, 08 Oct 2018 15:57:59 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 89951206F0EC5; Mon, 8 Oct 2018 17:57:57 +0200 (CEST) Date: Mon, 8 Oct 2018 17:57:57 +0200 From: Peter Zijlstra To: Andy Lutomirski Cc: Steven Rostedt , linux-kernel@vger.kernel.org, Linus Torvalds , Ingo Molnar , Andrew Morton , Thomas Gleixner , Masami Hiramatsu , Mathieu Desnoyers , Matthew Helsley , "Rafael J . Wysocki" , David Woodhouse , Paolo Bonzini , Josh Poimboeuf , Jason Baron , Jiri Kosina , ard.biesheuvel@linaro.org, Andy Lutomirski Subject: Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function" Message-ID: <20181008155757.GC5663@hirez.programming.kicks-ass.net> References: <20181006015110.653946300@goodmis.org> <20181006015720.634688468@goodmis.org> <20181006121211.GA5663@hirez.programming.kicks-ass.net> <20181006093905.46276505@vmware.local.home> <20181008072134.GB5663@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 08, 2018 at 01:33:14AM -0700, Andy Lutomirski wrote: > > Can't we hijack the relocation records for these functions before they > > get thrown out in the (final) link pass or something? > > I could be talking out my arse here, but I thought we could do this, > too, then changed my mind. The relocation records give us the > location of the call or jump operand, but they don’t give the address > of the beginning of the instruction. But that's like 1 byte before the operand, right? We could even double check this by reading back that byte and ensuring it is in fact 0xE8 (CALL). AFAICT there is only the _1_ CALL encoding, and that is the 5 byte: E8 , so if we have the PLT32 location, we also have the instruction location. Or am I missing something?