Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1483734

Re: [RFC v3 11/22] seccomp,landlock: Handle Landlock hooks per process hierarchy

From Mickaël Salaün <mic@digikod.net>
Newsgroups linux.kernel
Subject Re: [RFC v3 11/22] seccomp,landlock: Handle Landlock hooks per process hierarchy
Date 2016-09-15 00:40 +0200
Message-ID <shr0u-6Ra-3@gated-at.bofh.it> (permalink)
References <shcNP-6gS-15@gated-at.bofh.it> <shcNQ-6gS-49@gated-at.bofh.it> <shnpT-4on-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On 14/09/2016 20:43, Andy Lutomirski wrote:
> On Wed, Sep 14, 2016 at 12:24 AM, Mickaël Salaün <mic@digikod.net> wrote:
>> A Landlock program will be triggered according to its subtype/origin
>> bitfield. The LANDLOCK_FLAG_ORIGIN_SECCOMP value will trigger the
>> Landlock program when a seccomp filter will return RET_LANDLOCK.
>> Moreover, it is possible to return a 16-bit cookie which will be
>> readable by the Landlock programs in its context.
> 
> Are you envisioning that the filters will return RET_LANDLOCK most of
> the time or rarely?  If it's most of the time, then maybe this could
> be simplified a bit by unconditionally calling the landlock filter and
> letting the landlock filter access a struct seccomp_data if needed.

Exposing seccomp_data in a Landlock context may be a good idea. The main
implication is that Landlock programs may then be architecture specific
(if dealing with data) as seccomp filters are. Another point is that it
remove any direct binding between seccomp filters and Landlock programs.
I will try this (more simple) approach.

> 
>>
>> Only seccomp filters loaded from the same thread and before a Landlock
>> program can trigger it through LANDLOCK_FLAG_ORIGIN_SECCOMP. Multiple
>> Landlock programs can be triggered by one or more seccomp filters. This
>> way, each RET_LANDLOCK (with specific cookie) will trigger all the
>> allowed Landlock programs once.
> 
> This interface seems somewhat awkward.  Should we not have a way to
> atomicaly install a whole pile of landlock filters and associated
> seccomp filter all at once?

I can change the seccomp(2) use in this way: instead of loading a
Landlock program, (atomically) load an array of Landlock programs.

However, exposing seccomp_data to Landlock programs looks like a better
way to deal with it. This does not needs to manage an array of Landlock
programs.

 Mickaël

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[RFC v3 11/22] seccomp,landlock: Handle Landlock hooks per process hierarchy Mickaël Salaün <mic@digikod.net> - 2016-09-14 09:30 +0200
  Re: [RFC v3 11/22] seccomp,landlock: Handle Landlock hooks per  process hierarchy Andy Lutomirski <luto@amacapital.net> - 2016-09-14 20:50 +0200
    Re: [RFC v3 11/22] seccomp,landlock: Handle Landlock hooks per  process hierarchy Mickaël Salaün <mic@digikod.net> - 2016-09-15 00:40 +0200

csiph-web