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

kconfig: validate that PutInteger doesn't truncate data #1208

Closed
2 tasks
lmb opened this issue Nov 7, 2023 · 7 comments · Fixed by #1323
Closed
2 tasks

kconfig: validate that PutInteger doesn't truncate data #1208

lmb opened this issue Nov 7, 2023 · 7 comments · Fixed by #1323
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@lmb
Copy link
Collaborator

lmb commented Nov 7, 2023

In #1202 I exported PutInteger from the kconfig package. The function has basic validation for booleans, but doesn't check that the value isn't truncated when writing into an integer. We should add bounds checking to make sure we don't write a large value like 0xffff into a uint8 for example. Note that this needs to take the signedness of the target integer into account.

  • Validate that n doesn't exceed the bounds of the 1,2 4, 8 byte integer we are writing into.
  • Add testcases for PutInteger
@lmb lmb added enhancement New feature or request good first issue Good for newcomers labels Nov 7, 2023
@atgane
Copy link
Contributor

atgane commented Nov 30, 2023

may I handle this issue? I'll create issue soon!

@lmb
Copy link
Collaborator Author

lmb commented Dec 13, 2023

@atgane how are you getting on? Feel free to drop into the ebpf-go-dev channel on Slack if you want to discuss this.

@atgane
Copy link
Contributor

atgane commented Dec 13, 2023

I'm working on a test case, and I will make PR this week!

@ti-mo
Copy link
Collaborator

ti-mo commented Jan 15, 2024

@atgane Ping to check if you're still working on this.

@atgane
Copy link
Contributor

atgane commented Jan 16, 2024

The PR was closed by mistake, is there any more work to be done since the last commit?

@ti-mo
Copy link
Collaborator

ti-mo commented Jan 29, 2024

By PR, do you mean #1277? If you want it to be merged, it needs to be reopened, rebased and squashed, and the merge commit removed. :)

@atgane
Copy link
Contributor

atgane commented Jan 31, 2024

Thank you for your reply. I'll create a PR again

@ti-mo ti-mo linked a pull request Feb 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants