Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Provide a .so that overrides malloc/free with GWP-ASAN #43142

Open Quuxplusone opened 4 years ago

Quuxplusone commented 4 years ago
Bugzilla Link PR44172
Status NEW
Importance P enhancement
Reported by Alex Gaynor (alex.gaynor@gmail.com)
Reported on 2019-11-28 08:16:41 -0800
Last modified on 2019-12-10 14:45:10 -0800
Version unspecified
Hardware PC All
CC llvm-bugs@lists.llvm.org, mitchphillips@outlook.com
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also

It'd be very useful if GWP-ASAN included a .so that could trivially be LD_PRELOAD'd to override malloc/free to use GWP-ASAN + fallback to libc's malloc.

This would specifically make using GWP-ASAN in contexts such as server-software, where the person doing the deployment uses OS provided libraries such as OpenSSL or binaries like Python, and simply wants to easily apply GWP-ASAN across their fleet.

Quuxplusone commented 4 years ago

I agree - I think it's a worthwhile addition to have some c/c++ malloc wrappers and distribute a gwp_asan.so.

There is some increased performance overhead from interposing the symbols like this, we require a dlopen(RTLD_NEXT) on first call to malloc/free/etc., and indirect overhead from there, but that may be acceptable to users.

I can't promise anything at this stage unfortunately, but will definitely bear this in mind.

Quuxplusone commented 4 years ago

If you'd be interested in contributing by the way, more than happy to help with reviews :)

Quuxplusone commented 4 years ago

I'm unlikely to have the time for this in the short term -- for now, I'm just using Scudo's .so for this :-) I do think having a just-GWP-ASAN .so would be valuable though.