On Mon, 8 Jan 2024 at 19:31, Xing Yi Han <
hxing...@gmail.com> wrote:
>
> Hey Vyukov,
>
> Thanks for the reply! That makes a lot of sense, since syzkaller does generate sequences of syscalls that may be dependent on the one happening before... However, adding a sleep syscall after every syscall does seem to be quite a bit of unnecessary overhead.
>
> Just to check with you if my idea is feasible: Since I am fuzzing for concurrency bugs, would it be possible to modify syz-fuzzer to generate 2 separate sequences of syscalls, and then modify executor to execute those on 2 separate threads? Would this require a lot of effort or can this be done easily?
>
> Please feel free to provide any feedback and/or suggestions, I am all ears! Very grateful for all the help received. Thank you so much to the syzkaller team :)
Hi Xing,
Thanks!
syzkaller can execute syscalls concurrently to trigger races:
https://github.com/google/syzkaller/blob/4c0fd4bb60ad179a6cf6be0edf416b2fca287b40/executor/executor.cc#L895-L898
What calls are executed in parallel is controlled by the program
generation/mutation logic.
I think this is mostly functionally equivalent to what you described.
> Cheers,
> Xing Yi
>
> On Thursday, January 4, 2024 at 6:01:26 PM UTC+8
dvy...@google.com wrote:
>>
>> On Thu, 4 Jan 2024 at 08:54, Xing Yi Han <
hxing...@gmail.com> wrote:
>>>
>>> Hey Aleksandr,
>>>
>>> Thank you so much for your response! It really helped me out a lot and I am now able to achieve the goals set out in the previous email :)
>>>
>>> However, running syzkaller with `-debug` enabled, I realised that despite `kMaxThreads` being set to 32 in `executor.cc`, only one thread is actually created to handle the sequence of syscalls (see image below). One thread with id=0 is created and it runs all the syscalls. From the exec opts, threaded=1 which should mean that more threads should be created to handle the syscalls? How do I get more threads to be created to run the syscalls?
>>
>>
>> Hi Xing,
>>
>> Executor will use more threads only if previous syscalls blocks.
>> If all syscalls don't block and return, then the executor will just reuse the single thread.
>> If you add a blocking sleep syscall to the program, then the next syscall after it should be started on another thread.
>>
>>>
>>>
>>>
>>>
> To view this discussion on the web visit
https://groups.google.com/d/msgid/syzkaller/847d84b5-8f58-42d9-a5ef-12408a343a89n%40googlegroups.com.