-
Notifications
You must be signed in to change notification settings - Fork 18k
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
Conversation
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 |
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. |
Message from Hau Yang: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/286113. |
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
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 |
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. |
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. |
Message from Go Bot: Patch Set 3: Build is still in progress... 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. |
Message from Go Bot: Patch Set 3: TryBot-Result-1 1 of 21 TryBots failed: 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. |
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. |
Message from Hau Yang: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/286113. |
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. |
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. |
Message from Go Bot: Patch Set 3: Build is still in progress... 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. |
Message from Go Bot: Patch Set 3: TryBot-Result-1 1 of 21 TryBots failed: 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. |
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. |
Creating a new PE file with
NewFile()
in packagedebug/pe
wouldmeet out-of0memory if
NumberOfSymbols
field ofCOFFSymbol
structis a huge value.
In this PR, we check if
NumberOfSymbols
excesses the maximun size ofinput data. If so, a new error
"fail to read symbol table: NumberOfSymbols too large" is returned.
Fixes #43827