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

sys/clif: Fixing out of bounds read under certain conditions [backport 2022.10] #18810

Merged
merged 1 commit into from
Oct 29, 2022

Conversation

maribu
Copy link
Member

@maribu maribu commented Oct 27, 2022

Backport of #18744

Hi 😈

This fixes a potential out of bounds read in clif_encode_link. There is no code in RIOT that can be exploited & and the close by memcpy only operates within a safe/length checked buffer.

The fix does not break the current API.
I also added a new test which also acts as an example on how to use clif.

Run make -C tests/unittests tests-clif and make -C tests/unittests term to test the fix.

Side note: I did not run uncrustify as this would have filled this PR with a lot of unrelated changes. Somebody should open a separate PR for those cosmetic changes.

cc @leandrolanzieri

@maribu maribu added Area: sys Area: System Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: release backport Integration Process: The PR is a release backport of a change previously provided to master Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) labels Oct 27, 2022
@riot-ci
Copy link

riot-ci commented Oct 27, 2022

Murdock results

✔️ PASSED

bb7c6d0 sys/clif: Fixing out of bounds read under certain conditions

Success Failures Total Runtime
1983 0 1983 06m:05s

Artifacts

This only reflects a subset of all builds from https://ci-prod.riot-os.org. Please refer to https://ci.riot-os.org for a complete build for now.

@kfessel
Copy link
Contributor

kfessel commented Oct 27, 2022

waiting for #18812

@maribu maribu added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Oct 28, 2022
Copy link
Contributor

@kfessel kfessel left a comment

Choose a reason for hiding this comment

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

The original PR got merged, this is just a backport and this backport PR was created by one of the current release maintainers ->

@benpicco benpicco force-pushed the backport/2022.10/fix/clif_0 branch from c5407cc to bb7c6d0 Compare October 28, 2022 18:46
@benpicco benpicco enabled auto-merge October 28, 2022 18:46
@benpicco benpicco merged commit c60119b into RIOT-OS:2022.10-branch Oct 29, 2022
@maribu maribu deleted the backport/2022.10/fix/clif_0 branch April 25, 2023 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: sys Area: System Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: release backport Integration Process: The PR is a release backport of a change previously provided to master Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants