| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Sorry, something went wrong.
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 fix/virtio-input-offset-validation 分支,关联的 Pull Request 也会同步更新。 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
Sorry, something went wrong.
📌 Code Review Assignment🏷️ Tag: componentsReviewers: @Maihuanyi Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2026-09-23 09:31 CST)
📝 Review Instructions
|
Sorry, something went wrong.
Reject negative event offsets and compare against the remaining queue range using subtraction. Preserve the existing strict range convention and read/write return behavior for valid requests. Fixes RT-Thread#10379 and RT-Thread#10380
Name the queue bound and validate the offset before subtracting it. This keeps the accepted request range unchanged while following the order in which a reader checks an indexed copy.
| Back | FazBrowse Home | New Git URL |
拉取/合并请求描述:(PR description)
Legacy virtio-input read/write check pos + size before indexing the event array. Mixing a signed offset with an unsigned length allows a negative offset or an overflowing length to pass that check.
Reject negative and out-of-range offsets first, then compare the length with the remaining queue range using subtraction. Keep the existing strict range convention and return values; this change does not redefine the API's event-index/byte-count units.
Fixes #10379.
Fixes #10380.
Validation
GCC 16.1 tests compile the complete read/write bodies against repository virtio headers. Negative offsets, overflowing lengths, null buffers and boundary cases pass. Exhaustive small nonnegative inputs confirm that request acceptance is unchanged. A copy adapter detects invalid copies without executing them; the original code fails the regression cases.
Changed-line clang-format and git diff --check pass. No target BSP, QEMU or actual ISR/mutex scheduling test was run.
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following: