VTV (see: https://gcc.gnu.org/wiki/vtv) is a hardening feature introduced in GCC 4.9.0 which might be usable for our Tor Browser builds for Linux and Windows as we are using GCC for (cross-)compiling. We should investigate that and fix possible roadblocks.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items
0
Link issues together to show that they're related.
Learn more.
Trac: Summary: Investigate Virtual Table Verification(VTV) hardening for Tor Browser on Windows to Investigate Virtual Table Verification (VTV) hardening for Tor Browser on Windows
They are currently compiled with "-fvtable-verify=std". "-fvtable-verify=preinit" does not work with ld but using gold seems to be fine. I'll add that piece in the next iteration of these builds. In order to avoid the browser exiting on VTV errors the compiler is built with -DVTV_NO_ABORT.
"
Okay. I tried to debug the VTV issues with Firefox in order to get enough information to file a Mozilla bug. Here is the short story: With the invaluable help of Caroline Tice (thanks again!) I managed to get/do the following:
to the .mozconfig file
3) Go to /dist/bin in your objdir and start gdb with
gdb firefox
NOTE: The GDB in Ubuntu Precise is buggy and won't help you (which took us quite a while to realize). Not sure which version is good, 7.7.1 worked for me at least.
4) Set a breakpoint
(gdb) b __vtv_verify_failFunction "__vtv_verify_fail" not defined.Make breakpoint pending on future shared library load? (y or [n]) yBreakpoint 1 (__vtv_verify_fail) pending.(gdb)
Run firefox
(gdb) run --help
Try to find out what's wrong and you'll get something like
(gdb) up#1 0x00007ffff7ff1f2c in __VLTVerifyVtablePointer ( set_handle_ptr=0x7ffff6bcd6e8 <_VTV<xpcIJSGetFactory>::__vtable_map>, vtable_ptr=0x7ffff68d06d0 <vtable for nsXPTCStubBase+16>) at ../../../libvtv/vtv_rts.cc:13511351 __vtv_verify_fail ((void **) handle_ptr, vtable_ptr);(gdb) x/x vtable_ptr0x7ffff68d06d0 <_ZTV14nsXPTCStubBase+16>: 0xf18eca8c(gdb) x/x set_handle_ptr0x7ffff6bcd6e8 <_ZN4_VTVI16xpcIJSGetFactoryE12__vtable_mapE>: 0x00000000
Make a backtrace which should give you something like
#0 0x00007ffff7ff0380 in __vtv_verify_fail(void**, void const*)@plt () from /home/gk/asan/gcc-4.9.0debug/usr/local/lib64/libvtv.so.0#1 0x00007ffff7ff1f2c in __VLTVerifyVtablePointer ( set_handle_ptr=0x7ffff58c2c50 <_VTV<xpcIJSGetFactory>::__vtable_map>, vtable_ptr=0x7ffff52fa890 <vtable for nsXPTCStubBase+16>) at ../../../libvtv/vtv_rts.cc:1351#2 0x00007fffeea019a6 in mozJSComponentLoader::ModuleEntry::GetFactory ( module=..., entry=...) at /home/gk/asan/mozilla-central/js/xpconnect/loader/mozJSComponentLoader.cpp:1440#3 0x00007fffee101e4d in nsFactoryEntry::GetFactory (this=0x7fffe5d77340) at /home/gk/asan/mozilla-central/xpcom/components/nsComponentManager.cpp:1786#4 0x00007fffee100362 in nsComponentManagerImpl::CreateInstanceByContractID ( this=0x7ffff6e9a360, aContractID=0x7fffe2dfe760 "@mozilla.org/browser/webide-clh;1", aDelegate=0x0, aIID=..., aResult=0x7fffffffcb20) at /home/gk/asan/mozilla-central/xpcom/components/nsComponentManager.cpp:1080#5 0x00007fffee100e46 in nsComponentManagerImpl::GetServiceByContractID ( this=0x7ffff6e9a360, aContractID=0x7fffe2dfe760 "@mozilla.org/browser/webide-clh;1", aIID=..., result=0x7fffffffcc58) at /home/gk/asan/mozilla-central/xpcom/components/nsComponentManager.cpp:1440#6 0x00007fffee1438e0 in CallGetService ( aContractID=0x7fffe2dfe760 "@mozilla.org/browser/webide-clh;1", aIID=..., aResult=0x7fffffffcc58) at /home/gk/asan/mozilla-central/xpcom/glue/nsComponentManagerUtils.cpp:69
Check what vtable and class were verified after exiting gdb and you'll get something like
c++filt _ZTV14nsXPTCStubBasevtable for nsXPTCStubBasec++filt _ZN4_VTVI16xpcIJSGetFactoryE12__vtable_mapE_VTV<xpcIJSGetFactory>::__vtable_map
Start glaring at mozJSComponentLoader.cpp and friends.
Trac: Summary: Investigate Virtual Table Verification (VTV) hardening for Tor Browser on Windows to Investigate Virtual Table Verification (VTV) hardening for Tor Browser on Linux and Windows Description: VTV (see: https://gcc.gnu.org/wiki/vtv) is a hardening feature introduced in GCC 4.9.0 which might be usable for our Tor Browser builds for Windows as we are using GCC for cross-compiling. We should investigate that and fix possible roadblocks.
to
VTV (see: https://gcc.gnu.org/wiki/vtv) is a hardening feature introduced in GCC 4.9.0 which might be usable for our Tor Browser builds for Linux and Windows as we are using GCC for (cross-)compiling. We should investigate that and fix possible roadblocks.
Another feature of GCC 4.9 to investigate is the 'final' optimization, and if this can be automatically applied to classes. 'final' is a security feature hiding inside an optimization: By optimizing out vtable calls you can make it harder to exploit UAFs.