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

demangler_gnu crashes with BAD_ACCESS in d_unqualified_name function #1451

Closed
MarcSchoenefeld opened this issue Jan 19, 2020 · 2 comments
Closed
Assignees
Labels
Feature: Demangler Type: Bug Something isn't working
Milestone

Comments

@MarcSchoenefeld
Copy link

Describe the bug

There is a memory access violation (BAD_ACCESS) in the d_unqualified_name function [1] of demangler_gnu, as demonstrated with the string "_ZN11951592242730AnimationOverlayHandlerImplD18446744073709551616Ev" . This leads to a segmentation fault when launching the demangler_gnu process.

[1] 

d_unqualified_name (struct d_info *di)

To Reproduce
lldb ./GPL/DemanglerGnu/os/osx64/demangler_gnu _ZN11951592242730AnimationOverlayHandlerImplD18446744073709551616Ev

(lldb) target create "./GPL/DemanglerGnu/os/osx64/demangler_gnu"
Current executable set to './GPL/DemanglerGnu/os/osx64/demangler_gnu' (x86_64).
(lldb) settings set -- target.run-args "_ZN11951592242730AnimationOverlayHandlerImplD18446744073709551616Ev"
(lldb) r
Process 46162 launched: '/Users/marc/Downloads/ghidra_9.1.1_PUBLIC/GPL/DemanglerGnu/os/osx64/demangler_gnu' (x86_64)
Process 46162 stopped

Expected behavior
No crash, return proper error return code.

Environment (please complete the following information):

  • OS: [e.g. macOS 10.14.6]
  • Java Version: [13.0.2]
  • Ghidra Version: [ 9.1.1]

Additional context
In the long run the Ghidra default demangler could be implemented in a language which does not allow memory faults when using attacker created mangled symbols.

@astrelsky
Copy link
Contributor

Related to #1195

The gnu demangler is a modifier version of well the gnu demangler. The issue may have existed within libiberty at some point. It may be solvable looking through the commit history in gcc.

@ryanmkurtz ryanmkurtz added Feature: Demangler Type: Bug Something isn't working labels Jan 21, 2020
@dragonmacher
Copy link
Collaborator

Our version of the gnu demangler is quite old, probably almost 10 years at this point. We intend to update it, but have not yet done so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Demangler Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants