Skip to content

allow ptrace(2) by default for kernel >= 4.8#6810

Merged
estesp merged 1 commit intocontainerd:mainfrom
henry118:ptrace
Apr 19, 2022
Merged

allow ptrace(2) by default for kernel >= 4.8#6810
estesp merged 1 commit intocontainerd:mainfrom
henry118:ptrace

Conversation

@henry118
Copy link
Member

Allow ptrace(2) by default for kernel >= 4.8

Fixes: #6802

kernel_linux.go and kernel_linux_test.go are copied from moby project under:
https://github.com/moby/moby/tree/v20.10.14/profiles/seccomp

Testing was performed on 5.10 kernel with strace tool.

Signed-off-by: Henry Wang henwang@amazon.com

@k8s-ci-robot
Copy link

Hi @henry118. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 15, 2022

Build succeeded.

@AkihiroSuda
Copy link
Member

kernel_linux.go and kernel_linux_test.go are copied from moby project under:
https://github.com/moby/moby/tree/v20.10.14/profiles/seccomp

Could you add this information to the headers of the files?

@@ -0,0 +1,78 @@
//go:build linux
// +build linux

Copy link
Member

Choose a reason for hiding this comment

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

You do not need these lines, as the filename already has _linux.go suffix

limitations under the License.
*/

package seccomp
Copy link
Member

Choose a reason for hiding this comment

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

I'm feeling this should be a separate package like pkg/kernelversion or contrib/seccomp/kernelversion

@henry118
Copy link
Member Author

kernel_linux.go and kernel_linux_test.go are copied from moby project under:
https://github.com/moby/moby/tree/v20.10.14/profiles/seccomp

Could you add this information to the headers of the files?

Updated.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 15, 2022

Build succeeded.

Copy link
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

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

LGTM

}

// include by kernel version
if ok, err := kernelversion.KernelGreaterEqualThan(
Copy link
Member

Choose a reason for hiding this comment

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

kernelversion.GreatherEqualThan()?

https://go.dev/doc/effective_go#names

For instance, the buffered reader type in the bufio package is called Reader, not BufReader, because users see it as bufio.Reader, which is a clear, concise name.

Signed-off-by: Henry Wang <henwang@amazon.com>
@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 18, 2022

Build succeeded.

@estesp estesp merged commit 476b9c7 into containerd:main Apr 19, 2022
@henry118 henry118 deleted the ptrace branch April 19, 2022 17:55
@AkihiroSuda AkihiroSuda added cherry-picked/1.6.x PR commits are cherry-picked into release/1.6 branch and removed cherry-pick/1.6.x labels Jul 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked/1.6.x PR commits are cherry-picked into release/1.6 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

seccomp: ptrace(2) should be allowed by default for kernel >= 4.8

6 participants