Skip to content

Aslr - #48

Closed
jamill wants to merge 2 commits into
gitgitgadget:masterfrom
jamill:aslr
Closed

Aslr#48
jamill wants to merge 2 commits into
gitgitgadget:masterfrom
jamill:aslr

Conversation

@jamill

@jamill jamill commented Oct 15, 2018

Copy link
Copy Markdown

Port ASLR compile flags upstream

@jamill jamill mentioned this pull request Oct 15, 2018
35 tasks done
@dscho

dscho commented Oct 31, 2018

Copy link
Copy Markdown
Member

@jamill I bet the CI failure will be resolved by rebasing onto upstream's master.

Comment thread config.mak.uname Resolved
Comment thread config.mak.uname Resolved
@jamill

jamill commented Nov 6, 2018 •

Copy link
Copy Markdown
Author

/cc @jeffhostetler @dscho - I left some file level comments / questions.

This is the first step for enabling ASLR (Address Space Layout
Randomization) support. We want to enable ASLR for better protection
against exploiting security holes in Git.

The problem fixed by this commit is that `ld.exe` seems to be stripping
relocations which in turn will break ASLR support. We just make sure
it's not stripping the main executable entry.

Signed-off-by: İsmail Dönmez <ismail@i10z.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Enable DEP (Data Execution Prevention) and ASLR (Address Space Layout
Randomization) support. This applies to both 32bit and 64bit builds
and makes it substantially harder to exploit security holes in Git by
offering a much more unpredictable attack surface.

ASLR interferes with GDB's ability to set breakpoints. A similar issue
holds true when compiling with -O2 (in which case single-stepping is
messed up because GDB cannot map the code back to the original source
code properly). Therefore we simply enable ASLR only when an
optimization flag is present in the CFLAGS, using it as an indicator
that the developer does not want to debug in GDB anyway.

Signed-off-by: İsmail Dönmez <ismail@i10z.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants