Skip to content

Conversation

@visitorckw
Copy link
Collaborator

@visitorckw visitorckw commented Dec 3, 2025

The opt_virtio_blk_img array can be overflowed if more than VBLK_DEV_MAX virtio-blk devices are specified using the -x option, as opt_virtio_blk_idx is incremented without bounds checking.

Add a check to ensure that opt_virtio_blk_idx does not exceed VBLK_DEV_MAX. If the limit is reached, log an error and exit.


Summary by cubic

Prevent heap buffer overflow when too many virtio-blk devices are passed via -x. Adds a bounds check on opt_virtio_blk_idx; if it reaches VBLK_DEV_MAX, log an error and exit.

Written for commit e11b229. Summary will update automatically on new commits.

The opt_virtio_blk_img array can be overflowed if more than
VBLK_DEV_MAX virtio-blk devices are specified using the -x option, as
opt_virtio_blk_idx is incremented without bounds checking.

Add a check to ensure that opt_virtio_blk_idx does not exceed
VBLK_DEV_MAX. If the limit is reached, log an error and exit.
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@jserv jserv merged commit 0358490 into sysprog21:master Dec 4, 2025
9 of 11 checks passed
@jserv
Copy link
Contributor

jserv commented Dec 4, 2025

Thank @visitorckw for contributing!

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.

2 participants