Skip to content

debug/pe: fix OOM caused by huge NumberOfSymbols #43879

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

Closed
wants to merge 1 commit into from

Conversation

howjmay
Copy link
Contributor

@howjmay howjmay commented Jan 24, 2021

Creating a new PE file with NewFile() in package debug/pe would
meet out-of0memory if NumberOfSymbols field of COFFSymbol struct
is a huge value.

In this PR, we check if NumberOfSymbols excesses the maximun size of
input data. If so, a new error
"fail to read symbol table: NumberOfSymbols too large" is returned.

Fixes #43827

@google-cla google-cla bot added the cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change. label Jan 24, 2021
@gopherbot
Copy link
Contributor

This PR (HEAD: 9b26dcb) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/286113 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Keith Randall:

Patch Set 1: Code-Review-1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/286113.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Hau Yang:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/286113.
After addressing review feedback, remember to publish your drafts!

Creating a new PE file with `NewFile()` in  package `debug/pe` would
meet out-of0memory if `NumberOfSymbols` field of `COFFSymbol` struct
is a huge value.

In this PR, we check if `NumberOfSymbols` excesses the maximun size of
input data. If so, a new error
"fail to read symbol table: NumberOfSymbols too large" is returned.

Fixes golang#43827
@gopherbot
Copy link
Contributor

This PR (HEAD: f3c3787) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/286113 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Keith Randall:

Patch Set 3: Run-TryBot+1 Code-Review+2

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/286113.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 3:

TryBots beginning. Status page: https://farmer.golang.org/try?commit=fa58904b


Please don’t reply on this GitHub thread. Visit golang.org/cl/286113.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 3:

Build is still in progress...
This change failed on windows-amd64-2016:
See https://storage.googleapis.com/go-build-log/fa58904b/windows-amd64-2016_d3ab010b.log

Other builds still in progress; subsequent failure notices suppressed until final report. Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed.


Please don’t reply on this GitHub thread. Visit golang.org/cl/286113.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 3: TryBot-Result-1

1 of 21 TryBots failed:
Failed on windows-amd64-2016: https://storage.googleapis.com/go-build-log/fa58904b/windows-amd64-2016_d3ab010b.log

Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed.


Please don’t reply on this GitHub thread. Visit golang.org/cl/286113.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Alex Brainman:

Patch Set 3: Code-Review-2

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/286113.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Hau Yang:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/286113.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Keith Randall:

Patch Set 3: Run-TryBot+1 Code-Review+2

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/286113.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 3:

TryBots beginning. Status page: https://farmer.golang.org/try?commit=fa58904b


Please don’t reply on this GitHub thread. Visit golang.org/cl/286113.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 3:

Build is still in progress...
This change failed on windows-amd64-2016:
See https://storage.googleapis.com/go-build-log/fa58904b/windows-amd64-2016_d3ab010b.log

Other builds still in progress; subsequent failure notices suppressed until final report. Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed.


Please don’t reply on this GitHub thread. Visit golang.org/cl/286113.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 3: TryBot-Result-1

1 of 21 TryBots failed:
Failed on windows-amd64-2016: https://storage.googleapis.com/go-build-log/fa58904b/windows-amd64-2016_d3ab010b.log

Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed.


Please don’t reply on this GitHub thread. Visit golang.org/cl/286113.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Alex Brainman:

Patch Set 3: Code-Review-2

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/286113.
After addressing review feedback, remember to publish your drafts!

@seankhliao seankhliao closed this Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

debug/pe: fatal error: runtime: out of memory on NewFile
3 participants