Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4268249ybv; Mon, 10 Feb 2020 15:59:52 -0800 (PST) X-Google-Smtp-Source: APXvYqyTW5Kf25UhexPeAswHjG44qGYtJdo2oR+vra/jFehpDHYLb6hJqxYm8acwSowNjK6TzQgz X-Received: by 2002:a9d:3cf:: with SMTP id f73mr3135910otf.11.1581379192645; Mon, 10 Feb 2020 15:59:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581379192; cv=none; d=google.com; s=arc-20160816; b=J5lLlmOpeh+fYQ9vz0gNscX4Y0kHP9mR0gkhmvVlyy4TO6vmWywX5bRx3w2Rbg1ZXw HMcYh73F/a07zfApyLJ7Ke9kzvlKg+reJxD+6AH4LgRE64hPiPB/ZFtf4kDjuSzlXTqm xXBkVeqKBznA4HSZ94mt6Gz8vVK2VY+aD3ZIaQGDEf/HrN83juciETqHAaWvedkjVx/C UA0go72mCBv2N9s8D46rVrlqZ0huYrhDuE1S4gz0h94Y0n9y0K4aDgc/TG4kPspcGIKj L9kg1rnTy5gwb5MMYMrZLN6iCNFwoJ4ALlP8Ozn6bc2HOUAmbdx/7/2g0a0LeI+J/x23 4imA== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Ecnhmrr02m11MvZnIXErIkdoBlLHRUvHjs8abNILLO4=; b=ddBVs9VPSWI1g8VqbgkgFCZuwhrVYoKQ1v4QMZdl5d2aRzvLmGkLzE2oNkcqpzahch 8mCsa6pqjjxBezlNpsURFZR78jIY/so34RBi5hS2b7hQhkdqOYN1LFFukN1DXIQD8Rl1 C0q2u2kX1IiX/z0+dV9G9ZyaPOpRsiHQ8dLsgAgCpMrFG95Jb09nt9hR4GHhuuloN8lj hp7MyhrS9vm8S2/q/teoHhb1dOPSqgb9gFAEF2n7ovpnvksPCSsilDv20UB6ix4PwcO7 T+m4ulBzIGIrqr+wxkWqKitpZJnDYhOOHDksHmvH5tDvZmaZuWidoUPNn4muIcQk7+rD 6pkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jOicBg6E; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l6si963754oti.249.2020.02.10.15.59.37; Mon, 10 Feb 2020 15:59:52 -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=@gmail.com header.s=20161025 header.b=jOicBg6E; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727549AbgBJX6Q (ORCPT + 99 others); Mon, 10 Feb 2020 18:58:16 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:34380 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727490AbgBJX6Q (ORCPT ); Mon, 10 Feb 2020 18:58:16 -0500 Received: by mail-pg1-f193.google.com with SMTP id j4so4746789pgi.1; Mon, 10 Feb 2020 15:58:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Ecnhmrr02m11MvZnIXErIkdoBlLHRUvHjs8abNILLO4=; b=jOicBg6EVEA407Dzu72yN32aWil8i3M++pQe4B4Sp01hvwUBjlj+UraPSgjeowRfxc rsP6/Uk29lQkTdHGqrXXn3FhLRAzIewCf0ffaNclqCdCr02XenqCGo9sso48IEvOO3o2 bQN6tZ4aXIa2VcroBSM1EDy+vaPP02vJ94BkyiI670QBKsqnIZh2L3aAdLCBepLX97N7 ygYACF8NElDDT86eBFxb+TWV1Hz8pRvBF0SWI8o7uElFYKppW0sqr15VZXZmt4SH4OoQ USqIiWOONNXB3U15+8lwLynYGMVbc+CNqvOnh7hiDgobgXCmetJhVHs3Yq+Y7v6g8TCk RcnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Ecnhmrr02m11MvZnIXErIkdoBlLHRUvHjs8abNILLO4=; b=Vf+RhLthEwC9iFL+0Dy6FiO6NACSBCRw8Zy+rxH2jzZ7nNGaxPa35aYpwthl102n7/ I9j2NGit3H5Ie/sR3pl1N0Zl7HYqx7PaDK3EnxmnHEY6DswbsgkAUuGBmOjKaudvp7zg aCMthvssDEcJhqutJNmH0VsV1sbUStYnGDWlL+ib09lMANPvxAC6MnKJXqwM6GfySSGs jAz/YBZ+isQuD8yVwbMyW6npNM/dQLLfaTxkZyAEhZbTIkXK1wmfHqXfP299KyE2gYoY +3KCymBz6t/au+RHdEe4IZ0oEqqMiI2lXJJdqbanRIC3hDNT50em/6YqkYLENzL5+Zvd rmnw== X-Gm-Message-State: APjAAAW3Zff77w6qn/XInZkFlYiNREcv4giDc7Z8DUyEB3Q9J5MZoDba KbzYTNKHFE29/OM21Pi+o48= X-Received: by 2002:a63:e755:: with SMTP id j21mr4135479pgk.330.1581379095567; Mon, 10 Feb 2020 15:58:15 -0800 (PST) Received: from ast-mbp ([2620:10d:c090:200::2:685c]) by smtp.gmail.com with ESMTPSA id n2sm1189089pgn.71.2020.02.10.15.58.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Feb 2020 15:58:14 -0800 (PST) Date: Mon, 10 Feb 2020 15:58:12 -0800 From: Alexei Starovoitov To: KP Singh Cc: linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-security-module@vger.kernel.org, Brendan Jackman , Florent Revest , Thomas Garnier , Alexei Starovoitov , Daniel Borkmann , James Morris , Kees Cook , Thomas Garnier , Michael Halcrow , Paul Turner , Brendan Gregg , Jann Horn , Matthew Garrett , Christian Brauner , =?utf-8?Q?Micka=C3=ABl_Sala=C3=BCn?= , 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 v3 03/10] bpf: lsm: Introduce types for eBPF based LSM Message-ID: <20200210235811.pbzvlok6rin7lctd@ast-mbp> References: <20200123152440.28956-1-kpsingh@chromium.org> <20200123152440.28956-4-kpsingh@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200123152440.28956-4-kpsingh@chromium.org> User-Agent: NeoMutt/20180223 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 23, 2020 at 07:24:33AM -0800, KP Singh wrote: > + > +static const struct bpf_func_proto *get_bpf_func_proto( > + enum bpf_func_id func_id, const struct bpf_prog *prog) > +{ > + switch (func_id) { > + case BPF_FUNC_map_lookup_elem: > + return &bpf_map_lookup_elem_proto; > + case BPF_FUNC_get_current_pid_tgid: > + return &bpf_get_current_pid_tgid_proto; > + default: > + return NULL; > + } > +} > + > +const struct bpf_verifier_ops lsm_verifier_ops = { > + .get_func_proto = get_bpf_func_proto, > +}; Why artificially limit it like this? It will cause a lot of churn in the future. Like allowing map update and delete, in addition to lookup, will be an obvious next step. I think allowing tracing_func_proto() from the start is cleaner.