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

gnrc/rpl: fix incorrect addition overflow check #19739

Merged
merged 1 commit into from
Jun 17, 2023

Conversation

szsam
Copy link
Contributor

@szsam szsam commented Jun 17, 2023

Contribution description

Checking for overflow of integer addition by comparing against one of the arguments of the addition does not work when the result of the addition is automatically promoted to a larger type.

Fix by using an explicit cast to make sure that the result of the addition is not implicitly converted to a larger type.

Testing procedure

make -C examples/gnrc_networking

Issues/PRs references

Checking for overflow of integer addition by comparing against one of
the arguments of the addition does not work when the result of the
addition is automatically promoted to a larger type.

Fix by using an explicit cast to make sure that the result of the
addition is not implicitly converted to a larger type.
@github-actions github-actions bot added Area: network Area: Networking Area: sys Area: System labels Jun 17, 2023
Copy link
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

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

Thx for spotting this

@maribu maribu added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jun 17, 2023
@riot-ci
Copy link

riot-ci commented Jun 17, 2023

Murdock results

✔️ PASSED

fe92f67 gnrc/rpl: fix incorrect addition overflow check

Success Failures Total Runtime
6934 0 6934 10m:41s

Artifacts

@maribu
Copy link
Member

maribu commented Jun 17, 2023

bors merge

bors bot added a commit that referenced this pull request Jun 17, 2023
19739: gnrc/rpl: fix incorrect addition overflow check r=maribu a=szsam




Co-authored-by: Mingjie Shen <[email protected]>
@maribu
Copy link
Member

maribu commented Jun 17, 2023

bors retry

@bors
Copy link
Contributor

bors bot commented Jun 17, 2023

Already running a review

@maribu
Copy link
Member

maribu commented Jun 17, 2023

Already running a review

That's a lie :-(

bors cancel
bors merge

@bors
Copy link
Contributor

bors bot commented Jun 17, 2023

Canceled.

@bors
Copy link
Contributor

bors bot commented Jun 17, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 1bed7dd into RIOT-OS:master Jun 17, 2023
@akulpillai
Copy link

Hi! I’m a student researcher working with @szsam. We have identified this patch as one for a security vulnerability.

Will a CVE be issued for this?

@benpicco benpicco added this to the Release 2023.07 milestone Aug 2, 2023
@Machiry
Copy link

Machiry commented Mar 25, 2024

Hello @maribu, @benpicco ,

My name is Aravind Machiry, Assistant Professor at Purdue's ECE Department.

Thank you for considering this pull request. This pull request was the result of our on-going research work (along with @szsam) to improve the security of open-source embedded projects.

In addition to scanning codebases with CodeQL, we are also doing a short (~4 minutes) survey to understand the use of static analysis tools like gcc -Wall and CodeQL in embedded software projects.

It would greatly benefit our research if you could fill this anonymous survey: https://purdue.ca1.qualtrics.com/jfe/form/SV_0OnXfr5plPe1QCa

Thank you,
Aravind

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants