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 X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9648EC00523 for ; Fri, 3 Jan 2020 23:53:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 61EC720656 for ; Fri, 3 Jan 2020 23:53:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="dManOXxG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726380AbgACXxC (ORCPT ); Fri, 3 Jan 2020 18:53:02 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:37518 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726232AbgACXxB (ORCPT ); Fri, 3 Jan 2020 18:53:01 -0500 Received: by mail-wr1-f66.google.com with SMTP id w15so31266356wru.4 for ; Fri, 03 Jan 2020 15:53:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Dz/v20Hft+ZxPT9oFbtS2gq/bqz6agzFQsRm4OWF9jI=; b=dManOXxGrlMaiJ/ynRgu1yCFdEcpD/AOSQkNls79QUWBWSYjqzY2BKe0B0CrbI6idm /dTj664fZOcZ3w0IhkkGvGKo0ZgQ5ovhCuxPUi0qIp8QbhJLqznWHjkdBBukcve8aOSq D6Arnnq/Btsydx/BvYbkVW+yAtU/2+76NlCYo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Dz/v20Hft+ZxPT9oFbtS2gq/bqz6agzFQsRm4OWF9jI=; b=qYNo3dfeKchTB23XAuzdzZXCnvb4SpBZ5izaItIx5ONTs9U7wWz/2amLbJ8JCGyghN Qe5Ya7AGc6kadl9Ar5H7ueBNsjpgZOs2rtrdmQ7d6SIpLgdDxDb7CkIdaVfSzPxcSsxp +9gNyqDJNKU7o6bYs336KsTrxGM5hU6S58FY3yHItC8F2rG4+Nn9X7td25ZP0dVSVgxA MrxrW1O+y3bkfNiF7Szv+agtNoVHkX9ykoJbyrXgwlR6J+WhJn5sT1gZYj1OfnboLv05 fqns81a6FUK3Pcw4l+WYUas+vOeqCrYIP9UJG43qHsRlNYm92OPJecbVF6rVM5GzJF0d s+qw== X-Gm-Message-State: APjAAAVpek4zXDyQH/0PDrQYnEB3mPpKl63k2KdTCXKfCTpf/D1xNiVB m1SgzfM6532jyRZzf3qFtJyAPw== X-Google-Smtp-Source: APXvYqyy67BT7vikizrc7raGZc5Z2eAyOslGHtOakkXofnQQZkbJeV/hbYbJMF/rPU0jTVIAfDRp1g== X-Received: by 2002:adf:fac1:: with SMTP id a1mr87185425wrs.376.1578095579772; Fri, 03 Jan 2020 15:52:59 -0800 (PST) Received: from chromium.org (77-56-209-237.dclient.hispeed.ch. [77.56.209.237]) by smtp.gmail.com with ESMTPSA id n14sm13436895wmi.26.2020.01.03.15.52.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2020 15:52:59 -0800 (PST) From: KP Singh X-Google-Original-From: KP Singh Date: Sat, 4 Jan 2020 00:53:13 +0100 To: Kees Cook Cc: Andrii Nakryiko , open list , bpf , linux-security-module@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , James Morris , Thomas Garnier , Michael Halcrow , Paul Turner , Brendan Gregg , Jann Horn , Matthew Garrett , Christian Brauner , =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , Florent Revest , Brendan Jackman , Martin KaFai Lau , Song Liu , Yonghong Song , "Serge E. Hallyn" , Mauro Carvalho Chehab , "David S. Miller" , Greg Kroah-Hartman , Nicolas Ferre , Stanislav Fomichev , Quentin Monnet , Andrey Ignatov , Joe Stringer Subject: Re: [PATCH bpf-next v1 06/13] bpf: lsm: Init Hooks and create files in securityfs Message-ID: <20200103235313.GA23199@chromium.org> References: <20191220154208.15895-1-kpsingh@chromium.org> <20191220154208.15895-7-kpsingh@chromium.org> <20191230153711.GD70684@google.com> <201912301119.B475C474@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201912301119.B475C474@keescook> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On 30-Dez 11:20, Kees Cook wrote: > On Mon, Dec 30, 2019 at 04:37:11PM +0100, KP Singh wrote: > > On 23-Dec 22:28, Andrii Nakryiko wrote: > > > On Fri, Dec 20, 2019 at 7:43 AM KP Singh wrote: > > > [...] > > > > Good catch! You're right. These macros will not be there in v2 as > > we move to using trampolines based callbacks. > > Speaking of which -- is the BPF trampoline code correctly designed to be > W^X? Thanks for pointing this out! I don't think this is the case as of now. The dispatcher logic and the tracing programs allocate one page where one half of it is used for the active trampoline and the other half is used as a staging area for a future replacement. I sent a patch as an attempt to fix this: https://lore.kernel.org/bpf/20200103234725.22846-1-kpsingh@chromium.org/T/#u - KP > > -- > Kees Cook