This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RFC: libiberty PATCH to disable demangling of ancient mangling schemes
On Thu, Dec 6, 2018 at 11:14 AM Jason Merrill <jason@redhat.com> wrote:
>
> Looks good to me. Independently, do you see a reason not to disable the
> old demangler entirely?
Like so. Does anyone object to this? These mangling schemes haven't
been relevant in decades.
commit 175323701ad923aa47f25e1e37fa1f3c487dc5ea
Author: Jason Merrill <jason@redhat.com>
Date: Tue Nov 20 01:17:48 2018 -0500
* cplus-dem.c (cplus_demangle): Turn off the old demangler.
diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
index 4f29d54d089..8ee23b2fe71 100644
--- a/libiberty/cplus-dem.c
+++ b/libiberty/cplus-dem.c
@@ -267,6 +267,7 @@ const struct demangler_engine libiberty_demanglers[] =
"Automatic selection based on executable"
}
,
+#ifdef OLD_DEMANGLERS
{
GNU_DEMANGLING_STYLE_STRING,
gnu_demangling,
@@ -297,10 +298,11 @@ const struct demangler_engine libiberty_demanglers[] =
"EDG style demangling"
}
,
+#endif
{
GNU_V3_DEMANGLING_STYLE_STRING,
gnu_v3_demangling,
- "GNU (g++) V3 ABI-style demangling"
+ "GNU (g++) V3 (Itanium C++ ABI) style demangling"
}
,
{
@@ -915,8 +917,12 @@ cplus_demangle (const char *mangled, int options)
return ret;
}
+#if OLD_DEMANGLERS
+ /* People have been busily breaking the old demangler with fuzzers
+ (CVE-2018-12641 etc), so let's turn it off. */
ret = internal_cplus_demangle (work, mangled);
squangle_mop_up (work);
+#endif
return (ret);
}