Skip to content

Commit af1ba34

Browse files
committed
Review comments
- Add notes to readme - Accept options for proc as I don't see a reason not to Signed-off-by: David Leadbeater <[email protected]>
1 parent b666bad commit af1ba34

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ apiVersion: v1
8282
kind: Pod
8383
metadata:
8484
name: mynotifypod
85-
# For older versions of Kubernetes:
85+
# For older versions of Kubernetes (this annotation was deprecated in
86+
# Kubernetes v1.19 and completely removed in v1.27):
8687
annotations:
8788
seccomp.security.alpha.kubernetes.io/pod: localhost/notify.json
8889
spec:
@@ -126,6 +127,13 @@ running. This is far safer than giving the container `privileged` access but
126127
does expose more of the kernel to the pod, so you should consider your security
127128
carefully.
128129

130+
There is a possibility a process could change its user namespace after making
131+
the mount system call, which could result in a confusing state. To fix this the
132+
seccomp notify policy should use the SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV
133+
flag, however this is [not yet available in
134+
runc](https://github.com/opencontainers/runc/issues/3860) and requires Linux >=
135+
5.19.
136+
129137
Configure a policy, similar to above, but with the following metadata:
130138
```json
131139
{

pkg/handlers/mount.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,11 @@ func Mount(allowedFilesystems map[string]struct{}, requireUserNamespaceAdmin boo
120120
}
121121

122122
var options string
123-
if req.Data.Args[4] != 0/* NULL */ && filesystem != "proc" && filesystem != "sysfs" {
123+
if req.Data.Args[4] != 0/* NULL */ && filesystem != "sysfs" {
124124
// Get options, we assume because this is specified in
125125
// allowedFilesystems that the data argument to mount(2)
126-
// is a string so this is safe now.
126+
// is a string so this is safe now. We ignore options for sysfs, as it
127+
// doesn't define options.
127128
options, err = readarg.ReadString(memFile, int64(req.Data.Args[4]))
128129
if err != nil {
129130
log.WithFields(log.Fields{

0 commit comments

Comments
 (0)