Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use SYS_PTRACE capability #212

Merged
merged 1 commit into from
Dec 21, 2016
Merged

use SYS_PTRACE capability #212

merged 1 commit into from
Dec 21, 2016

Conversation

caolanm
Copy link
Contributor

@caolanm caolanm commented Dec 21, 2016

I'm finding that with e.g.

python infra/helper.py build_fuzzers libpng

all builds fail for me with...

configure:3443: checking whether we are cross compiling
configure:3451: clang -o conftest -g -fsanitize=address -fsanitize-coverage=edge,indirect-calls,8bit-counters conftest.c >&5
configure:3455: $? = 0
configure:3462: ./conftest
==1014==LeakSanitizer has encountered a fatal error.
==1014==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1
==1014==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)
configure:3466: $? = 1
configure:3473: error: in `/src/libpng':
configure:3475: error: cannot run C compiled programs.

with the defaults of...
CC=clang
CXX=clang++
CFLAGS=-g -fsanitize=address -fsanitize-coverage=edge,indirect-calls,8bit-counters
CXXFLAGS=-g -fsanitize=address -fsanitize-coverage=edge,indirect-calls,8bit-counters -stdlib=libc++

but adding --cap-add SYS_PTRACE makes it work

I'm finding that with e.g.

python infra/helper.py build_fuzzers libpng

all builds fail for me with...

configure:3443: checking whether we are cross compiling
configure:3451: clang -o conftest -g -fsanitize=address -fsanitize-coverage=edge,indirect-calls,8bit-counters   conftest.c  >&5
configure:3455: $? = 0
configure:3462: ./conftest
==1014==LeakSanitizer has encountered a fatal error.
==1014==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1
==1014==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)
configure:3466: $? = 1
configure:3473: error: in `/src/libpng':
configure:3475: error: cannot run C compiled programs.

with the defaults of...
CC=clang
CXX=clang++
CFLAGS=-g -fsanitize=address -fsanitize-coverage=edge,indirect-calls,8bit-counters
CXXFLAGS=-g -fsanitize=address -fsanitize-coverage=edge,indirect-calls,8bit-counters -stdlib=libc++

but adding --cap-add SYS_PTRACE makes it work
@inferno-chromium
Copy link
Collaborator

This could be fixed by #211. And also i don't see it locally (maybe rooted docker). I will let @mikea to review this.

@Dor1s
Copy link
Contributor

Dor1s commented Dec 21, 2016

+1, doesn't reproduce on my machine.
@caolanm, does python infra/helper.py build_image libpng work fine for you?

@caolanm
Copy link
Contributor Author

caolanm commented Dec 21, 2016

@Dor1s yes, build_image libpng works fine, failure is just on running the first thing built with -fsanitize (docker is being run by root)

@Dor1s
Copy link
Contributor

Dor1s commented Dec 21, 2016

Thanks for clarification, @caolanm. I think your PR is good, since we add --cap-add SYS_PTRACE in

def dockerRunOptions = "--user $dockerUid --cap-add SYS_PTRACE"
, but let's wait for @mikea for the final judgement :)

@mikea mikea merged commit b57371a into google:master Dec 21, 2016
@caolanm caolanm deleted the add_sys_ptrace branch December 21, 2016 21:16
DavidKorczynski pushed a commit that referenced this pull request Jul 9, 2024
DavidKorczynski pushed a commit that referenced this pull request Jul 9, 2024
Similar to #212 but for local experiments.
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.

4 participants