A Andy Lutomirski #
Message details and related content
On Tue, Feb 27, 2018 at 10:14 PM, Micka?l Sala?n [off-list ref] wrote:
On 27/02/2018 06:01, Andy Lutomirski wrote:quoted
quoted
On Feb 26, 2018, at 8:17 PM, Andy Lutomirski [off-list ref] wrote:quoted
On Tue, Feb 27, 2018 at 12:41 AM, Micka?l Sala?n [off-list ref] wrote: A landlocked process has less privileges than a non-landlocked process and must then be subject to additional restrictions when manipulating processes. To be allowed to use ptrace(2) and related syscalls on a target process, a landlocked process must have a subset of the target process' rules. Signed-off-by: Micka?l Sala?n <mic@digikod.net> Cc: Alexei Starovoitov <ast@kernel.org> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Daniel Borkmann <daniel@iogearbox.net> Cc: David S. Miller <davem@davemloft.net> Cc: James Morris <redacted> Cc: Kees Cook <redacted> Cc: Serge E. Hallyn <serge@hallyn.com> --- Changes since v6: * factor out ptrace check * constify pointers * cleanup headers * use the new security_add_hooks() --- security/landlock/Makefile | 2 +- security/landlock/hooks_ptrace.c | 124 +++++++++++++++++++++++++++++++++++++++ security/landlock/hooks_ptrace.h | 11 ++++ security/landlock/init.c | 2 + 4 files changed, 138 insertions(+), 1 deletion(-) create mode 100644 security/landlock/hooks_ptrace.c create mode 100644 security/landlock/hooks_ptrace.hdiff --git a/security/landlock/Makefile b/security/landlock/Makefile index d0f532a93b4e..605504d852d3 100644 --- a/security/landlock/Makefile
I think you're wrong here. Any sane container trying to use Landlock
like this would also create a PID namespace. Problem solved. I still
think you should drop this patch.
quoted
If something like Tycho's notifiers goes in, then it's not obvious that, just because you have the same set of filters, you have the same privilege. Similarly, if a feature that lets a filter query its cgroup goes in (and you proposed this once!) then the logic you implemented here is wrong.I don't get your point. Please take a look at the tests (patch 10).
I don't know what you want me to look at.
What I'm saying is: suppose I write a filter like this:
bool allow_some_action(void)
{
int value_from_container_manager = call_out_to_user_notifier();
return value_from_container_manager == 42;
}
or
bool allow_some_action(void)
{
return my_cgroup_is("/foo/bar");
}
In both of these cases, your code will do the wrong thing.
quoted
Or you could just say that it's the responsibility of a Landlock user to properly filter ptrace() just like it's the responsibility of seccomp users to filter ptrace if needed.A user should be able to enforce a security policy on ptrace as well, but this patch enforce a minimal set of security boundaries. It will be easy to add a new Landlock program type to get this kind of access control.
It sounds like you want Landlock to be a complete container system all by itself. I disagree with that design goal. -- To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html