From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932946AbcHYLQx (ORCPT ); Thu, 25 Aug 2016 07:16:53 -0400 Received: from mail-ua0-f169.google.com ([209.85.217.169]:32911 "EHLO mail-ua0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751042AbcHYLQv (ORCPT ); Thu, 25 Aug 2016 07:16:51 -0400 MIME-Version: 1.0 In-Reply-To: <1472121165-29071-10-git-send-email-mic@digikod.net> References: <1472121165-29071-1-git-send-email-mic@digikod.net> <1472121165-29071-10-git-send-email-mic@digikod.net> From: Andy Lutomirski Date: Thu, 25 Aug 2016 04:09:26 -0700 Message-ID: Subject: Re: [RFC v2 09/10] landlock: Handle cgroups To: =?UTF-8?B?TWlja2HDq2wgU2FsYcO8bg==?= Cc: "linux-kernel@vger.kernel.org" , Alexei Starovoitov , Arnd Bergmann , Casey Schaufler , Daniel Borkmann , Daniel Mack , David Drysdale , "David S . Miller" , Elena Reshetova , James Morris , Kees Cook , Paul Moore , Sargun Dhillon , "Serge E . Hallyn" , Will Drewry , "kernel-hardening@lists.openwall.com" , Linux API , LSM List , Network Development Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id u7PBGvfa004029 On Thu, Aug 25, 2016 at 3:32 AM, Mickaël Salaün wrote: > Add an eBPF function bpf_landlock_cmp_cgroup_beneath(opt, map, map_op) > to compare the current process cgroup with a cgroup handle, The handle > can match the current cgroup if it is the same or a child. This allows > to make conditional rules according to the current cgroup. > > A cgroup handle is a map entry created from a file descriptor referring > a cgroup directory (e.g. by opening /sys/fs/cgroup/X). In this case, the > map entry is of type BPF_MAP_HANDLE_TYPE_LANDLOCK_CGROUP_FD and the > inferred array map is of type BPF_MAP_ARRAY_TYPE_LANDLOCK_CGROUP. Can you elaborate on why this is useful? I.e. why not just supply different policies to different subtrees. Also, how does this interact with the current cgroup v1 vs v2 mess? As far as I can tell, no one can even really agree on what "what cgroup am I in" means right now. > > An unprivileged process can create and manipulate cgroups thanks to > cgroup delegation. What is cgroup delegation? --Andy