A cypherpunk (ticket:21617#comment:5) has reported that the tor.exe process in the Tor Expert Bundle on Windows has many Execute/Read/Write memory pages. I also observe the same thing for Tor Browser's tor.exe process. Also, there are many Execute/Copy on Write pages, which I suspect, after reading Microsoft documentation, are also effectively W^X violations.
In the bottom table of the VMMap window, examine the Protection column. Note many Execute/Read/Write and Execute/Copy on Write pages, all belonging to either tor.exe or DLLs bundled with tor.exe.
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.
We are not using rbm for the alphas yet. Thus, we'd need a Gitian patch. Yes, giving what amounts to a compiler change some testing in our nightly/alpha builds first sounds like a good idea.
Moreover, it seems we get 7c90d5921bd2cb678eec09d05b10ce6fd13463bc as well with this mingw-w64 bump which allows us to get rid of one of our tor-browser patches I think. We should test that, too, while we are at it.
Trac: Component: Core Tor/Tor to Applications/Tor Browser Status: needs_review to needs_revision Milestone: Tor: 0.3.2.x-final toN/A Keywords: TorBrowserTeam201707R deleted, TorBrowserTeam201707 added
As you "have stolen" this ticket from Core Tor :), it should be noted that the right fix for this bug is, as Jonathan Yong suggested, to "Use proper dllimport/dllexport in your code to avoid auto-imports." To check that you should compile Tor with --disable-auto-import for MinGW-w64.
Arthur could also make Firefox compile with --disable-auto-import (and also explain Mozillians why not to use -mnop-fun-dllimport) and get another one bounty ;)
In general, MinGW-w64 should remove --enable-auto-import by default, because future releases of Windows can enforce security, and such tricks will fail. Maybe, Arthur, might explain MinGW-w64 guys that they shouldn't "fix" incompatible programs (by default at least) with this dirty hack, which Arthur made much less dirty! (Ask for bounty from all MinGW-w64-based software vendors ;)
As you "have stolen" this ticket from Core Tor :), it should be noted that the right fix for this bug is, as Jonathan Yong suggested, to "Use proper dllimport/dllexport in your code to avoid auto-imports." To check that you should compile Tor with --disable-auto-import for MinGW-w64.
Thanks for the good suggestion. I tried it but I already run into an error when openssl is building. Namely:
libcrypto.a(cryptlib.o):cryptlib.c:(.text+0x9): undefined reference to `__stack_chk_guard'libcrypto.a(cryptlib.o):cryptlib.c:(.text+0x48): undefined reference to `__stack_chk_guard'libcrypto.a(cryptlib.o):cryptlib.c:(.text+0xd4): undefined reference to `__stack_chk_guard'libcrypto.a(cryptlib.o):cryptlib.c:(.text+0xe4): undefined reference to `__stack_chk_guard'libcrypto.a(cryptlib.o):cryptlib.c:(.text+0x106): undefined reference to `__stack_chk_guard'libcrypto.a(cryptlib.o):cryptlib.c:(.text+0x264): more undefined references to `__stack_chk_guard' follow/var/tmp/dist/mingw-w64/lib/gcc/i686-w64-mingw32/5.1.0/../../../../i686-w64-mingw32/bin/ld: libcrypto.a(cryptlib.o): bad reloc address 0x200 in section `.rdata'collect2: error: ld returned 1 exit statusmake[4]: *** [link_a.cygwin] Error 1
I did not investigate further, but my best guess is the -fstack-protector implementation (when used with mingw-w64) relies on auto-import. Looks like we would need an additional patch for gcc or mingw or someplace to fix this.
Arthur could also make Firefox compile with --disable-auto-import (and also explain Mozillians why not to use -mnop-fun-dllimport) and get another one bounty ;)
Good point. I have opened #22917 (moved) to investigate this further. In the meantime I think we should go ahead with using the bumped version of mingw-w64 because it is working at least for now.
In general, MinGW-w64 should remove --enable-auto-import by default, because future releases of Windows can enforce security, and such tricks will fail. Maybe, Arthur, might explain MinGW-w64 guys that they shouldn't "fix" incompatible programs (by default at least) with this dirty hack, which Arthur made much less dirty!
My dear cypherpunk, maybe you would like to start that debate on the mingw-w64 discussion page? :)
My dear cypherpunk, maybe you would like to start that debate on the mingw-w64 discussion page? :)
That debate has a very long history (see, e.g. https://sourceforge.net/p/mingw-w64/discussion/723797/thread/9e2995ab/). Don't you want to say some words to push the discussion forward? :)
We are not using rbm for the alphas yet. Thus, we'd need a Gitian patch. Yes, giving what amounts to a compiler change some testing in our nightly/alpha builds first sounds like a good idea.
Moreover, it seems we get 7c90d5921bd2cb678eec09d05b10ce6fd13463bc as well with this mingw-w64 bump which allows us to get rid of one of our tor-browser patches I think. We should test that, too, while we are at it.
Okay, I applied both patches (commit 2e5a0f5570f5b2ba0bf9d84cd74b6553407a0435 to tor-browser-52.2.0esr-7.5-1 and commit b42927a08821f1e1d46267156c369e3b45379758 to master). However, we still need to retain a small part of the Tor Browser patch due to https://bugzilla.mozilla.org/show_bug.cgi?id=1372959. I added that one to tor-browser-52.2.0esr-7.5-1 as well (commit 84d370aab03e45fbafef90b0fd99153e45a1b64a).
Trac: Resolution: N/Ato fixed Status: needs_review to closed