Skip to content

sys/can/isotp: various style and robustness fixes#22250

Merged
crasbe merged 1 commit into
RIOT-OS:masterfrom
maribu:sys/can/isotp
May 7, 2026
Merged

sys/can/isotp: various style and robustness fixes#22250
crasbe merged 1 commit into
RIOT-OS:masterfrom
maribu:sys/can/isotp

Conversation

@maribu
Copy link
Copy Markdown
Member

@maribu maribu commented May 7, 2026

Contribution description

  • validate received length indicators against actual CAN frame size
  • consistently use size_t instead of a mix int/unsigned for array indices
  • make the file IWYU clean
  • fix some style issues

Testing procedure

No idea, I'm not really familiar with the code. Someone(TM) should do some testing before merging this.

Issues/PRs references

Missing validation of the received CAN frames reported by Shin, Sean J from the Georgia Institute of Technologies. Thanks for that!

Declaration of AI-Tools / LLMs usage:

AI-Tools / LLMs that were used are:

  • none

@maribu maribu requested review from kfessel and vincent-d May 7, 2026 07:02
@maribu maribu added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels May 7, 2026
@github-actions github-actions Bot added the Area: sys Area: System label May 7, 2026
@riot-ci
Copy link
Copy Markdown

riot-ci commented May 7, 2026

Murdock results

✔️ PASSED

8734119 sys/can/isotp: various style and robustness fixes

Success Failures Total Runtime
11108 0 11108 11m:39s

Artifacts

Copy link
Copy Markdown
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.

ae is either 0 or 1 -> size_t covers that
indices in size_t ✔️

framesize might be unchecked in
_isotp_rcv(...) 414
and
_isotp_rcv_cf(...) 357

Comment thread sys/can/isotp/isotp.c Outdated
Copy link
Copy Markdown
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.

looks right

did not test

@crasbe crasbe enabled auto-merge May 7, 2026 11:50
@crasbe crasbe added this pull request to the merge queue May 7, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 7, 2026
@crasbe crasbe added the State: needs rebase State: The codebase was changed since the creation of the PR, making a rebase necessary label May 7, 2026
@crasbe
Copy link
Copy Markdown
Contributor

crasbe commented May 7, 2026

Please rebase, now that #22251 is merged :)

@maribu
Copy link
Copy Markdown
Member Author

maribu commented May 7, 2026

Someone(TM) really should make the standalone static test run optional. Murdock does a static test run as well that is mandatory to pass anyway.

@crasbe
Copy link
Copy Markdown
Contributor

crasbe commented May 7, 2026

Someone(TM) really should make the standalone static test run optional. Murdock does a static test run as well that is mandatory to pass anyway.

But which ones are the "optional" ones that would not also fail on a merge to master?

Mostly buildsystem-sanity-check and perhaaaaaaps doccheck if someone is nice enough to fix issues in a different PR (like "undocumented blabla").

We could extend the static test script to accept some command line parameters to exclude buildsystem-sanity-check and run that as a separate step and allow that step to fail with continue-on-error https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idstepscontinue-on-error

Other than that I think the static test is nice to have.

- validate received length indicators against actual CAN frame size
- consistently use `size_t` instead of a mix `int`/`unsigned` for array
  indices
- make the file IWYU clean
- fix some style issues

Co-authored-by: Karl Fessel <karl.fessel@gmail.com>
@maribu
Copy link
Copy Markdown
Member Author

maribu commented May 7, 2026

I agree that it is nice to have the static test result early on. But making a failure a warning that maintainers may choose to ignore wouldn't be an issue, as the static-test is run a second time.

Another cause of static-tests failing is an update of codespell finding new typos. If there is still an old static-test result that passed from ages ago, everything is fine. But if you let the static-test run again, it will complain about typos already fixed in master.

The static-test run in Murdock will first rebase the PR on top of master. That way, it will only fail on issues that are freshly introduced by the PR.

@crasbe crasbe enabled auto-merge May 7, 2026 19:30
@crasbe
Copy link
Copy Markdown
Contributor

crasbe commented May 7, 2026

The static-test run in Murdock will first rebase the PR on top of master. That way, it will only fail on issues that are freshly introduced by the PR.

Okay but how about rebasing it in the workflow to the base branch of the PR? 🤔

@crasbe crasbe added this pull request to the merge queue May 7, 2026
@maribu
Copy link
Copy Markdown
Member Author

maribu commented May 7, 2026

Okay but how about rebasing it in the workflow to the base branch of the PR? 🤔

Yes, that be great.

Merged via the queue into RIOT-OS:master with commit d26e0ff May 7, 2026
25 checks passed
@maribu maribu deleted the sys/can/isotp branch May 8, 2026 04:16
@maribu
Copy link
Copy Markdown
Member Author

maribu commented May 8, 2026

Thx

@crasbe crasbe removed the State: needs rebase State: The codebase was changed since the creation of the PR, making a rebase necessary label May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR 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.

4 participants