seccomp: Support PKU in docker by default#43490
Conversation
bd93981 to
96afe3e
Compare
|
This seems like it would be ok. If it is indeed per process this seems OK. |
|
Hi @cpuguy83 , could you provide more details to show which statement confuses you? You also mentioned:
Add |
Add pkey_alloc(2), pkey_free(2) and pkey_mprotect(2) in seccomp default profile. pkey_alloc(2), pkey_free(2) and pkey_mprotect(2) can only configure the calling process's own memory, so they are existing "safe for everyone" syscalls. close issue: moby#43481 Signed-off-by: zhubojun <[email protected]>
96afe3e to
e258d66
Compare
|
Hi, is there anyone help me review this PR? Thanks for your time! |
Closes #43481
Add
pkey_alloc(2),pkey_free(2)andpkey_mprotect(2)in seccomp default profile.Similar to
mprotect(),pkey_alloc(2),pkey_free(2)andpkey_mprotect(2)can only configure its own memory of the process, so they are existing "safe for everyone" syscalls.Such syscalls were added to Linux in kernel 4.9
More details can be found in the man page
What I did
I add
pkey_alloc(), pkey_free()andpkey_mprotect()` into the default syscall's white list.How I did it
Modify
profiles/seccomp/default.jsonandprofiles/seccomp/default_linux.go, appendpkey_alloc(), pkey_free()and pkey_mprotect()to the default syscall list.How to verify it
Here is the sample code (test.c):
Compile it first:
Run
testin docker:and will get the output:
Description for the changelog
profiles/seccomp/default.jsonandprofiles/seccomp/default_linux.go: Addpkey_alloc(),pkey_free()andpkey_mprotect()to the default white list.A picture of a cute animal (not mandatory but encouraged)