From 39b799ac53e2ba397edc3063432d01478416dbc8 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Wed, 24 Feb 2016 19:47:50 +0000 Subject: [PATCH] Add some uses of personality syscall to default seccomp filter We generally want to filter the personality(2) syscall, as it allows disabling ASLR, and turning on some poorly supported emulations that have been the target of CVEs. However the use cases for reading the current value, setting the default PER_LINUX personality, and setting PER_LINUX32 for 32 bit emulation are fine. See issue #20634 Signed-off-by: Justin Cormack --- profiles/seccomp/default.json | 36 +++++++++++++++++++++++++++++ profiles/seccomp/seccomp_default.go | 33 ++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/profiles/seccomp/default.json b/profiles/seccomp/default.json index da58684fa5..1addba4e46 100755 --- a/profiles/seccomp/default.json +++ b/profiles/seccomp/default.json @@ -833,6 +833,42 @@ "action": "SCMP_ACT_ALLOW", "args": [] }, + { + "name": "personality", + "action": "SCMP_ACT_ALLOW", + "args": [ + { + "index": 0, + "value": 0, + "valueTwo": 0, + "op": "SCMP_CMP_EQ" + } + ] + }, + { + "name": "personality", + "action": "SCMP_ACT_ALLOW", + "args": [ + { + "index": 0, + "value": 8, + "valueTwo": 0, + "op": "SCMP_CMP_EQ" + } + ] + }, + { + "name": "personality", + "action": "SCMP_ACT_ALLOW", + "args": [ + { + "index": 0, + "value": 4294967295, + "valueTwo": 0, + "op": "SCMP_CMP_EQ" + } + ] + }, { "name": "pipe", "action": "SCMP_ACT_ALLOW", diff --git a/profiles/seccomp/seccomp_default.go b/profiles/seccomp/seccomp_default.go index ff7005f5d1..9fa50979b0 100644 --- a/profiles/seccomp/seccomp_default.go +++ b/profiles/seccomp/seccomp_default.go @@ -865,6 +865,39 @@ var DefaultProfile = &types.Seccomp{ Action: types.ActAllow, Args: []*types.Arg{}, }, + { + Name: "personality", + Action: types.ActAllow, + Args: []*types.Arg{ + { + Index: 0, + Value: 0x0, + Op: types.OpEqualTo, + }, + }, + }, + { + Name: "personality", + Action: types.ActAllow, + Args: []*types.Arg{ + { + Index: 0, + Value: 0x0008, + Op: types.OpEqualTo, + }, + }, + }, + { + Name: "personality", + Action: types.ActAllow, + Args: []*types.Arg{ + { + Index: 0, + Value: 0xffffffff, + Op: types.OpEqualTo, + }, + }, + }, { Name: "pipe", Action: types.ActAllow,