Re: Add support to trace comparison instructions and switch statements

2017-09-04 Thread 吴潍浠(此彼)
rison. Wish Wu -- From:Dmitry Vyukov Time:2017 Sep 3 (Sun) 19:05 To:Wish Wu Cc:Jakub Jelinek ; gcc ; gcc-patches ; Jeff Law ; wishwu007 Subject:Re: Add support to trace comparison instructions and switch statements On Sun, Sep 3, 2017 at 12:38 PM, 吴潍浠(此

Re: Add support to trace comparison instructions and switch statements

2017-09-03 Thread Dmitry Vyukov via gcc
. > Wish Wu > > -- > From:Dmitry Vyukov > Time:2017 Sep 3 (Sun) 18:21 > To:Jakub Jelinek > Cc:Wish Wu ; gcc ; gcc-patches > ; Jeff Law ; wishwu007 > > Subject:Re: Add support to trace comparison instructions and switch statements >

Re: Add support to trace comparison instructions and switch statements

2017-09-03 Thread 吴潍浠(此彼)
; Jeff Law ; wishwu007 Subject:Re: Add support to trace comparison instructions and switch statements 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: &g

Re: Add support to trace comparison instructions and switch statements

2017-09-03 Thread Dmitry Vyukov via gcc
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 >>> structures. So that would be: >>> _4 = x_8(D)

Re: Add support to trace comparison instructions and switch statements

2017-09-03 Thread Dmitry Vyukov via gcc
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 comparison can be store

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 long

Re: Add support to trace comparison instructions and switch statements

2017-09-03 Thread Dmitry Vyukov via gcc
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 patch with small chan

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, e

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 maintainers can see it. We

Re: Add support to trace comparison instructions and switch statements

2017-07-20 Thread 吴潍浠(此彼)
les. With -- From:Jeff Law Time:2017 Jul 14 (Fri) 15:37 To:Wish Wu ; gcc ; gcc-patches Cc:wishwu007 Subject:Re: Add support to trace comparison instructions and switch statements On 07/10/2017 06:07 AM, 吴潍浠(此彼) wrote: > Hi > > I write some codes to make gcc

Re: Add support to trace comparison instructions and switch statements

2017-07-15 Thread Dmitry Vyukov via gcc
gt; -- > From:Dmitry Vyukov > Time:2017 Jul 15 (Sat) 13:41 > To:Kostya Serebryany > Cc:Wish Wu ; gcc ; gcc-patches > ; Wish Wu ; Alexander > Potapenko ; andreyknvl ; Victor > Chibotaru ; Yuri Gribov > Su

Re: Add support to trace comparison instructions and switch statements

2017-07-15 Thread 吴潍浠(此彼)
Add support to trace comparison instructions and switch statements On Fri, Jul 14, 2017 at 11:17 PM, Kostya Serebryany wrote: >>>> > Hi >>>> > >>>> > I wrote a test for "-fsanitize-coverage=trace-cmp" . >>>> > >>>> &

Re: Add support to trace comparison instructions and switch statements

2017-07-14 Thread Dmitry Vyukov via gcc
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 Linux kernel fuzzing

Re: Add support to trace comparison instructions and switch statements

2017-07-14 Thread Kostya Serebryany via gcc
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 into gcc ? >>> >>> >>> Nice! >>> >>> We

Re: Add support to trace comparison instructions and switch statements

2017-07-14 Thread Dmitry Vyukov via gcc
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 that use the >> comp

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 around

Re: Add support to trace comparison instructions and switch statements

2017-07-13 Thread Dmitry Vyukov via gcc
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 sizes. Mapping pc + i

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 13,

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 compil

Re: Add support to trace comparison instructions and switch statements

2017-07-13 Thread Dmitry Vyukov via gcc
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 use clang at the momen

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) +++ g

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 thi