Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1036660imu; Fri, 11 Jan 2019 13:49:15 -0800 (PST) X-Google-Smtp-Source: ALg8bN72FAwI0WCN8KqSy0r/xa10OKnN4NaLReFV3dIH1aS7zYHPgizvhQd6fdNdM7ySO/8hNrEN X-Received: by 2002:a63:eb52:: with SMTP id b18mr14571508pgk.213.1547243355692; Fri, 11 Jan 2019 13:49:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547243355; cv=none; d=google.com; s=arc-20160816; b=TNbyfwBC7TQtWkverArVRQbQz9U1ui30dAQiWgEblKdiUyQWnzxd4h3ol5Tned81dy XvwnbSg9DJZVJWGBLVnlqZvYhectb+W1SbjGi/1+ckFRcdltG0sHv8+omY/3kNTezcWZ DBPcdblh5JvkcCdbf1nGCa55o47MN04bLVWK6b+9vTgaiiGNdnEmt6XYubbZBRYLH3Kq pIg4S2uI5z+E1AeoHvWEIdQFU3bBveDW4HGuQl9MOLLhspjLCTRvZQvUOh/TjU9t+Ifq oeKDClV2YZl0QkXIrYGiAEOJ+wIRZIECZgeRdA6JLWrvgSPtJOhs2gjE5uKYOSfM2M/A b+mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=/45zICDjw0ekmJ13lUuG5Az2jUPs8RRC0mdZikz3nv0=; b=0zXQNsVBKtqa0wgZKBC2aOxSTaKGAn9SaQVNoV/Bo00ABiTiBAbSrybdVOfoBr6FUp HsI79EsCI5ZSrtcQQu9Ki8XCuXTsjiwZyLzNkOa9I8QhG86UBKmhSA6tZSCJH1+pkpaB N14tFD+zGUuUwu61QRSGIrEh1UNl2uzrLleFFQDUdExfVfx1yym1lARpHMuygaKKK3W2 o0NVa0DwrIbGXJH4q8vOrm40NdULPUiiD6pvHu/2LijtNBoITUtlLY4XK/ydma2aWkdy C4Tpo1j3TiTnzfQED2CSDrBMppz/Zd4hW60gmLrKadyWvHC8M54jFdU5v++OSZ9N57fK d3PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=M8yx8CLM; 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 y2si9645486pfy.29.2019.01.11.13.49.00; Fri, 11 Jan 2019 13:49:15 -0800 (PST) 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=pass header.i=@linux-foundation.org header.s=google header.b=M8yx8CLM; 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 S2390686AbfAKUMv (ORCPT + 99 others); Fri, 11 Jan 2019 15:12:51 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:42849 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388788AbfAKUMu (ORCPT ); Fri, 11 Jan 2019 15:12:50 -0500 Received: by mail-lf1-f67.google.com with SMTP id l10so11651340lfh.9 for ; Fri, 11 Jan 2019 12:12:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/45zICDjw0ekmJ13lUuG5Az2jUPs8RRC0mdZikz3nv0=; b=M8yx8CLMSaa+tX4DwXY7gV2PjXNFKxBNkXslbdhrPIl1tXPG3DKO31MBAN1uXbz92B YELXCXkdf2f0jQRi23Gz6cmWbCDhOWx9ytx4xoCDJ6F2YanQD+iTokQTlQhk8EfhVQJN xZ7YT3PNusw3/FnuPC3IwSofuzF9MZCz4rmkU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/45zICDjw0ekmJ13lUuG5Az2jUPs8RRC0mdZikz3nv0=; b=kQehWXOEhqJzh9R7/trU1pxCFkwqlDwpYsvm5pcxpspQJQ5hq+DtbzLKgctql9namP Z+3CnMHGWQhR6MUUzxNPRUJ2YKAeT3rQV6qF2muGMEyHnPXb6eHqIkjJiEzUOKQ9vqG6 6FMpzxsV9R5VtHShWMOa8H4H4ktX8ofu5XL2enAyqcsppcwuEN8j6NicoPceFDyBSLNp z/ArDq3UuDR2GRCSi1C2CB1m2FJ9gJ+/lO7roGNv5unKmEoIJemUt68M5Opar2h9Cgf7 67mot9DxsWGJMNzWAUYl78Pt3DAR7tFsyQGN1Udpj+FXPpFEddDx47UbheBWlLyskmmV 2zFw== X-Gm-Message-State: AJcUukcQZhRUELMKJCvUnWW/GGUJ9jIjRJAafdtfZRRcOWnlBCJ756Vs R5hYSIv5dgyayIZqW7OyPYAPoWo+PFk= X-Received: by 2002:a19:c801:: with SMTP id y1mr8499582lff.53.1547237568155; Fri, 11 Jan 2019 12:12:48 -0800 (PST) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com. [209.85.167.45]) by smtp.gmail.com with ESMTPSA id e5-v6sm15728230ljj.91.2019.01.11.12.12.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Jan 2019 12:12:47 -0800 (PST) Received: by mail-lf1-f45.google.com with SMTP id e26so11684011lfc.2 for ; Fri, 11 Jan 2019 12:12:46 -0800 (PST) X-Received: by 2002:a19:6e0b:: with SMTP id j11mr9500440lfc.124.1547237566319; Fri, 11 Jan 2019 12:12:46 -0800 (PST) MIME-Version: 1.0 References: <20190110203023.GL2861@worktop.programming.kicks-ass.net> <20190110205226.iburt6mrddsxnjpk@treble> <20190111151525.tf7lhuycyyvjjxez@treble> <20190111200420.qtyffayxceysoarf@treble> In-Reply-To: <20190111200420.qtyffayxceysoarf@treble> From: Linus Torvalds Date: Fri, 11 Jan 2019 12:12:30 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 0/6] Static calls To: Josh Poimboeuf Cc: Nadav Amit , Andy Lutomirski , Peter Zijlstra , "the arch/x86 maintainers" , Linux List Kernel Mailing , Ard Biesheuvel , Steven Rostedt , Ingo Molnar , Thomas Gleixner , Masami Hiramatsu , Jason Baron , Jiri Kosina , David Laight , Borislav Petkov , Julia Cartwright , Jessica Yu , "H. Peter Anvin" , Rasmus Villemoes , Edward Cree , Daniel Bristot de Oliveira Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 11, 2019 at 12:04 PM Josh Poimboeuf wrote: > > But really, to me, having to create and manage all those custom > trampolines still feels a lot more complex than just making a gap on the > stack. There are no "all those custom trampolines". There is literally *one* custom trampoline that you generate as you do the rewriting. Well, two, since you need the version with the "sti" before the jmp. It would be possible to generate the custom trampoline on the fly in the BP handler itself, and just have a magic flag for that case. But it's probably simpler to do it in the caller, since you need to generate that special writable and executable code sequence. You probably don't want to do that at BP time. You probably want to use a FIX_TEXT_POKE2 page for the generated sequence that just maps some generated code executably for a short while. Or something like that. Linus Linus