Opened 4 years ago

Closed 3 years ago

#17406 closed enhancement (fixed)

Include SelfRando patches into our hardened builds

Reported by: gk Owned by: gk
Priority: Medium Milestone:
Component: Applications/Tor Browser Version:
Severity: Normal Keywords: tbb-security, GeorgKoppen201605, tbb-hardened, TorBrowserTeam201605
Cc: mcs, boklm, arthuredelstein Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description (last modified by gk)

The folks behind the Readactor and Readactor++ paper have developed patches for better resistance against code reuse attacks. This ticket tracks their inclusion both into tor-browser and tor-browser-bundle.

Child Tickets

Change History (16)

comment:1 Changed 4 years ago by gk

Description: modified (diff)

comment:2 Changed 4 years ago by gk

Keywords: tbb-hardening added

comment:3 Changed 4 years ago by gk

Keywords: TorBrowserTeam201511 added; TorBrowserTeam201510 removed

comment:4 Changed 4 years ago by gk

Keywords: GeorgKoppen201511 added

comment:5 Changed 4 years ago by gk

Keywords: tbb-hardened added; tbb-hardening removed

comment:6 Changed 4 years ago by mikeperry

Keywords: TorBrowserTeam201512 added; TorBrowserTeam201511 removed

comment:7 Changed 4 years ago by mcs

Cc: mcs added

comment:8 Changed 4 years ago by gk

Cc: boklm added
Keywords: GeorgKoppen201605 TorBrowserTeam201605R added; GeorgKoppen201511 TorBrowserTeam201512 removed
Status: newneeds_review

bug_17406_v2 (https://gitweb.torproject.org/user/gk/tor-browser-bundle.git/commit/?h=bug_17406_v2) in my public tor-browser-bundle repo has a patch for testing SelfRando in our hardened nightly builds. This is nothing for the hardened alpha series yet. Please review.

Last edited 4 years ago by gk (previous) (diff)

comment:9 Changed 4 years ago by boklm

Status: needs_reviewneeds_revision

I didn't try to build it yet (I started one but it's not finished yet), but it looks good.

One small thing, in RelativeLink/start-tor-browser, with this line:

LD_LIBRARY_PATH="${HOME}/TorBrowser/Tor/:${LD_LIBRARY_PATH}"

I think that when $LD_LIBRARY_PATH is undefined, it is similar to adding . to the library path, which might cause some problems.

comment:10 Changed 4 years ago by boklm

My build failed with a Cannot allocate memory error:

+ /home/debian/install/binutils/bin/ld.gold --section-start .dynsym=0x800 -dn /home/debian/install/self-rando/randoentry.o /home/debian/install/self-rando/sr_begin.o /home/debian/install/self-rando/libselfrando.a /home/debian/install/self-rando/sr_end.o -dy -plugin /home/debian/install/gcc/libexec/gcc/x86_64-unknown-linux-gnu/5.2.0/liblto_plugin.so -plugin-opt=/home/debian/install/gcc/libexec/gcc/x86_64-unknown-linux-gnu/5.2.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccpIArYG.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s --eh-frame-hdr -m elf_x86_64 -shared -o libxul.so /usr/lib/x86_64-linux-gnu/crti.o /home/debian/install/gcc/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/crtbeginS.o -L/home/debian/build/selfrando/Tools/TorBrowser/tc-wrapper -L/home/debian/install/gcc/lib/gcc/x86_64-unknown-linux-gnu/5.2.0 -L/home/debian/install/gcc/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../lib64 -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/home/debian/install/gcc/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../.. -lasan -h libxul.so /home/debian/build/tor-browser/obj-x86_64-unknown-linux-gnu/toolkit/library/tmpDCjBHo.list -lpthread -ldl -z noexecstack -z text --build-id -Bsymbolic -version-script symverscript -rpath-link /home/debian/build/tor-browser/obj-x86_64-unknown-linux-gnu/dist/bin -rpath-link NONE/lib ../../intl/icu/target/lib/libicui18n.a ../../intl/icu/target/lib/libicuuc.a ../../intl/icu/target/lib/libicudata.a ../../security/nss/lib/crmf/libcrmf.a ../../js/src/libjs_static.a ../../security/nss/lib/nss/libnss3.so ../../security/nss/lib/smime/libsmime3.so ../../security/nss/lib/ssl/libssl3.so ../../security/nss/lib/util/libnssutil3.so ../../config/external/sqlite/libmozsqlite3.so ../../nsprpub/lib/ds/libplds4.so ../../nsprpub/lib/libc/src/libplc4.so ../../nsprpub/pr/src/libnspr4.so ../../config/external/lgpllibs/liblgpllibs.so -ldl -lfreetype -lfontconfig -lrt -lXrender -lasound -ldbus-glib-1 -ldbus-1 -lgobject-2.0 -lglib-2.0 -lgtk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk-x11-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lpango-1.0 -lcairo -lX11 -lXext -lXt -lgthread-2.0 -lstdc++ -lm -lgcc_s -lc -lgcc_s /home/debian/install/gcc/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/crtendS.o /usr/lib/x86_64-linux-gnu/crtn.o --build-id=none -Map libxul.so.map ./padding.AF50QyuurRhLB4T.o
+ /home/debian/install/self-rando/SymProc libxul.so libxul.so.map -ffunction-sections
Can't start ar: Cannot allocate memory
Can't extract file /usr/lib/x86_64-linux-gnu/libpthread_nonshared.a(pthread_atfork.oS) tmpfile: /tmp/archived_file_Bm5hxW.o
collect2: error: ld returned 15 exit status
make[5]: *** [libxul.so] Error 1

comment:11 Changed 4 years ago by arthuredelstein

Cc: arthuredelstein added

comment:12 Changed 4 years ago by boklm

An export VM_MEMORY=8000 fixed the "Cannot allocate memory" error.

comment:13 in reply to:  9 Changed 4 years ago by gk

Status: needs_revisionneeds_review

Replying to boklm:

I didn't try to build it yet (I started one but it's not finished yet), but it looks good.

One small thing, in RelativeLink/start-tor-browser, with this line:

LD_LIBRARY_PATH="${HOME}/TorBrowser/Tor/:${LD_LIBRARY_PATH}"

I think that when $LD_LIBRARY_PATH is undefined, it is similar to adding . to the library path, which might cause some problems.

Yes, and I think we want to make sure that Tor Browser is only starting with the LD_LIBRARY_PATH we intended. Thus, I removed :${LD_LIBRARY_PATH}. bug_17406_v3 (https://gitweb.torproject.org/user/gk/tor-browser-bundle.git/commit/?h=bug_17406_v3) contains this and a small comment fixup.

comment:14 Changed 4 years ago by boklm

Ok, this looks good. Should we also change the default value for VM_MEMORY?

comment:15 Changed 4 years ago by gk

Keywords: TorBrowserTeam201605 added; TorBrowserTeam201605R removed
Status: needs_reviewassigned

Applied to master (commit 138470ca7ce810f62761af8c3989654ec4a611fa) with VM_MEMORY set to 6000.

comment:16 Changed 3 years ago by gk

Resolution: fixed
Status: assignedclosed

This is fixed in 6.5a2-hardened.

Note: See TracTickets for help on using tickets.