Skip to content

Commit

Permalink
Revert "seccomp: block socket calls to AF_VSOCK in default profile"
Browse files Browse the repository at this point in the history
This reverts commit 57b2290.

This change, while favorable from a security standpoint, caused a
regression for users of the 20.10 branch of Moby. As such, we are
reverting it to ensure stability and compatibility for the affected
users.

However, users of AF_VSOCK in containers should recognize that this
(special) address family is not currently namespaced in any version of
the Linux kernel, and may result in unexpected behavior, like VMs
communicating directly with host hypervisors.

Future branches, including the 23.0 branch, will continue to filter
AF_VSOCK. Users who need to allow containers to communicate over the
unnamespaced AF_VSOCK will need to turn off seccomp confinement or set a
custom seccomp profile.

It is our hope that future mechanisms will make this more
ergonomic/maintainable for end users, and that future kernels will
support namespacing of AF_VSOCK.

Closes moby#44670.

Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
  • Loading branch information
neersighted committed Dec 29, 2022
1 parent ddab6b3 commit 0a1c28a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 28 deletions.
19 changes: 2 additions & 17 deletions profiles/seccomp/default.json
Expand Up @@ -348,6 +348,7 @@
"signalfd4",
"sigprocmask",
"sigreturn",
"socket",
"socketcall",
"socketpair",
"splice",
Expand Down Expand Up @@ -416,22 +417,6 @@
},
"excludes": {}
},
{
"names": [
"socket"
],
"action": "SCMP_ACT_ALLOW",
"args": [
{
"index": 0,
"value": 40,
"op": "SCMP_CMP_NE"
}
],
"comment": "",
"includes": {},
"excludes": {}
},
{
"names": [
"personality"
Expand Down Expand Up @@ -862,4 +847,4 @@
"excludes": {}
}
]
}
}
12 changes: 1 addition & 11 deletions profiles/seccomp/default_linux.go
Expand Up @@ -343,6 +343,7 @@ func DefaultProfile() *Seccomp {
"signalfd4",
"sigprocmask",
"sigreturn",
"socket",
"socketcall",
"socketpair",
"splice",
Expand Down Expand Up @@ -403,17 +404,6 @@ func DefaultProfile() *Seccomp {
MinKernel: &KernelVersion{4, 8},
},
},
{
Names: []string{"socket"},
Action: specs.ActAllow,
Args: []*specs.LinuxSeccompArg{
{
Index: 0,
Value: unix.AF_VSOCK,
Op: specs.OpNotEqual,
},
},
},
{
Names: []string{"personality"},
Action: specs.ActAllow,
Expand Down

0 comments on commit 0a1c28a

Please sign in to comment.