-
Notifications
You must be signed in to change notification settings - Fork 78
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
If load config size is larger than reported, overwrite #1050
base: master
Are you sure you want to change the base?
Conversation
bc1649f
to
fa57793
Compare
checksec.cpp
Outdated
std::cerr << "Warn: load config larger than reported by data directory entry," | ||
<< " overwriting" | ||
<< "\n"; | ||
memcpy(&loadConfig, loadConfigData.data(), loadConfig.Size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably need a bounds check on loadConfigData.data() + loadConfig.Size
, right?
LGTM otherwise!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think so, since the total data size is loadConfig.Size
, we just overwrite the data we already copies earlier, not add to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant for the PE container itself -- I could be wrong, but I think someone could modify a PE to set the load config's size to a size larger than the PE itself, meaning that loadConfigData.data() + loadConfig.Size
would point past the end of the PE in memory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see what you mean. Yeah, I'll add that check!
85c33c0
to
1a5a52b
Compare
1a5a52b
to
c986ff8
Compare
No description provided.