Skip to content

Conversation

@maxzhen
Copy link
Collaborator

@maxzhen maxzhen commented Dec 26, 2025

No description provided.

Signed-off-by: Max Zhen <max.zhen@amd.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a buffer overflow validation issue in the AMDXDNA driver's sync_bo ioctl handler. The original check was insufficient to prevent integer overflow when adding offset and size.

Key Changes:

  • Enhanced validation in amdxdna_drm_sync_bo_ioctl to check offset and size individually before checking their sum
  • Added guards against integer overflow in buffer bounds validation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings December 26, 2025 20:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if (gobj->size < args->offset + args->size) {
if (gobj->size < args->offset ||
gobj->size < args->size ||
args->offset > gobj->size - args->size) {
Copy link
Contributor

Choose a reason for hiding this comment

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

minor, just to keep this line consistent to the above two lines, maybe change it to gobj->size < args->offset + args->size

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is done to avoid overflow from args->offset + args->size. gobj->size - args->size is safe since line 1215 has done the check.

@maxzhen maxzhen merged commit 273a586 into amd:main Jan 2, 2026
1 check passed
@maxzhen maxzhen deleted the secfix branch January 2, 2026 17:23
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