Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gvisor presubmit test #4984

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

avagin
Copy link
Collaborator

@avagin avagin commented Jul 4, 2024

No description provided.

@avagin avagin marked this pull request as draft July 4, 2024 01:03
@avagin avagin force-pushed the gvisor-smoke-test branch 10 times, most recently from 6ebf2bc to 035d902 Compare July 4, 2024 03:40
@avagin avagin marked this pull request as ready for review July 4, 2024 03:46
@avagin avagin requested a review from a-nogikh July 4, 2024 07:49
@a-nogikh
Copy link
Collaborator

a-nogikh commented Jul 4, 2024

I wonder if we'd better hard-code the gVisor release number to make test results more reproducible.

@avagin
Copy link
Collaborator Author

avagin commented Jul 4, 2024

@a-nogikh I was thinking about that too. I think it is better to start with the latest one and then we will be able to change that in case of any problem. I will introduce the same test in the gvisor presubmit suite, so I don't expect any issues here.

@a-nogikh
Copy link
Collaborator

a-nogikh commented Jul 4, 2024

Currently it stumbles on the problem fixed in #4986

2024/07/04 03:43:42 [FATAL] failed to create rpc server: open vmlinux: no such file or directory

Let's wait until #4986 is merged.

@dvyukov
Copy link
Collaborator

dvyukov commented Jul 4, 2024

Currently it stumbles on the problem fixed in #4986

2024/07/04 03:43:42 [FATAL] failed to create rpc server: open vmlinux: no such file or directory

Let's wait until #4986 is merged.

I think it's better to make the test as realistic as possible, or it will miss bugs. syz-ci should provide kernel_obj dir, let's do the same here.

@a-nogikh
Copy link
Collaborator

a-nogikh commented Jul 4, 2024

Now the test fails with:

./bin/syz-manager -config /tmp/syzkaller-gvisor-test.kCYdNw/config --mode smoke-test
2024/07/04 14:43:26 serving http on http://:54321
2024/07/04 14:43:26 serving rpc on tcp://38615
2024/07/04 14:43:26 booting test machines...
2024/07/04 14:43:26 wait for the connection from test machine...
2024/07/04 14:43:35 vm-0: crash: FATAL ERROR: Error executing inside namespace: re-executing self: fork/exec /proc/self/exe: operation not permitted
2024/07/04 14:43:35 [FATAL] kernel crashed in smoke testing mode, exiting

@avagin avagin force-pushed the gvisor-smoke-test branch 8 times, most recently from 04cc86f to 167c274 Compare July 4, 2024 18:23
Download the latest gvisor release and run the syz-manager smoke-test
suite.

Signed-off-by: Andrei Vagin <avagin@google.com>
@avagin avagin force-pushed the gvisor-smoke-test branch 2 times, most recently from 86438fd to 90f79f7 Compare July 4, 2024 18:52
@avagin
Copy link
Collaborator Author

avagin commented Jul 4, 2024

Now the test fails with:

./bin/syz-manager -config /tmp/syzkaller-gvisor-test.kCYdNw/config --mode smoke-test
2024/07/04 14:43:26 serving http on http://:54321
2024/07/04 14:43:26 serving rpc on tcp://38615
2024/07/04 14:43:26 booting test machines...
2024/07/04 14:43:26 wait for the connection from test machine...
2024/07/04 14:43:35 vm-0: crash: FATAL ERROR: Error executing inside namespace: re-executing self: fork/exec /proc/self/exe: operation not permitted
2024/07/04 14:43:35 [FATAL] kernel crashed in smoke testing mode, exiting

I fixed the test. I checked it with this patch:

diff --git a/pkg/vminfo/linux.go b/pkg/vminfo/linux.go
index 030b9a038..25e90c377 100644
--- a/pkg/vminfo/linux.go
+++ b/pkg/vminfo/linux.go
@@ -45,6 +45,7 @@ func (linux) machineInfos() []machineInfoFunc {
 }
 
 func (linux) parseModules(files filesystem) ([]*cover.KernelModule, error) {
+       return nil, nil
        var modules []*cover.KernelModule
        re := regexp.MustCompile(`(\w+) ([0-9]+) .*(0[x|X][a-fA-F0-9]+)[^\n]*`)
        modulesText, _ := files.ReadFile("/proc/modules")

@avagin
Copy link
Collaborator Author

avagin commented Jul 4, 2024

I think it's better to make the test as realistic as possible, or it will miss bugs. syz-ci should provide kernel_obj dir, let's do the same here.

@dvyukov Can you be a bit more detailed about this kernel_obj dir? What should it contain?

@dvyukov
Copy link
Collaborator

dvyukov commented Jul 5, 2024

I think it's better to make the test as realistic as possible, or it will miss bugs. syz-ci should provide kernel_obj dir, let's do the same here.

@dvyukov Can you be a bit more detailed about this kernel_obj dir? What should it contain?

Any dir that contains the runsc binary renamed to "vmlinux":
https://github.com/google/syzkaller/blob/master/pkg/build/gvisor.go#L94-L95
Not all code distinguished between real Linux and gVisor, so the binary is renamed to "vmlinux".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants