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

rimage: strcpy possible buffer overflow #257

Closed
plbossart opened this issue Aug 23, 2018 · 10 comments · Fixed by #1524
Closed

rimage: strcpy possible buffer overflow #257

plbossart opened this issue Aug 23, 2018 · 10 comments · Fixed by #1524
Assignees
Labels
enhancement New feature or request P3 Low-impact bugs or features
Milestone

Comments

@plbossart
Copy link
Member

This code in pkcs1_5.c is flagged by Coverity as problematic

	if (!image->key_name)
		sprintf(path, "%s/otc_private_key.pem", PEM_KEY_PREFIX);
	else
		strcpy(path, image->key_name);

CID 313456 (#1 of 1): Copy into fixed size buffer (STRING_OVERFLOW)
3. fixed_size_dest: You might overrun the 256-character fixed-size string path by copying image->key_name without checking the length.
4. parameter_as_source: Note: This defect has an elevated risk because the source argument is a parameter of the current function

@xiulipan xiulipan self-assigned this Aug 24, 2018
@xiulipan
Copy link
Contributor

@plbossart i will thake #257 and #258.
If Covertiy is some new scan? and how could I re-run to check if this could solve the problem.

@mengdonglin mengdonglin added this to the TBD milestone Aug 31, 2018
@mengdonglin mengdonglin added the enhancement New feature or request label Sep 17, 2018
@plbossart
Copy link
Member Author

still an issue as of November 2...

@xiulipan
Copy link
Contributor

xiulipan commented Nov 4, 2018

@plbossart
Waiting for the response about, it seems we did not see similar check from other check tool.

If Covertiy is some new scan? and how could I re-run to check if this could solve the problem.

@tlauda
Copy link
Contributor

tlauda commented Nov 28, 2018

@plbossart Please verify with #646.

@jajanusz
Copy link
Contributor

I wonder why tool complained just about 1 line, but it's wrong in 2 places, also here:

strcpy(path, image->key_name);

@tlauda
Copy link
Contributor

tlauda commented Mar 25, 2019

@plbossart Could you rescan the project to make sure all the issues are gone?

@michalgrodzicki
Copy link

Task is assigned to @xiulipan, He will do next scan.

@xiulipan
Copy link
Contributor

@plbossart @tlauda @plbossart
I will try to run a new round Coverity test on my own machine and to evaluate the possibility to make it into our CI.

@jajanusz
Copy link
Contributor

jajanusz commented Jun 6, 2019

Going to be closed with #1524 as initial issue will be fixed.
@xiulipan If you are going to plug Coverity to CI you can create new issue.

@jajanusz jajanusz added the P3 Low-impact bugs or features label Jun 6, 2019
@xiulipan
Copy link
Contributor

@jajanusz
The Coverity may not be in CI as it would require third party sever to analysis and take long time for result showing. And the result can not be export for sharing, developer may need access to Coverity to review the test result.
Need to figure out a way to test with Coverity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P3 Low-impact bugs or features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants