Skip to content

Fuzzing: Instrument with new sanitizers#7396

Merged
fuweid merged 1 commit intocontainerd:mainfrom
AdamKorcz:fuzz3
Sep 19, 2022
Merged

Fuzzing: Instrument with new sanitizers#7396
fuweid merged 1 commit intocontainerd:mainfrom
AdamKorcz:fuzz3

Conversation

@AdamKorcz
Copy link
Copy Markdown
Contributor

@AdamKorcz AdamKorcz commented Sep 15, 2022

This instruments images/ with new sanitizers/bug detectors that AdaLogics are developing to work with fuzzing.

The plan is to start with a small part of Containerd and if everything runs well move on to the entire project. I will observe the OSS-Fuzz dashboard closely for any breakages.

No extra work is required from the Containerd side. Everything should work as usual.

@kzys

Needs google/oss-fuzz#8504 to be merged first - this is why CIFuzz is failing.

Signed-off-by: AdamKorcz [email protected]

@k8s-ci-robot
Copy link
Copy Markdown

Hi @AdamKorcz. 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.

}

cd $SRC/instrumentation
go run main.go $SRC/containerd/images
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.

Where is the main.go? In a different repository?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, "instrumentation" is being cloned here: google/oss-fuzz#8504

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.

Thanks! Can you mention the location in oss_fuzz_build.sh? It may be obvious for oss-fuzz folks, but not so for containerd folks.

Compared to cncf-fuzzing, https://github.com/AdamKorcz/instrumentation doesn't have much containerd stuff. So I'm fine having a separate repos for that.

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.

Also I'd like to merge this PR after google/oss-fuzz#8504. Would it work for you?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Can you mention the location in oss_fuzz_build.sh? It may be obvious for oss-fuzz folks, but not so for containerd folks.

In an inline comment or in this PR?

Compared to cncf-fuzzing, https://github.com/AdamKorcz/instrumentation doesn't have much containerd stuff. So I'm fine having a separate repos for that.

Yes, the instrumentation project is meant to be general.

Also I'd like to merge this PR after google/oss-fuzz#8504. Would it work for you?

Sure, it has just been merged.

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.

In an inline comment or in this PR?

In the shell script itself.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In the shell script itself.

Not sure I understand. Should I write in oss_fuzz_build.sh where it is in the containerd repo? If users have already found the oss_fuzz_build.sh script, do they need to know where it is?

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.

oh sorry, I meant, oss_fuzz_build.sh should explain how does it get main.go. You could just say something like "this is from https://github.com/AdamKorcz/instrumentation"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the elaboration and sorry for the misunderstanding. A comment has been added!

func FuzzImportIndex(data []byte) int {
f := fuzz.NewConsumer(data)
tarBytes, err := f.TarBytes()
tarBytes, err := f.GetBytes()
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.

Does it return arbitrary bytes or bytes that are valid as a tar archive?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

arbitrary bytes. It should work better with new bug detectors.

Copy link
Copy Markdown
Member

@kzys kzys left a comment

Choose a reason for hiding this comment

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

Looks good to me!

/ok-to-test

@fuweid fuweid merged commit 333698a into containerd:main Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants