Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bound on memcpy loop in thumb,arm,aarch64 #2552

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

themaks
Copy link

@themaks themaks commented Feb 27, 2025

Hello,

There was a +10 years-old out-of-bound error in the memcpy implementation of shellcraft for thumb, arm and aarch64: the loop always copied one byte more than instructed in n.

By the way, there also is a problem when we supply an n in [2**31;2**32-1] (since the comparison is signed), and also when n==0 (one byte is copied nonetheless), but I guess we can leave those bugs for the sake of shellcode's simplicity 🙃

Cheers

@RocketMaDev
Copy link
Contributor

Since n==0, could we return an empty string? As for "n in [2**31;2**32-1]", I guess noboby will copy that much bytes. And you could update the CHANGELOG if you would like.

@peace-maker
Copy link
Member

Thank you! Nice catch. Can you rebase and target the stable branch instead please? Let me know if you need assistance with git.

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.

3 participants