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

Fix bad iovec length check #972

Merged
merged 11 commits into from
Jun 27, 2024
Merged

Conversation

grcevski
Copy link
Contributor

In my last PR I noticed an error for which I can't seem to write a test. The length I was checking was overwritten and it works for our cases, but it should've been the max_length clamped to the IO_VEC_MAX_LEN.

@grcevski grcevski requested review from mariomac and marctc as code owners June 27, 2024 00:17
@@ -229,9 +229,8 @@ static __always_inline int read_msghdr_buf(struct msghdr *msg, u8* buf, int max_
continue;
}

u32 l = vec.iov_len;
Copy link
Contributor Author

@grcevski grcevski Jun 27, 2024

Choose a reason for hiding this comment

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

This local was overwriting the real 'l' which we check for on line 238.

@codecov-commenter
Copy link

codecov-commenter commented Jun 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.51%. Comparing base (512e9d0) to head (cddbc68).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #972      +/-   ##
==========================================
- Coverage   80.56%   80.51%   -0.06%     
==========================================
  Files         134      134              
  Lines       10591    10591              
==========================================
- Hits         8533     8527       -6     
- Misses       1557     1560       +3     
- Partials      501      504       +3     
Flag Coverage Δ
integration-test 55.69% <ø> (-0.03%) ⬇️
k8s-integration-test 58.91% <ø> (-0.09%) ⬇️
oats-test 36.11% <ø> (+0.03%) ⬆️
unittests 50.59% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@mariomac mariomac left a comment

Choose a reason for hiding this comment

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

good catch!

@mariomac mariomac merged commit 17203ee into grafana:main Jun 27, 2024
6 checks passed
@grcevski grcevski deleted the fix_bad_iovec_len_check branch June 27, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants