New issue
Advanced search Search tips

Issue 840995 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug
Build-Toolchain


Sign in to add a comment

Build all packges in fuzzer builds with sanitizer flags

Project Member Reported by manojgupta@chromium.org, May 8 2018

Issue description

Currently we rely on use flags to pass the sanitizer compile flags for packages.
As a result, many packages specially upstream packages are not instrumented resulting in lower than desired instrumentation coverage. 

Investigate if sanitizer flags can be enabled unconditionally for target packages instead of a per package basis.
 
Thank you for filing this bug Manoj. 

To reiterate the idea discussed in the meeting: is it would be possible to build an entire fuzzer build with a special "compiler" that is really a wrapper around clang? The purpose of the wrapper is to pass the sanitizer flags we want to the actual clang.

This approach is similar to afl-gcc (https://github.com/mcarpenter/afl/blob/master/afl-gcc.c) which is probably the most popular method for building targets for coverage guided fuzzing.

Summary: Build all packges in fuzzer builds with sanitizer flags (was: Build all packges in fuzzer builds)
or just add them to our existing CFLAGS/CXXFLAGS variables in the profile.  no need for yet another wrapper.
It is also going to break the unit tests. Probably lets disable them for now in builder and see if they can be selectively enabled later on.
Labels: cros-fuzzer-fullsystem
Blockedon: 841512
+1 I don't think the unittests is an issue. We don't do this in chrome.
Blockedon: 841538
Blockedon: 841588
Blockedon: 841840
Blockedon: 841847
Blockedon: 841852
Blockedon: 841855
Blockedon: 841859
Blockedon: 841861
Blockedon: 841865
Blockedon: 841887
Blockedon: 841954
Project Member

Comment 20 by bugdroid1@chromium.org, May 10 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/bec012932b078920fdb16d2288ed9859f57bd4f4

commit bec012932b078920fdb16d2288ed9859f57bd4f4
Author: Manoj Gupta <manojgupta@google.com>
Date: Thu May 10 22:09:55 2018

profile.bashrc: Add helper function to filter sanitizers.

Some packages can't or shouldn't be built with sanitizer flags.
Add a helper function filter_sanitizers that can be called in
ebuilds to filter sanitizer flags.

BUG= chromium:840995 
TEST="-fsanitize=*" flags were filtered out by calling this in ebuild.

Change-Id: I2dc8c140e5b3ff1f25b4581aea604287aca8fe6d
Reviewed-on: https://chromium-review.googlesource.com/1052678
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Caroline Tice <cmtice@chromium.org>
Reviewed-by: Jonathan Metzman <metzman@chromium.org>

[modify] https://crrev.com/bec012932b078920fdb16d2288ed9859f57bd4f4/profiles/base/profile.bashrc

Blockedon: 842316
Blockedon: 842923
Blockedon: 843301
Project Member

Comment 24 by bugdroid1@chromium.org, May 16 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/board-overlays/+/c44090385694e44c6041f5397986ec2187f7329c

commit c44090385694e44c6041f5397986ec2187f7329c
Author: Manoj Gupta <manojgupta@google.com>
Date: Wed May 16 19:42:39 2018

fuzzing: Add sanitizer flags to {C,CXX,LD}FLAGS.

Add sanitizer flags to make.defaults.
This will force all packages to be built with libfuzzer + address
sanitizer.

BUG= chromium:840995 
TEST=Can succesfully run a fuzzer with the sysroot uploaded by tryjob.

Change-Id: I0733ddc51c2d2a513b67a0c21d1d728c5b6b2712
Reviewed-on: https://chromium-review.googlesource.com/1050914
Commit-Ready: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>

[modify] https://crrev.com/c44090385694e44c6041f5397986ec2187f7329c/overlay-amd64-generic/profiles/fuzzer/make.defaults

Status: Verified (was: Untriaged)

Sign in to add a comment