Re: Add support to trace comparison instructions and switch statements

2017-09-19 Thread Tamar Christina
ct: Re: Add support to trace comparison instructions and switch statements On 09/19/2017 03:14 PM, Tamar Christina wrote: > it's fine at O1, O2 and O3 though. Should the test be running for O0? It's a known issue: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82183 Martin

Re: Add support to trace comparison instructions and switch statements

2017-09-19 Thread Martin Liška
On 09/19/2017 03:14 PM, Tamar Christina wrote: > it's fine at O1, O2 and O3 though. Should the test be running for O0? It's a known issue: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82183 Martin

Re: Add support to trace comparison instructions and switch statements

2017-09-19 Thread Tamar Christina
ny via gcc-patches <gcc-patches@gcc.gnu.org> Sent: Tuesday, September 12, 2017 5:35 PM To: Dmitry Vyukov Cc: 吴潍浠(此彼); Jakub Jelinek; gcc-patches; Jeff Law; wishwu007; Alexander Potapenko; andreyknvl Subject: Re: Add support to trace comparison instructions and switch statements On Tue, Se

Re: Add support to trace comparison instructions and switch statements

2017-09-12 Thread Kostya Serebryany via gcc-patches
t;> From:Jakub Jelinek <ja...@redhat.com> >> Time:2017 Sep 6 (Wed) 22:37 >> To:Wish Wu <weixi@antfin.com> >> Cc:Dmitry Vyukov <dvyu...@google.com>; gcc-patches >> <gcc-patches@gcc.gnu.org>; Jeff Law <l...@redhat.com>; wishwu007 >> <wish

Re: Add support to trace comparison instructions and switch statements

2017-09-12 Thread Dmitry Vyukov via gcc-patches
-- >> From:Jakub Jelinek <ja...@redhat.com> >> Time:2017 Sep 6 (Wed) 22:37 >> To:Wish Wu <weixi....@antfin.com> >> Cc:Dmitry Vyukov <dvyu...@google.com>; gcc-patches >> <gcc-patches@gcc.gnu.o

Re: Add support to trace comparison instructions and switch statements

2017-09-12 Thread Dmitry Vyukov via gcc-patches
u <weixi@antfin.com> > Cc:Dmitry Vyukov <dvyu...@google.com>; gcc-patches <gcc-patches@gcc.gnu.org>; > Jeff Law <l...@redhat.com>; wishwu007 <wishwu...@gmail.com> > Subject:Re: Add support to trace comparison instructions and switch statements > >

Re: Add support to trace comparison instructions and switch statements

2017-09-08 Thread Rainer Orth
Hi David, > On Thu, Sep 7, 2017 at 6:57 PM, Rainer Orth > wrote: >> Jakub Jelinek writes: >> >>> On Wed, Sep 06, 2017 at 10:08:01PM +0200, David Edelsohn wrote: This change broke bootstrap on AIX because sancov.c now references a macro

Re: Add support to trace comparison instructions and switch statements

2017-09-07 Thread David Edelsohn
On Thu, Sep 7, 2017 at 6:57 PM, Rainer Orth wrote: > Jakub Jelinek writes: > >> On Wed, Sep 06, 2017 at 10:08:01PM +0200, David Edelsohn wrote: >>> This change broke bootstrap on AIX because sancov.c now references a >>> macro that is defined as

Re: Add support to trace comparison instructions and switch statements

2017-09-07 Thread Rainer Orth
Jakub Jelinek writes: > On Wed, Sep 06, 2017 at 10:08:01PM +0200, David Edelsohn wrote: >> This change broke bootstrap on AIX because sancov.c now references a >> macro that is defined as a function on AIX. sancov.c needs to include >> tm_p.h to pull in the target-dependent

Re: Add support to trace comparison instructions and switch statements

2017-09-07 Thread 吴潍浠(此彼)
- From:Jakub Jelinek <ja...@redhat.com> Time:2017 Sep 6 (Wed) 22:37 To:Wish Wu <weixi@antfin.com> Cc:Dmitry Vyukov <dvyu...@google.com>; gcc-patches <gcc-patches@gcc.gnu.org>; Jeff Law <l...@redhat.com>; wishwu007 <wishwu...@gmail.com> Subject:Re: Add suppor

Re: Add support to trace comparison instructions and switch statements

2017-09-06 Thread Jakub Jelinek
On Wed, Sep 06, 2017 at 10:08:01PM +0200, David Edelsohn wrote: > This change broke bootstrap on AIX because sancov.c now references a > macro that is defined as a function on AIX. sancov.c needs to include > tm_p.h to pull in the target-dependent prototypes. The following > patch works for me.

Re: Add support to trace comparison instructions and switch statements

2017-09-06 Thread David Edelsohn
This change broke bootstrap on AIX because sancov.c now references a macro that is defined as a function on AIX. sancov.c needs to include tm_p.h to pull in the target-dependent prototypes. The following patch works for me. Is this okay? * sancov.c: Include tm_p.h. Index: sancov.c

Re: Add support to trace comparison instructions and switch statements

2017-09-06 Thread Jakub Jelinek
On Wed, Sep 06, 2017 at 04:37:18PM +0200, Jakub Jelinek wrote: > Ok. Please make sure those entrypoints make it into the various example > __sanitier_cov_trace* fuzzer implementations though, so that people using > -fsanitize-coverage=trace-cmp in GCC will not need to hack stuff themselves. > At

Re: Add support to trace comparison instructions and switch statements

2017-09-06 Thread Jakub Jelinek
On Wed, Sep 06, 2017 at 07:47:29PM +0800, 吴潍浠(此彼) wrote: > Hi Jakub > I compiled libjpeg-turbo and libdng_sdk with options "-g -O3 -Wall > -fsanitize-coverage=trace-pc,trace-cmp -fsanitize=address". > And run my fuzzer with pc and cmp feedbacks for hours. It works fine. > About

Re: Add support to trace comparison instructions and switch statements

2017-09-06 Thread 吴潍浠(此彼)
le.com>; gcc-patches <gcc-patches@gcc.gnu.org>; Jeff Law <l...@redhat.com>; wishwu007 <wishwu...@gmail.com> Subject:Re: Add support to trace comparison instructions and switch statements On Tue, Sep 05, 2017 at 09:03:52PM +0800, 吴潍浠(此彼) wrote: > Attachment is my updated path

Re: Add support to trace comparison instructions and switch statements

2017-09-05 Thread Jakub Jelinek
On Tue, Sep 05, 2017 at 09:03:52PM +0800, 吴潍浠(此彼) wrote: > Attachment is my updated path. > The implementation of parse_sanitizer_options is not elegance enough. Mixing > handling flags of fsanitize is easy to make mistakes. To avoid too many further iterations, I took the liberty to tweak your

Re: Add support to trace comparison instructions and switch statements

2017-09-05 Thread 吴潍浠(此彼)
atches@gcc.gnu.org>; Jeff Law <l...@redhat.com>; wishwu007 <wishwu...@gmail.com> Subject:Re: Add support to trace comparison instructions and switch statements On Mon, Sep 04, 2017 at 09:36:40PM +0800, 吴潍浠(此彼) wrote: > gcc/ChangeLog:

Re: Add support to trace comparison instructions and switch statements

2017-09-04 Thread Jakub Jelinek
On Mon, Sep 04, 2017 at 09:36:40PM +0800, 吴潍浠(此彼) wrote: > gcc/ChangeLog: > > 2017-09-04 Wish Wu > > * asan.c (initialize_sanitizer_builtins): > *

Re: Add support to trace comparison instructions and switch statements

2017-09-04 Thread 吴潍浠(此彼)
.com> Cc:gcc <g...@gcc.gnu.org>; gcc-patches <gcc-patches@gcc.gnu.org>; Jeff Law <l...@redhat.com>; wishwu007 <wishwu...@gmail.com> Subject:Re: Add support to trace comparison instructions and switch statements Hi I updated the patc

Re: Add support to trace comparison instructions and switch statements

2017-09-04 Thread 吴潍浠(此彼)
atches <gcc-patches@gcc.gnu.org>; Jeff Law <l...@redhat.com>; wishwu007 <wishwu...@gmail.com> Subject:Re: Add support to trace comparison instructions and switch statements On Sun, Sep 3, 2017 at 12:38 PM, 吴潍浠(此彼) <weixi@antfin.com> wrote: > Hi > I will upda

Re: Add support to trace comparison instructions and switch statements

2017-09-03 Thread Dmitry Vyukov via gcc-patches
patches > <gcc-patches@gcc.gnu.org>; Jeff Law <l...@redhat.com>; wishwu007 > <wishwu...@gmail.com> > Subject:Re: Add support to trace comparison instructions and switch statements > > > On Sun, Sep 3, 2017 at 12:19 PM, Dmitry Vyukov <dvyu...@google.com> wr

Re: Add support to trace comparison instructions and switch statements

2017-09-03 Thread 吴潍浠(此彼)
ek <ja...@redhat.com> Cc:Wish Wu <weixi@antfin.com>; gcc <g...@gcc.gnu.org>; gcc-patches <gcc-patches@gcc.gnu.org>; Jeff Law <l...@redhat.com>; wishwu007 <wishwu...@gmail.com> Subject:Re: Add support to trace comparison instructions and switch statements On Sun, Se

Re: Add support to trace comparison instructions and switch statements

2017-09-03 Thread Dmitry Vyukov via gcc-patches
On Sun, Sep 3, 2017 at 12:19 PM, Dmitry Vyukov wrote: > On Sun, Sep 3, 2017 at 12:01 PM, Jakub Jelinek wrote: >> On Sun, Sep 03, 2017 at 10:50:16AM +0200, Dmitry Vyukov wrote: >>> What we instrument in LLVM is _comparisons_ rather than control >>>

Re: Add support to trace comparison instructions and switch statements

2017-09-03 Thread Dmitry Vyukov via gcc-patches
On Sun, Sep 3, 2017 at 12:01 PM, Jakub Jelinek wrote: > On Sun, Sep 03, 2017 at 10:50:16AM +0200, Dmitry Vyukov wrote: >> What we instrument in LLVM is _comparisons_ rather than control >> structures. So that would be: >> _4 = x_8(D) == 98; >> For example, result of the

Re: Add support to trace comparison instructions and switch statements

2017-09-03 Thread Jakub Jelinek
On Sun, Sep 03, 2017 at 10:50:16AM +0200, Dmitry Vyukov wrote: > What we instrument in LLVM is _comparisons_ rather than control > structures. So that would be: > _4 = x_8(D) == 98; > For example, result of the comparison can be stored into a bool struct > field, and then used in branching

Re: Add support to trace comparison instructions and switch statements

2017-09-03 Thread Dmitry Vyukov via gcc-patches
On Fri, Sep 1, 2017 at 6:23 PM, Jakub Jelinek wrote: > On Fri, Jul 21, 2017 at 01:38:17PM +0800, 吴潍浠(此彼) wrote: >> Hi Jeff >> >> I have signed the copyright assignment, and used the name 'Wish Wu' . >> Should I send you a copy of my assignment ? >> >> The attachment is my new

Re: Add support to trace comparison instructions and switch statements

2017-09-01 Thread Jakub Jelinek
On Fri, Jul 21, 2017 at 01:38:17PM +0800, 吴潍浠(此彼) wrote: > Hi Jeff > > I have signed the copyright assignment, and used the name 'Wish Wu' . > Should I send you a copy of my assignment ? > > The attachment is my new patch with small changes. > Codes are checked by ./contrib/check_GNU_style.sh,

Re: Add support to trace comparison instructions and switch statements

2017-08-30 Thread Dmitry Vyukov via gcc-patches
ogram. > > Wish Wu > -- > From:Wish Wu <weixi@antfin.com> > Time:2017 Jul 21 (Fri) 13:38 > To:gcc <g...@gcc.gnu.org>; gcc-patches <gcc-patches@gcc.gnu.org>; Jeff Law > <l...@redhat.com> > Cc:wishwu007 <wishwu...@gmail.com> > Subject:Re: Add s

Re: Add support to trace comparison instructions and switch statements

2017-08-05 Thread 吴潍浠(此彼)
ixi@antfin.com> Time:2017 Jul 21 (Fri) 13:38 To:gcc <g...@gcc.gnu.org>; gcc-patches <gcc-patches@gcc.gnu.org>; Jeff Law <l...@redhat.com> Cc:wishwu007 <wishwu...@gmail.com> Subject:Re: Add support to trace comparison instructions and switch statements Hi Jeff I have s

Re: Add support to trace comparison instructions and switch statements

2017-07-21 Thread David Edelsohn
On Fri, Jul 21, 2017 at 1:38 AM, 吴潍浠(此彼) wrote: > Hi Jeff > > I have signed the copyright assignment, and used the name 'Wish Wu' . > Should I send you a copy of my assignment ? Your assignment now is on file in the FSF Copyright Assignment list where Jeff, I and other

Re: Add support to trace comparison instructions and switch statements

2017-07-20 Thread 吴潍浠(此彼)
. With -- From:Jeff Law <l...@redhat.com> Time:2017 Jul 14 (Fri) 15:37 To:Wish Wu <weixi@antfin.com>; gcc <g...@gcc.gnu.org>; gcc-patches <gcc-patches@gcc.gnu.org> Cc:wishwu007 <wishwu...@gmail.com> Subject:Re: Add support to trace comp

Re: Add support to trace comparison instructions and switch statements

2017-07-15 Thread Dmitry Vyukov via gcc-patches
> <gcc-patches@gcc.gnu.org>; Wish Wu <weixi@antfin.com>; Alexander > Potapenko <gli...@google.com>; andreyknvl <andreyk...@google.com>; Victor > Chibotaru <tch...@google.com>; Yuri Gribov <tetra2...@gmail.com> > Subject:Re: Add support to trace compar

Re: Add support to trace comparison instructions and switch statements

2017-07-15 Thread 吴潍浠(此彼)
s <gcc-patches@gcc.gnu.org>; Wish Wu <weixi@antfin.com>; Alexander Potapenko <gli...@google.com>; andreyknvl <andreyk...@google.com>; Victor Chibotaru <tch...@google.com>; Yuri Gribov <tetra2...@gmail.com> Subject:Re: Add support to trace comparis

Re: Add support to trace comparison instructions and switch statements

2017-07-14 Thread Dmitry Vyukov via gcc-patches
On Fri, Jul 14, 2017 at 11:17 PM, Kostya Serebryany wrote: > Hi > > I wrote a test for "-fsanitize-coverage=trace-cmp" . > > Is there anybody tells me if these codes could be merged into gcc ? Nice! We are currently working on

Re: Add support to trace comparison instructions and switch statements

2017-07-14 Thread Kostya Serebryany via gcc-patches
On Fri, Jul 14, 2017 at 5:23 AM, Dmitry Vyukov wrote: > On Thu, Jul 13, 2017 at 11:18 PM, Kostya Serebryany wrote: >>> > Hi >>> > >>> > I wrote a test for "-fsanitize-coverage=trace-cmp" . >>> > >>> > Is there anybody tells me if these codes could be merged

Re: Add support to trace comparison instructions and switch statements

2017-07-14 Thread Dmitry Vyukov via gcc-patches
On Thu, Jul 13, 2017 at 11:18 PM, Kostya Serebryany wrote: >> > Hi >> > >> > I wrote a test for "-fsanitize-coverage=trace-cmp" . >> > >> > Is there anybody tells me if these codes could be merged into gcc ? >> >> >> Nice! >> >> We are currently working on Linux kernel fuzzing

Re: Add support to trace comparison instructions and switch statements

2017-07-14 Thread Jeff Law
On 07/10/2017 06:07 AM, 吴潍浠(此彼) wrote: > Hi > > I write some codes to make gcc support comparison-guided fuzzing. > It is very like > http://clang.llvm.org/docs/SanitizerCoverage.html#tracing-data-flow . > With -fsanitize-coverage=trace-cmp the compiler will insert extra > instrumentation

Re: Add support to trace comparison instructions and switch statements

2017-07-13 Thread Dmitry Vyukov via gcc-patches
On Thu, Jul 13, 2017 at 12:41 PM, Wish Wu wrote: > Hi > > In fact, under linux with "return address" and file "/proc/self/maps", > we can give unique id for every comparison. Yes, it's doable. But you expressed worries about performance hit of merging callbacks for different

Re: Add support to trace comparison instructions and switch statements

2017-07-13 Thread Wish Wu
Hi In fact, under linux with "return address" and file "/proc/self/maps", we can give unique id for every comparison. For fuzzing, we may give 3 bits for every comparison as marker of if "<", "==" or ">" is showed. :D With Regards Wish Wu of Ant-financial Light-Year Security Lab On Thu, Jul

Re: Add support to trace comparison instructions and switch statements

2017-07-13 Thread Wish Wu
Hi In my perspective: 1. Do we need to assign unique id for every comparison ? Yes, I suggest to implement it like -fsanitize-coverage=trace-pc-guard . Because some fuzzing targets may invoke dlopen() like functions to load libraries(modules) after fork(), while these libraries are

Re: Add support to trace comparison instructions and switch statements

2017-07-13 Thread Dmitry Vyukov via gcc-patches
On Tue, Jul 11, 2017 at 1:59 PM, Wish Wu wrote: > Hi > > I wrote a test for "-fsanitize-coverage=trace-cmp" . > > Is there anybody tells me if these codes could be merged into gcc ? Nice! We are currently working on Linux kernel fuzzing that use the comparison tracing. We

Re: Add support to trace comparison instructions and switch statements

2017-07-11 Thread Wish Wu
Hi I wrote a test for "-fsanitize-coverage=trace-cmp" . Is there anybody tells me if these codes could be merged into gcc ? Index: gcc/testsuite/gcc.dg/sancov/basic3.c === --- gcc/testsuite/gcc.dg/sancov/basic3.c (nonexistent) +++

Add support to trace comparison instructions and switch statements

2017-07-10 Thread 吴潍浠(此彼)
Hi I write some codes to make gcc support comparison-guided fuzzing. It is very like http://clang.llvm.org/docs/SanitizerCoverage.html#tracing-data-flow . With -fsanitize-coverage=trace-cmp the compiler will insert extra instrumentation around comparison instructions and switch statements. I