Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp18944ybl; Tue, 7 Jan 2020 01:14:06 -0800 (PST) X-Google-Smtp-Source: APXvYqxsmIna0lerQwTeXDdL9zh40O9Q8ax5YNy0XYrnwSKsQfz8UFJEHKFTibXXBXncgSgGuKKD X-Received: by 2002:a9d:6b17:: with SMTP id g23mr116171558otp.265.1578388446200; Tue, 07 Jan 2020 01:14:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578388446; cv=none; d=google.com; s=arc-20160816; b=z/NYHgyZsVcHJkzRq/k/NurdHAfo5Di44vNI0c0vzBtr9Qm4122fZFo2qb9fTiY+KG qMCXoAVTB1dc6F7tGszBGdYqvkI+zSkT4qKkPzb514tl+psiFCZB7wg9etrq+0mDz6w+ vHdRmZr6Pt8VMej5oTEqqJtR9niAE6CSgo+mIiPwNPGwNT+cYZkG+aOoXsSX01acifZ3 +tFQ0kSB5sURcKk6uqnpsOB5uwS3HN0fysna1wipr7znV56iDu/KQ7NOz7ogq9l1APhO QotWZ0Ujs48RKl7fIVOM2NiuQB7EoVxBnDBwRBoeMrHtY8uiPf46aH2kV17WVYDNkHt4 vuKQ== 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=A1bVLjosQRKXXi47Ohrd213MIJXML0aJ/z3lXdqGhps=; b=UY2TQ8Yg7RSxfcgV2XnOyuS7YaDlTz/wqGmQovlpwXosOAX5Z+wEVtlE6PU07ozlx1 jsNJqejPkCvc/5I/Z9yJW3LN5cCJhN6m54Z/huQcR6wYfuSLKI0bqnMfwF6oi+w2u2MJ dWfO8PCwZDv/57VkAN1cvZRh6Xh0UbSFXn923nxD1CIdIUib+vnoud4eRiYXD31WBcii XaNkuy6nibFW6rpEKU6yxpB7YxmXssR2ij1Ru8IGQxOVRZpTjUZz4qfXhN4PjghwxSwX 6PsU1ZX1TCd5MfoHTwcJBwdE1arlYtmBpfomuaekm9Gnxb4FA3ipQ8nHbcyqq2NIB2qi s5TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=I1o26tz0; 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 94si40511159ott.8.2020.01.07.01.13.53; Tue, 07 Jan 2020 01:14:06 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=I1o26tz0; 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 S1727642AbgAGJML (ORCPT + 99 others); Tue, 7 Jan 2020 04:12:11 -0500 Received: from merlin.infradead.org ([205.233.59.134]:48356 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726327AbgAGJML (ORCPT ); Tue, 7 Jan 2020 04:12:11 -0500 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=A1bVLjosQRKXXi47Ohrd213MIJXML0aJ/z3lXdqGhps=; b=I1o26tz08SFbCJG4E70ntK+rt+ Tr4fOu9Fg8ogt5Liv4rRYtzCiNIgPRvbPqgPqsGoYzOfOzLIcWcjd/Bv81T4TI1L1Gh5JxoEMJUhc iwjsOiB5q38fPqxxhmbMn2VLdC6pkiT58JrZntSNSsrt7mCzZK54lR4RfRAraqSg1WP8UqiekXSHH tOMuGMYV85vEYJ3JPlkVzi/4Y99SXm9M11zwQ7/aMfBLPVFadlAWUTOPNm+v82jhLs3Z6N/K8sPLh 3ow6llWRv50EEH9wZ033z9piEV15LRqtXYIwFIFdi9NjHYZqwXpG9Ik+7I4j5RVLxkcZNVNX55SMJ niQG05NQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1ioktm-0004Te-0G; Tue, 07 Jan 2020 09:11:38 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 329343012C3; Tue, 7 Jan 2020 10:10:00 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A66B42B2844EA; Tue, 7 Jan 2020 10:11:32 +0100 (CET) Date: Tue, 7 Jan 2020 10:11:32 +0100 From: Peter Zijlstra To: Alexei Starovoitov Cc: Andy Lutomirski , Justin Capella , KP Singh , Rick Edgecombe , linux-kernel@vger.kernel.org, bpf@vger.kernel.org, x86@kernel.org, linux-security-module@vger.kernel.org, Kees Cook , "David S. Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , Thomas Garnier , Florent Revest , Brendan Jackman , Jann Horn , Matthew Garrett , Michael Halcrow Subject: Re: [PATCH bpf-next] bpf: Make trampolines W^X Message-ID: <20200107091132.GR2844@hirez.programming.kicks-ass.net> References: <768BAF04-BEBF-489A-8737-B645816B262A@amacapital.net> <20200106221317.wpwut2rgw23tdaoo@ast-mbp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200106221317.wpwut2rgw23tdaoo@ast-mbp> 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, Jan 06, 2020 at 02:13:18PM -0800, Alexei Starovoitov wrote: > On Sun, Jan 05, 2020 at 10:33:54AM +0900, Andy Lutomirski wrote: > > > > >> On Jan 4, 2020, at 8:03 PM, Justin Capella wrote: > > >  > > > I'm rather ignorant about this topic but it would make sense to check prior to making executable from a security standpoint wouldn't it? (In support of the (set_memory_ro + set_memory_x) > > > > > > > Maybe, depends if it’s structured in a way that’s actually helpful from a security perspective. > > > > It doesn’t help that set_memory_x and friends are not optimized at all. These functions are very, very, very slow and adversely affect all CPUs. > > That was one of the reason it wasn't done in the first. > Also ftrace trampoline break w^x as well. Didn't I fix that?