[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181004025750.498303-3-ast@kernel.org>
Date: Wed, 3 Oct 2018 19:57:46 -0700
From: Alexei Starovoitov <ast@...nel.org>
To: "David S . Miller" <davem@...emloft.net>
CC: <daniel@...earbox.net>, <luto@...capital.net>,
<viro@...iv.linux.org.uk>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <kernel-team@...com>
Subject: [PATCH bpf-next 2/6] fs: wire in BPF_CGROUP_FILE_OPEN hook
enable cgroup-bpf BPF_CGROUP_FILE_OPEN hook after security_file_open() LSM hook.
Similarly to other cgroup-bpf hooks it's gated by static key 'cgroup_bpf_enabled'
and has zero overhead until bpf prog is attached to that hook.
Signed-off-by: Alexei Starovoitov <ast@...nel.org>
---
fs/open.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/open.c b/fs/open.c
index 0285ce7dbd51..7e1170863f40 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -759,6 +759,10 @@ static int do_dentry_open(struct file *f,
if (error)
goto cleanup_all;
+ error = BPF_CGROUP_RUN_PROG_FILE_FILTER(f);
+ if (error)
+ goto cleanup_all;
+
error = break_lease(locks_inode(f), f->f_flags);
if (error)
goto cleanup_all;
--
2.17.1
Powered by blists - more mailing lists