Repository navigation
Fix stack overwrite in evdev mouse capability query - #16
Merged
Merged
Conversation
EVIOCGBIT_REL requests eight output bytes. Reserve all eight so the kernel cannot overwrite adjacent stack memory during mouse discovery.
Owner
|
@atlury Thanks for the contribution this will be in the next release soon. |
Author
|
You are welcome, i was just testing it during a routine linux os work with yserver (xserver in rust) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mouse discovery passes a two-byte buffer to EVIOCGBIT_REL (0x80084522), which encodes an eight-byte output size. On x86_64 Linux the ioctl can overwrite adjacent stack memory; starting framebuffer mode in a QEMU VM reproduced a segmentation fault. Allocate the full requested eight bytes.
Validation: all 51 upstream tests passed with
cargo test --locked --no-default-features --features framebuffer-backend. The same correction was backported to a packaged 1.5.2 build and tested on x86_64 Linux 6.19.9: framebuffer startup and keyboard input inside a terminal window both passed.