in_collectd: validate value part length before reading count#11951
in_collectd: validate value part length before reading count#11951saddamr3e wants to merge 1 commit into
Conversation
Signed-off-by: saddamr3e <saddamr3e@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA defensive bounds check is added in ChangesBounds check for PART_VALUE count field
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
size < sizeof(uint64_t)in netprot_to_msgpack(); the value part had no equivalent.Added the matching length check before reading the count.
Testing
Config used to reach the parser:
Trigger: a collectd UDP datagram ending with a PART_VALUE part of declared length 4 (
00 06 00 04), preceded by any PART_TYPE part. Exercising netprot_to_msgpack() on a buffer sized to the datagram under AddressSanitizer:Before:
After: the short value part is rejected with
data truncatedand the read stays in bounds.ok-package-testlabelDocumentation
Backporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.
Summary by CodeRabbit