Skip to content

[SECURITY] i2c: prevent RX FIFO buffer overflow - #84

Merged
kwd-doodling merged 1 commit into
intel:mainfrom
xiaolusu:i2c_rx
Sep 21, 2026
Merged

kwd-doodling merged 1 commit into
intel:mainfrom
xiaolusu:i2c_rx

Conversation

@xiaolusu

Copy link
Copy Markdown
Contributor

Validate the RX FIFO level against pending read commands and the remaining receive buffer before copying data. Abort inconsistent transfers to prevent out-of-bounds writes.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The new error path references nonexistent status fields and cannot compile.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Adds RX FIFO bounds validation to prevent out-of-bounds writes during I2C transfers.

Changes:

  • Validates FIFO data against pending commands and buffer capacity.
  • Aborts inconsistent transfers.
File Description
bsp_sedi/​drivers/​i2c/​sedi_i2c_dw_apb_200a.c Adds receive validation and error handling.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread bsp_sedi/drivers/i2c/sedi_i2c_dw_apb_200a.c Outdated
Validate the RX FIFO level against pending read commands and the remaining receive buffer before copying data.
Abort inconsistent transfers to prevent out-of-bounds writes.

Signed-off-by: Xiaolu Sun <xiaolu.sun@intel.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The checks prevent unsigned underflow and out-of-bounds writes while safely terminating inconsistent transfers.

Review effort: Balanced
Findings: None

Resolved since last review (1)

@kwd-doodling
kwd-doodling merged commit 884c7a7 into intel:main Sep 21, 2026
5 checks passed
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