Skip to content

Enable process_vm_readv and process_vm_writev for kernel >= 4.8 - #42083

Merged
thaJeztah merged 1 commit into
moby:masterfrom
clubby789:enable_process_vm
Mar 9, 2021
Merged

thaJeztah merged 1 commit into
moby:masterfrom
clubby789:enable_process_vm

Conversation

@clubby789

Copy link
Copy Markdown
Contributor

These syscalls were disabled in #18971 due to them requiring CAP_PTRACE. CAP_PTRACE was blocked by default due to a ptrace related exploit. This has been patched in the Linux kernel (version 4.8) and thus ptrace has been re-enabled. However, these associated syscalls seem to have been left behind. This commit brings them in line with ptrace, and re-enables it for kernel > 4.8.

- What I did
Re-enabled process_vm_readv and process_vm_writev
- How I did it
Added them to the ptrace profile in the seccomp defaults.
- How to verify it

  1. Start a standard Docker container
  2. Run a program that uses these functions (as root, or targeting a same-user process)

- Description for the changelog
Re-enabled process_vm_readv and process_vm_writev by default for kernel >= 4.8

@clubby789

Copy link
Copy Markdown
Contributor Author

I signed the commit with my own name rather than my Github username, as suggested by CONTRIBUTING.md. Seems like the CI expects my Github username.

@clubby789

Copy link
Copy Markdown
Contributor Author

I ran make test-integration and make test-unit and all passed locally.

@AkihiroSuda AkihiroSuda added area/security/seccomp impact/changelog kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. labels Feb 26, 2021
Comment thread profiles/seccomp/default.json Resolved
@thaJeztah

Copy link
Copy Markdown
Member

@tonistiigi @justincormack PTAL

@thaJeztah

Copy link
Copy Markdown
Member

oh! while you're updating; could you squash the commits so that there's only a single commit in the PR?

These syscalls were disabled in moby#18971
due to them requiring CAP_PTRACE. CAP_PTRACE was blocked by default due
to a ptrace related exploit. This has been patched in the Linux kernel
(version 4.8) and thus `ptrace` has been re-enabled. However, these
associated syscalls seem to have been left behind. This commit brings
them in line with `ptrace`, and re-enables it for kernel > 4.8.

Signed-off-by: clubby789 <[email protected]>
@clubby789
clubby789 force-pushed the enable_process_vm branch from 4bc4f99 to d39b075 Compare March 4, 2021 17:12
@clubby789

Copy link
Copy Markdown
Contributor Author

All squashed now, not sure about the remaining failures, or if they're related to my changes.

@thaJeztah

Copy link
Copy Markdown
Member

Thanks! No failures don't look related; looks like a flaky test; I triggered CI again

@thaJeztah

Copy link
Copy Markdown
Member

@justincormack @tonistiigi PTAL; looks like a follow-up to #38137, which did the same for ptrace; from that PR;

4.8+ kernels have fixed the ptrace security issues so we can allow ptrace(2) on the default seccomp profile if we do the kernel version check. torvalds/linux@93e35ef

(assuming the same security fixes apply to process_vm_readv and process_vm_writev)

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/security/seccomp impact/changelog kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants