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 lzo #1862

Merged
merged 13 commits into from
Oct 23, 2018
Merged

Add lzo #1862

merged 13 commits into from
Oct 23, 2018

Conversation

bshastry
Copy link
Contributor

@bshastry bshastry commented Oct 8, 2018

This PR:

CC @viniul

Copy link
Contributor

@jonathanmetzman jonathanmetzman left a comment

Choose a reason for hiding this comment

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

We approve of adding this project.
Did you want feedback from @markus-oberhumer before we merged this?


/* Decompress. */
new_len = size;
r = lzo1x_decompress(out,out_len,in,&new_len,NULL);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be nice to have another target that tried to decompress data. Right now lzo1x_decompress is not decompressing anything invalid.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. @markus-oberhumer What do you think of adding lzo to oss fuzz?

Would it be better to move this and future test harnesses to lzo repo? Currently this PR picks up an lzo release. Would it be better to fuzz the current development commit instead? I couldn't find a public repository for lzo unfortunately.

Copy link
Contributor

Choose a reason for hiding this comment

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

Markus: we prefer to have fuzz targets upstream (less likely to break)

Copy link
Contributor Author

@bshastry bshastry Oct 10, 2018

Choose a reason for hiding this comment

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

@jonathanmetzman I added a decompress only target in the source branch of this PR. Looking forward to feedback.

At the moment, there is a shallow heap-buffer overrun (READ) like so for a 1 byte compressed data:

READ of size 8 at 0x6020000000d1 thread T0                                                             
SCARINESS: 23 (8-byte-read-heap-buffer-overflow)                                           
    #0 0x5bdcce in lzo1x_decompress /src/lzo-2.10/src/lzo1x_d.ch:120:13

@bshastry
Copy link
Contributor Author

bshastry commented Oct 8, 2018

Brainstorming here: To do this systematically, we would need to add two targets per compression method, one that compresses fuzzed data and another that decompresses it. I believe there are 10 or more compression methods in the current release version, do that would mean around 20 targets.

This is excluding other compression parameters such as the number of rounds to use etc.

Wouldn't having so many targets sit in the oss-fuzz repo lead to bit rot?

@jonathanmetzman
Copy link
Contributor

Brainstorming here: To do this systematically, we would need to add two targets per compression method, one that compresses fuzzed data and another that decompresses it.

I think having these two kinds of targets are worthwhile:

decompress(compress(data))

and

decompress(data)

(decompression in the first target is controversial, since theoretically it shouldn't cover anything the second target won't, but my guess is it would be useful in practice).

I believe there are 10 or more compression methods in the current release version, do that would mean around 20 targets.

This is excluding other compression parameters such as the number of rounds to use etc.

So instead of creating one (or two) new target(s) for every method/parameter combination, you can
take some bytes from the start of data to determine which compression method to use and what the parameters will be. Sort of like this:

index = data[0] % compression_methods.length;
method = compression_methods[index]
method(data[1], size-1)

Wouldn't having so many targets sit in the oss-fuzz repo lead to bit rot?

Yes. This is probably too many.

@bshastry
Copy link
Contributor Author

bshastry commented Oct 8, 2018

Thank you @jonathanmetzman for the discussion.

I will address these concerns on my fork and ping you back when that's ready for review.

In the meanwhile, looking forward to hearing from Markus.

@bshastry
Copy link
Contributor Author

bshastry commented Oct 10, 2018

Ping back from Berlin :-)

@markus-oberhumer: What email address should I use as the primary contact in project.yaml? At the moment, it is "info at oberhumer.com" but this looks like a sales related contact end-point.

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

@bshastry
Copy link
Contributor Author

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

@viniul I think you need to sign the Google CLA :-)

@viniul
Copy link
Contributor

viniul commented Oct 10, 2018

I'll make sure to sign it :)

Vincent Ulitzsch and others added 3 commits October 11, 2018 01:02
This commit adds more decompression targets to decompress_target.c. The target function is chosen based on the first byte of the data given by libfuzzer.
@jonathanmetzman
Copy link
Contributor

ping.
@viniul are you still planning on signing the cla?

@viniul
Copy link
Contributor

viniul commented Oct 18, 2018

@jonathanmetzman Sorry, I did not have the time to look into it yet. Planning on signing it this weekend.

@viniul
Copy link
Contributor

viniul commented Oct 19, 2018

@jonathanmetzman I have filled out and submitted the Google CLA.

@jonathanmetzman
Copy link
Contributor

In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

@bshastry can you comment again so that I can see if the bot updates the status?
Some of the docs imply that the status won't be updated because the pull request has multiple authors, but I guess we will find out.

@bshastry
Copy link
Contributor Author

Bot do you think?

@Dor1s
Copy link
Contributor

Dor1s commented Oct 19, 2018

Yeah, we need to make sure that CLA is signed for each email from the following:

$ git log -n 13 | egrep -i author | uniq
Author: Bhargava Shastry <bshastry@sect.tu-berlin.de>
Author: Vincent Ulitzsch <vincent.ulitzsch@live.de>
Author: Vincent Ulitzsch <vincent@srlabs.de>
Author: Bhargava Shastry <bshastry@sect.tu-berlin.de>
Author: Vincent Ulitzsch <vincent@srlabs.de>
Author: Bhargava Shastry <bshastry@sect.tu-berlin.de>

or you can try to squash the commits and upload a separate PR / force update this one.

@viniul
Copy link
Contributor

viniul commented Oct 21, 2018

Hey @Dor1s - I signed the Google CLA for the emails I used for the commits. I think @bshastry signed his already - so we should be good to go. Can you confirm?

@bshastry
Copy link
Contributor Author

Just a check on the cla.

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

@Dor1s
Copy link
Contributor

Dor1s commented Oct 21, 2018

@viniul @bshastry thank you! Now I have to figure out how to set that cla label to yes.

@Dor1s
Copy link
Contributor

Dor1s commented Oct 23, 2018

Ok, as per some documentation I've found, @googlebot is not going to change the status here, and we can merge after getting the consent from all authors. Given that we have only two authors here (with a couple different git emails), I think we have a consent from everyone. Merging.

@Dor1s Dor1s merged commit 754db9e into google:master Oct 23, 2018
inferno-chromium added a commit that referenced this pull request Oct 23, 2018
inferno-chromium added a commit that referenced this pull request Oct 23, 2018
This was referenced Oct 25, 2018
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.

5 participants