Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1334581 > unrolled thread

Re: [RFC][PATCH 00/12] various perf fixes

Started byDmitry Vyukov <dvyukov@google.com>
First post2016-02-15 17:40 +0100
Last post2016-02-15 18:10 +0100
Articles 10 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [RFC][PATCH 00/12] various perf fixes Dmitry Vyukov <dvyukov@google.com> - 2016-02-15 17:40 +0100
    Re: [RFC][PATCH 00/12] various perf fixes Dmitry Vyukov <dvyukov@google.com> - 2016-02-15 17:40 +0100
      Re: [RFC][PATCH 00/12] various perf fixes Peter Zijlstra <peterz@infradead.org> - 2016-02-15 18:00 +0100
        Re: [RFC][PATCH 00/12] various perf fixes Peter Zijlstra <peterz@infradead.org> - 2016-02-15 18:10 +0100
          Re: [RFC][PATCH 00/12] various perf fixes Peter Zijlstra <peterz@infradead.org> - 2016-02-15 19:10 +0100
            Re: [RFC][PATCH 00/12] various perf fixes Dmitry Vyukov <dvyukov@google.com> - 2016-02-15 19:40 +0100
        Re: [RFC][PATCH 00/12] various perf fixes Dmitry Vyukov <dvyukov@google.com> - 2016-02-15 18:10 +0100
    Re: [RFC][PATCH 00/12] various perf fixes Peter Zijlstra <peterz@infradead.org> - 2016-02-15 17:50 +0100
      Re: [RFC][PATCH 00/12] various perf fixes Dmitry Vyukov <dvyukov@google.com> - 2016-02-15 18:00 +0100
        Re: [RFC][PATCH 00/12] various perf fixes Peter Zijlstra <peterz@infradead.org> - 2016-02-15 18:10 +0100

#1334581 — Re: [RFC][PATCH 00/12] various perf fixes

FromDmitry Vyukov <dvyukov@google.com>
Date2016-02-15 17:40 +0100
SubjectRe: [RFC][PATCH 00/12] various perf fixes
Message-ID<r2ulQ-3v3-7@gated-at.bofh.it>
On Mon, Feb 15, 2016 at 5:29 PM, Peter Zijlstra <peterz@infradead.org> wrote:
> On Thu, Jan 14, 2016 at 11:05:50AM +0100, Dmitry Vyukov wrote:
>> There is a way to run it without coverage on a local machine.
>>
>> First, you need to setup Go toolchain: download latest Go distribution
>> from https://golang.org/dl:
>> https://storage.googleapis.com/golang/go1.5.3.linux-amd64.tar.gz
>> Unpack it to $HOME/go1.5.
>>
>> $ export GOROOT=$HOME/go1.5
>
>> $ export GOPATH=$HOME/gopath
>
> So after I put that in a profile.d file:
>
>> Download syzkaller sources:
>>
>> $ go get github.com/google/syzkaller
>
> package github.com/google/syzkaller: no buildable Go source files in /root/gopath/src/github.com/google/syzkaller
>
>> Build necessary syzkaller binaries:
>>
>> $ cd $GOPATH/src/github.com/google/syzkaller
>> $ make
>
> That seems to have done its thing
>
>> Then save the following content into
>> $GOPATH/src/github.com/google/syzkaller/perf.cfg
>>
>
> {
>         "http": "localhost:50000",
>         "workdir": "root/gopath/src/github.com/google/syzkaller/workdir",
>         "syzkaller": "/root/gopath/src/github.com/google/syzkaller",
>         "vmlinux": "-",
>         "type": "local",
>         "count": 1,
>         "procs": 160,
>         "nocover": true,
>         "nodropprivs": true,
>         "enable_syscalls": [
>                 "perf_event_open",
>                 "ioctl$PERF*",
>                 "prctl$void",
>                 "bpf$*",
>                 "sched_yield"
>         ]
> }
>
>> Alter paths as necessary. Also you can change procs parameter (number
>> of parallel test processes), something like NCPU*4 would be a good
>> number. Also you can add additional syscalls to the mix.
>
> per the above
>
>> Then run:
>>
>> $ bin/syz-manager -config perf.cfg
>>
>> If you run it on a separate test machine, then scp syzkaller/bin dir
>> and perf.cfg to the machine (the syzkaller param in config is where it
>> will search for the bin dir).
>>
>> If syz-manager does not appear to be doing anything useful, then pleas
>> run it in the following mode and post output:
>>
>> $ bin/syz-manager -config perf.cfg -v 1 -debug
>
> root@ivb-ep:~/gopath/src/github.com/google/syzkaller# bin/syz-manager -config perf.cfg -v 1 -debug
> 2016/02/15 17:12:50 bad config syzkaller param: can't find bin/syz-execprog
>
> And its right, no such thing as bin/syz-execprog


Please also do:

$ make execprog

And replace:

        "nocover": true,
        "nodropprivs": true,

in config file with:

        "cover": false,
        "dropprivs": false,

(that's changed since I wrote the instructions).

[toc] | [next] | [standalone]


#1334582

FromDmitry Vyukov <dvyukov@google.com>
Date2016-02-15 17:40 +0100
Message-ID<r2ulQ-3v3-17@gated-at.bofh.it>
In reply to#1334581
On Mon, Feb 15, 2016 at 5:35 PM, Dmitry Vyukov <dvyukov@google.com> wrote:
> On Mon, Feb 15, 2016 at 5:29 PM, Peter Zijlstra <peterz@infradead.org> wrote:
>> On Thu, Jan 14, 2016 at 11:05:50AM +0100, Dmitry Vyukov wrote:
>>> There is a way to run it without coverage on a local machine.
>>>
>>> First, you need to setup Go toolchain: download latest Go distribution
>>> from https://golang.org/dl:
>>> https://storage.googleapis.com/golang/go1.5.3.linux-amd64.tar.gz
>>> Unpack it to $HOME/go1.5.
>>>
>>> $ export GOROOT=$HOME/go1.5
>>
>>> $ export GOPATH=$HOME/gopath
>>
>> So after I put that in a profile.d file:
>>
>>> Download syzkaller sources:
>>>
>>> $ go get github.com/google/syzkaller
>>
>> package github.com/google/syzkaller: no buildable Go source files in /root/gopath/src/github.com/google/syzkaller
>>
>>> Build necessary syzkaller binaries:
>>>
>>> $ cd $GOPATH/src/github.com/google/syzkaller
>>> $ make
>>
>> That seems to have done its thing
>>
>>> Then save the following content into
>>> $GOPATH/src/github.com/google/syzkaller/perf.cfg
>>>
>>
>> {
>>         "http": "localhost:50000",
>>         "workdir": "root/gopath/src/github.com/google/syzkaller/workdir",
>>         "syzkaller": "/root/gopath/src/github.com/google/syzkaller",
>>         "vmlinux": "-",
>>         "type": "local",
>>         "count": 1,
>>         "procs": 160,
>>         "nocover": true,
>>         "nodropprivs": true,
>>         "enable_syscalls": [
>>                 "perf_event_open",
>>                 "ioctl$PERF*",
>>                 "prctl$void",
>>                 "bpf$*",
>>                 "sched_yield"
>>         ]
>> }
>>
>>> Alter paths as necessary. Also you can change procs parameter (number
>>> of parallel test processes), something like NCPU*4 would be a good
>>> number. Also you can add additional syscalls to the mix.
>>
>> per the above
>>
>>> Then run:
>>>
>>> $ bin/syz-manager -config perf.cfg
>>>
>>> If you run it on a separate test machine, then scp syzkaller/bin dir
>>> and perf.cfg to the machine (the syzkaller param in config is where it
>>> will search for the bin dir).
>>>
>>> If syz-manager does not appear to be doing anything useful, then pleas
>>> run it in the following mode and post output:
>>>
>>> $ bin/syz-manager -config perf.cfg -v 1 -debug
>>
>> root@ivb-ep:~/gopath/src/github.com/google/syzkaller# bin/syz-manager -config perf.cfg -v 1 -debug
>> 2016/02/15 17:12:50 bad config syzkaller param: can't find bin/syz-execprog
>>
>> And its right, no such thing as bin/syz-execprog
>
>
> Please also do:
>
> $ make execprog
>
> And replace:
>
>         "nocover": true,
>         "nodropprivs": true,
>
> in config file with:
>
>         "cover": false,
>         "dropprivs": false,
>
> (that's changed since I wrote the instructions).


Just to compensate the pain, here is what I've just got when
re-enabled perf in my config :)

2016/02/15 16:52:18 qemu-15: saving crash 'WARNING: CPU: 0 PID: 18465
at kernel/events/core.c:2743 ctx_sched_in+0x255/0x17f0()' to
crash-qemu-15-1455551538366997265
2016/02/15 16:54:02 qemu-17: saving crash 'WARNING: CPU: 0 PID: 1072
at kernel/events/core.c:2743 ctx_sched_in+0x255/0x17f0()' to
crash-qemu-17-1455551642205132730
2016/02/15 16:54:44 qemu-30: saving crash 'WARNING: CPU: 3 PID: 19858
at kernel/events/core.c:2122 __perf_install_in_context+0x1c4/0x220()'
to crash-qemu-30-1455551684741709699
2016/02/15 16:55:02 qemu-20: saving crash 'WARNING: CPU: 2 PID: 9873
at kernel/events/core.c:226 event_function+0x359/0x3e0()' to
crash-qemu-20-1455551702744185903
2016/02/15 16:56:22 qemu-27: saving crash 'WARNING: CPU: 3 PID: 10602
at kernel/events/core.c:2122 __perf_install_in_context+0x1c4/0x220()'
to crash-qemu-27-1455551782768040747
2016/02/15 16:56:45 qemu-27: saving crash 'WARNING: CPU: 0 PID: 12779
at kernel/events/core.c:8693 perf_event_exit_task+0x708/0x900()' to
crash-qemu-27-1455551805030612662
2016/02/15 16:56:49 qemu-2: saving crash 'WARNING: CPU: 3 PID: 17062
at kernel/events/core.c:226 event_function+0x359/0x3e0()' to
crash-qemu-2-1455551809378028704
2016/02/15 16:56:58 qemu-20: saving crash 'WARNING: CPU: 3 PID: 22426
at kernel/events/core.c:2743 ctx_sched_in+0x255/0x17f0()' to
crash-qemu-20-1455551818913067860
2016/02/15 16:57:08 qemu-33: saving crash 'WARNING: CPU: 3 PID: 23837
at kernel/events/core.c:2122 __perf_install_in_context+0x1c4/0x220()'
to crash-qemu-33-1455551828622810673
2016/02/15 16:57:11 qemu-27: saving crash 'INFO: rcu_sched detected
stalls on CPUs/tasks:' to crash-qemu-27-1455551831109315050
2016/02/15 16:57:34 qemu-33: saving crash 'INFO: rcu_sched
self-detected stall on CPU' to crash-qemu-33-1455551854588053356
2016/02/15 16:57:44 qemu-33: saving crash 'BUG: workqueue lockup -
pool cpus=0 node=0 flags=0x0 nice=-20 stuck for 34s!' to
crash-qemu-33-1455551864688663395

[toc] | [prev] | [next] | [standalone]


#1334601

FromPeter Zijlstra <peterz@infradead.org>
Date2016-02-15 18:00 +0100
Message-ID<r2uFc-3Dw-23@gated-at.bofh.it>
In reply to#1334582
On Mon, Feb 15, 2016 at 05:38:36PM +0100, Dmitry Vyukov wrote:
> Just to compensate the pain, here is what I've just got when
> re-enabled perf in my config :)
> 
> 2016/02/15 16:52:18 qemu-15: saving crash 'WARNING: CPU: 0 PID: 18465
> at kernel/events/core.c:2743 ctx_sched_in+0x255/0x17f0()' to
> crash-qemu-15-1455551538366997265
> 2016/02/15 16:54:02 qemu-17: saving crash 'WARNING: CPU: 0 PID: 1072
> at kernel/events/core.c:2743 ctx_sched_in+0x255/0x17f0()' to
> crash-qemu-17-1455551642205132730
> 2016/02/15 16:54:44 qemu-30: saving crash 'WARNING: CPU: 3 PID: 19858
> at kernel/events/core.c:2122 __perf_install_in_context+0x1c4/0x220()'
> to crash-qemu-30-1455551684741709699
> 2016/02/15 16:55:02 qemu-20: saving crash 'WARNING: CPU: 2 PID: 9873
> at kernel/events/core.c:226 event_function+0x359/0x3e0()' to
> crash-qemu-20-1455551702744185903

That looks like a splat every minute or so. I've now had it run for
almost 10 minutes and I've not seen anything except:

2016/02/15 17:26:25 local-0: saving crash 'not executing programs' to crash-local-0-1455553585720015733
2016/02/15 17:29:25 local-0: saving crash 'not executing programs' to crash-local-0-1455553765740119317
2016/02/15 17:32:25 local-0: saving crash 'not executing programs' to crash-local-0-1455553945767974819
2016/02/15 17:35:25 local-0: saving crash 'not executing programs' to crash-local-0-1455554125793957186

And those files are completely empty of useful.

[toc] | [prev] | [next] | [standalone]


#1334609

FromPeter Zijlstra <peterz@infradead.org>
Date2016-02-15 18:10 +0100
Message-ID<r2uOT-3Y1-41@gated-at.bofh.it>
In reply to#1334601
On Mon, Feb 15, 2016 at 06:04:15PM +0100, Dmitry Vyukov wrote:
> There is something wrong and I guess it is not actually working.
> Please post your config file so that I can double check. In
> particular, did you set "cover": false?


{
	"http": "localhost:50000",
	"workdir": "root/gopath/src/github.com/google/syzkaller/workdir",
	"syzkaller": "/root/gopath/src/github.com/google/syzkaller",
	"vmlinux": "-",
	"type": "local",
	"count": 1,
	"procs": 160,
	"cover": false,
	"dropprivs": false,
	"enable_syscalls": [
		"perf_event_open",
		"ioctl$PERF*",
		"prctl$void",
		"bpf$*",
		"sched_yield"
	]
}

[toc] | [prev] | [next] | [standalone]


#1334675

FromPeter Zijlstra <peterz@infradead.org>
Date2016-02-15 19:10 +0100
Message-ID<r2vKV-4Dk-11@gated-at.bofh.it>
In reply to#1334609
On Mon, Feb 15, 2016 at 06:45:59PM +0100, Dmitry Vyukov wrote:
> However, you need to add getpid and gettid syscalls to the list of
> enabled syscalls in config (they are required for perf_event_open):
> 
>         "enable_syscalls": [
>                 "getpid",
>                 "gettid",
>                 "perf_event_open",
>                 "ioctl$PERF*",
>                 "prctl$void",
>                 "bpf$*",
>                 "sched_yield"
>         ]
> 

Yep, that made it work. I'll go have a look.

Thanks!

[toc] | [prev] | [next] | [standalone]


#1334709

FromDmitry Vyukov <dvyukov@google.com>
Date2016-02-15 19:40 +0100
Message-ID<r2wdY-4Rn-5@gated-at.bofh.it>
In reply to#1334675
On Mon, Feb 15, 2016 at 7:01 PM, Peter Zijlstra <peterz@infradead.org> wrote:
> On Mon, Feb 15, 2016 at 06:45:59PM +0100, Dmitry Vyukov wrote:
>> However, you need to add getpid and gettid syscalls to the list of
>> enabled syscalls in config (they are required for perf_event_open):
>>
>>         "enable_syscalls": [
>>                 "getpid",
>>                 "gettid",
>>                 "perf_event_open",
>>                 "ioctl$PERF*",
>>                 "prctl$void",
>>                 "bpf$*",
>>                 "sched_yield"
>>         ]
>>
>
> Yep, that made it work. I'll go have a look.


Glad it works for you. Thanks for bearing with me.

I will fix the confusing "not executing programs" messages.

Re gcc 5.3: it was released on the day I submitted the patch and 5.3
claims to contain only bug fixes, so I guess it is not there.


Btw, do you have CONFIG_KASAN enabled? I also see some some
use-after-free bugs. gcc 5.3 should fully support KASAN including
CONFIG_KASAN_INLINE=y (which is faster).


BUG: KASAN: use-after-free in perf_event_task_tick+0xb47/0xbd0 at addr
ffff880036cff2b8
Read of size 8 by task ksoftirqd/1/12

INFO: Allocated in alloc_perf_context+0x4c/0xf0 age=272 cpu=1 pid=1904
[<      none      >] ___slab_alloc+0x564/0x5b0 mm/slub.c:2470
[<      none      >] __slab_alloc+0x66/0xc0 mm/slub.c:2499
[<     inline     >] slab_alloc_node mm/slub.c:2562
[<     inline     >] slab_alloc mm/slub.c:2604
[<      none      >] kmem_cache_alloc_trace+0x25c/0x300 mm/slub.c:2621
[<     inline     >] kmalloc include/linux/slab.h:463
[<     inline     >] kzalloc include/linux/slab.h:607
[<      none      >] alloc_perf_context+0x4c/0xf0 kernel/events/core.c:3337
[<      none      >] find_get_context.isra.76+0x12a/0x5b0
kernel/events/core.c:3444
[<      none      >] SYSC_perf_event_open+0xed1/0x1ef0 kernel/events/core.c:8312
[<      none      >] SyS_perf_event_open+0x39/0x50 kernel/events/core.c:8173
[<      none      >] tracesys_phase2+0x88/0x8d arch/x86/entry/entry_64.S:269

INFO: Freed in free_ctx+0x47/0x60 age=0 cpu=3 pid=0
[<      none      >] __slab_free+0x1fc/0x320 mm/slub.c:2680
[<     inline     >] slab_free mm/slub.c:2835
[<      none      >] kfree+0x2ac/0x2c0 mm/slub.c:3664
[<      none      >] free_ctx+0x47/0x60 kernel/events/core.c:1017
[<     inline     >] __rcu_reclaim kernel/rcu/rcu.h:118
[<     inline     >] rcu_do_batch kernel/rcu/tree.c:2704
[<     inline     >] invoke_rcu_callbacks kernel/rcu/tree.c:2970
[<     inline     >] __rcu_process_callbacks kernel/rcu/tree.c:2937
[<      none      >] rcu_process_callbacks+0xd5b/0x1440 kernel/rcu/tree.c:2954
[<      none      >] __do_softirq+0x26a/0x920 kernel/softirq.c:273
[<     inline     >] invoke_softirq kernel/softirq.c:350
[<      none      >] irq_exit+0x18f/0x1d0 kernel/softirq.c:391
[<     inline     >] exiting_irq ./arch/x86/include/asm/apic.h:659
[<      none      >] smp_apic_timer_interrupt+0x7e/0xa0
arch/x86/kernel/apic/apic.c:932
[<      none      >] apic_timer_interrupt+0x8c/0xa0
arch/x86/entry/entry_64.S:520
[<     inline     >] arch_safe_halt ./arch/x86/include/asm/paravirt.h:117
[<      none      >] default_idle+0x52/0x2e0 arch/x86/kernel/process.c:304
[<      none      >] arch_cpu_idle+0xa/0x10 arch/x86/kernel/process.c:295
[<      none      >] default_idle_call+0x48/0xa0 kernel/sched/idle.c:92
[<     inline     >] cpuidle_idle_call kernel/sched/idle.c:150
[<     inline     >] cpu_idle_loop kernel/sched/idle.c:246
[<      none      >] cpu_startup_entry+0x57e/0x720 kernel/sched/idle.c:294
[<      none      >] start_secondary+0x30a/0x450 arch/x86/kernel/smpboot.c:251

INFO: Slab 0xffffea0000db3f00 objects=16 used=1 fp=0xffff880036cff1f8
flags=0x1fffc0000004080
INFO: Object 0xffff880036cff1f8 @offset=12792 fp=0xffff880036cfee20

CPU: 1 PID: 12 Comm: ksoftirqd/1 Tainted: G    B   W       4.5.0-rc4+ #327
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
 ffffffff87b05080 ffff88003ed07bc8 ffffffff82be46cf ffffffff00db3f00
 fffffbfff0f60a10 ffff88003e804f00 ffff880036cff1f8 ffff880036cfc000
 ffffea0000db3f00 ffff88003e25c740 ffff88003ed07bf8 ffffffff8175dea4

Call Trace:
 [<ffffffff817678ce>] __asan_report_load8_noabort+0x3e/0x40
mm/kasan/report.c:295
 [<ffffffff81629e17>] perf_event_task_tick+0xb47/0xbd0 kernel/events/core.c:3085
 [<ffffffff813e7ac2>] scheduler_tick+0x102/0x290 kernel/sched/core.c:2976
 [<ffffffff814b5f0c>] update_process_times+0x5c/0x70 kernel/time/timer.c:1425
 [<ffffffff814e1b4f>] tick_sched_handle.isra.21+0xaf/0xe0
kernel/time/tick-sched.c:152
 [<ffffffff814e2272>] tick_sched_timer+0x72/0x100 kernel/time/tick-sched.c:1088
 [<     inline     >] __run_hrtimer kernel/time/hrtimer.c:1248
 [<ffffffff814b7df3>] __hrtimer_run_queues+0x363/0xc20
kernel/time/hrtimer.c:1312
 [<ffffffff814b9e12>] hrtimer_interrupt+0x182/0x430 kernel/time/hrtimer.c:1346
 [<ffffffff8124e1d2>] local_apic_timer_interrupt+0x72/0xe0
arch/x86/kernel/apic/apic.c:907
 [<ffffffff812516f9>] smp_apic_timer_interrupt+0x79/0xa0
arch/x86/kernel/apic/apic.c:931
 [<ffffffff8666342c>] apic_timer_interrupt+0x8c/0xa0
arch/x86/entry/entry_64.S:520
 <EOI>  [<ffffffff8666213e>] _raw_spin_unlock_irqrestore+0x5e/0xc0
kernel/locking/spinlock.c:191
 [<     inline     >] spin_unlock_irqrestore include/linux/spinlock.h:362
 [<ffffffff817632ee>] __slab_free+0x1ae/0x320 mm/slub.c:2687

[toc] | [prev] | [next] | [standalone]


#1334612

FromDmitry Vyukov <dvyukov@google.com>
Date2016-02-15 18:10 +0100
Message-ID<r2uOT-3Y1-33@gated-at.bofh.it>
In reply to#1334601
On Mon, Feb 15, 2016 at 5:52 PM, Peter Zijlstra <peterz@infradead.org> wrote:
> On Mon, Feb 15, 2016 at 05:38:36PM +0100, Dmitry Vyukov wrote:
>> Just to compensate the pain, here is what I've just got when
>> re-enabled perf in my config :)
>>
>> 2016/02/15 16:52:18 qemu-15: saving crash 'WARNING: CPU: 0 PID: 18465
>> at kernel/events/core.c:2743 ctx_sched_in+0x255/0x17f0()' to
>> crash-qemu-15-1455551538366997265
>> 2016/02/15 16:54:02 qemu-17: saving crash 'WARNING: CPU: 0 PID: 1072
>> at kernel/events/core.c:2743 ctx_sched_in+0x255/0x17f0()' to
>> crash-qemu-17-1455551642205132730
>> 2016/02/15 16:54:44 qemu-30: saving crash 'WARNING: CPU: 3 PID: 19858
>> at kernel/events/core.c:2122 __perf_install_in_context+0x1c4/0x220()'
>> to crash-qemu-30-1455551684741709699
>> 2016/02/15 16:55:02 qemu-20: saving crash 'WARNING: CPU: 2 PID: 9873
>> at kernel/events/core.c:226 event_function+0x359/0x3e0()' to
>> crash-qemu-20-1455551702744185903
>
> That looks like a splat every minute or so. I've now had it run for
> almost 10 minutes and I've not seen anything except:
>
> 2016/02/15 17:26:25 local-0: saving crash 'not executing programs' to crash-local-0-1455553585720015733
> 2016/02/15 17:29:25 local-0: saving crash 'not executing programs' to crash-local-0-1455553765740119317
> 2016/02/15 17:32:25 local-0: saving crash 'not executing programs' to crash-local-0-1455553945767974819
> 2016/02/15 17:35:25 local-0: saving crash 'not executing programs' to crash-local-0-1455554125793957186
>
> And those files are completely empty of useful.

There is something wrong and I guess it is not actually working.
Please post your config file so that I can double check. In
particular, did you set "cover": false?

[toc] | [prev] | [next] | [standalone]


#1334596

FromPeter Zijlstra <peterz@infradead.org>
Date2016-02-15 17:50 +0100
Message-ID<r2uvw-3zL-35@gated-at.bofh.it>
In reply to#1334581
On Mon, Feb 15, 2016 at 05:35:51PM +0100, Dmitry Vyukov wrote:
> > root@ivb-ep:~/gopath/src/github.com/google/syzkaller# bin/syz-manager -config perf.cfg -v 1 -debug
> > 2016/02/15 17:12:50 bad config syzkaller param: can't find bin/syz-execprog
> >
> > And its right, no such thing as bin/syz-execprog
> 
> 
> Please also do:
> 
> $ make execprog
> 
> And replace:
> 
>         "nocover": true,
>         "nodropprivs": true,
> 
> in config file with:
> 
>         "cover": false,
>         "dropprivs": false,
> 
> (that's changed since I wrote the instructions).

OK, now I have syz-fuzzer at ~950% CPU time and a gazillion syz-executor
tasks running.

No splats yet, I'll leave it running for a while.


In order to get coverage support, I have to apply that one patch to my
local kernel, right?

[toc] | [prev] | [next] | [standalone]


#1334600

FromDmitry Vyukov <dvyukov@google.com>
Date2016-02-15 18:00 +0100
Message-ID<r2uFc-3Dw-25@gated-at.bofh.it>
In reply to#1334596
On Mon, Feb 15, 2016 at 5:41 PM, Peter Zijlstra <peterz@infradead.org> wrote:
> On Mon, Feb 15, 2016 at 05:35:51PM +0100, Dmitry Vyukov wrote:
>> > root@ivb-ep:~/gopath/src/github.com/google/syzkaller# bin/syz-manager -config perf.cfg -v 1 -debug
>> > 2016/02/15 17:12:50 bad config syzkaller param: can't find bin/syz-execprog
>> >
>> > And its right, no such thing as bin/syz-execprog
>>
>>
>> Please also do:
>>
>> $ make execprog
>>
>> And replace:
>>
>>         "nocover": true,
>>         "nodropprivs": true,
>>
>> in config file with:
>>
>>         "cover": false,
>>         "dropprivs": false,
>>
>> (that's changed since I wrote the instructions).
>
> OK, now I have syz-fuzzer at ~950% CPU time and a gazillion syz-executor
> tasks running.

If you want more or less, it is controlled by the "procs": 160 config parameter.

> No splats yet, I'll leave it running for a while.
>
>
> In order to get coverage support, I have to apply that one patch to my
> local kernel, right?

Unfortunately you also need a very fresh gcc. Kcov support was
committed to gcc in revision 231296 (Dec 4). So you either need to
build gcc manually or obtain some kind of nightly build.

Yes, you need to apply the kcov patch to kernel. It is now in
linux-next tree, so you can pull from there.
Enable CONFIG_KCOV and CONFIG_DEBUGFS and build kernel with 'make
CC=your/fresh/gcc'.

And then change "cover": false in config to "cover": true.

[toc] | [prev] | [next] | [standalone]


#1334610

FromPeter Zijlstra <peterz@infradead.org>
Date2016-02-15 18:10 +0100
Message-ID<r2uOT-3Y1-43@gated-at.bofh.it>
In reply to#1334600
On Mon, Feb 15, 2016 at 05:54:51PM +0100, Dmitry Vyukov wrote:
> > OK, now I have syz-fuzzer at ~950% CPU time and a gazillion syz-executor
> > tasks running.
> 
> If you want more or less, it is controlled by the "procs": 160 config parameter.

I've got 2*10 cores, each with SMT enabled for 40 'CPU's, 160 is the
4*NR_CPUS thing you suggested.

Should be good enough to keep the machine busy I suppose.

> > No splats yet, I'll leave it running for a while.
> >
> >
> > In order to get coverage support, I have to apply that one patch to my
> > local kernel, right?
> 
> Unfortunately you also need a very fresh gcc. Kcov support was
> committed to gcc in revision 231296 (Dec 4). So you either need to
> build gcc manually or obtain some kind of nightly build.

My last GCC build is 5.3-branch or so, is that fresh enough?

> Yes, you need to apply the kcov patch to kernel. It is now in
> linux-next tree, so you can pull from there.
> Enable CONFIG_KCOV and CONFIG_DEBUGFS and build kernel with 'make
> CC=your/fresh/gcc'.
> 
> And then change "cover": false in config to "cover": true.

Right, I'll see if I can pick the patch from there.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web