# syzbot
`syzbot` system continuously fuzzes main Linux kernel branches and automatically
reports found bugs to kernel mailing lists.
[syzbot dashboard](https://syzkaller.appspot.com) shows current statuses of
bugs. All `syzbot`-reported bugs are also CCed to
[syzkaller-bugs mailing list](https://groups.google.com/forum/#!forum/syzkaller-bugs).
Direct all questions to `syzkaller@googlegroups.com`.
## Bug status tracking
`syzbot` needs to know when a bug is fixed in order to (1) verify that it is
in fact fixed and (2) be able to report other similarly-looking crashes
(while a bug is considered open all similarly-looking crashes are merged into
the existing bug). To understand when a bug is fixed `syzbot` needs to know
what commit fixes the bug; once `syzbot` knows the commit it will track when
the commit reaches all kernel builds on all tracked branches. Only when the
commit reaches all builds, the bug is considered closed (new similarly-looking
crashes create a new bug).
## Communication with syzbot
If you fix a bug reported by `syzbot`, please add the provided `Reported-by`
tag to the commit. You can also communicate with `syzbot` by replying
to its emails. The commands are:
- to attach a fixing commit to the bug (if you forgot to add `Reported-by` tag):
```
#syz fix: exact-commit-title
````
It's enough that the commit is merged into any tree or you are reasonably sure
about its final title, in particular, you don't need to wait for the commit to
be merged into upstream tree. `syzbot` only needs to know the title by which
it will appear in tested trees. In case of an error or a title change, you can
override the commit simply by sending another `#syz fix` command.
- to undo a previous fix command and remove any fixing commits:
```
#syz unfix
````
- to mark the bug as a duplicate of another `syzbot` bug:
```
#syz dup: exact-subject-of-another-report
```
- to undo a previous dup command and turn it into an independent bug again:
```
#syz undup
```
- to mark the bug as a one-off invalid report (e.g. induced by a previous memory corruption):
```
#syz invalid
```
**Note**: if the crash happens again, it will cause creation of a new bug report.
**Note**: all commands must start from beginning of the line.
**Note**: please keep at least `syzkaller-bugs@googlegroups.com` mailing list in CC.
It serves as a history of what happened with each bug report. Keeping the main kernel
mailing list (e.g. `linux-kernel@vger.kernel.org `) in CC is useful as well so that
it's searchable in those archives as well.
**Note**: `syzbot` identifies bugs by the `HASH` in the `syzbot+HASH@` receiver email address.
So, strictly saying, you don't need to *reply* to emails (e.g. if you did not receive them),
you can send a new email to the `syzbot+HASH@` email address, which you can find as `Sender`
in email archives or as `Reported-by` email on the dashboard page for each bug.
## Testing patches
`syzbot` can test patches for bugs *with reproducers*. This can be used for
testing of fix patches, or just for debugging (i.e. adding additional checks to
code and testing with them), or to check if the bug still happens. To test on
a particular git tree and branch reply with:
```
#syz test: git://repo/address.git branch
```
or alternatively, to test on exact commit reply with:
```
#syz test: git://repo/address.git commit-hash
```
You can also completely omit these parameters:
```
#syz test
```
In this case, syzbot will check out the latest commit from the branch where the
issue was detected.
If you also provide a patch with the email, `syzbot` will apply it on top of the
tree before testing. The patch can be provided inline in email text or as
a text attachment (which is more reliable if your email client messes with
whitespaces).
If you want to include the patch directly in the email body, just paste the diff
somewhere under the `#syz test` command line, e.g.
```
#syz test: git://repo/address.git branch
--- a/mm/kasan/kasan.c
+++ b/mm/kasan/kasan.c
- current->kasan_depth++;
+ current->kasan_depth--;
```
[Here](https://groups.google.com/g/syzkaller-bugs/search?q=%22%23syz%20test%22) are
some real examples of `#syz test` commands for syzbot-reported bugs.
If you don't provide a patch, `syzbot` will test the tree as is.
This is useful if this is your own tree which already contains the patch,
or to check if the bug is already fixed by some recent commit.
After sending an email you should typically get a reply email with results within
an hour.
**Note**: you may send the request only to `syzbot` email address, as patches sent
to some mailing lists (e.g. netdev, netfilter-devel) will trigger patchwork.
**Note**: when testing a patch, syzbot uses the newest reproducer and the matching
kernel config that are listed on the dashboard for this bug. As a result, specifying
a repo, branch or commit id that are different from the ones that were used for
reproducing, can result in false-positive Tested-by responses. For example this
happens, when the bug is not reproducible on a specified kernel tree, with or without
the supplied patch.
**Note**: see [below](#kmsan-bugs) for `KMSAN` bugs testing.
**Note**: see [below](#usb-bugs) for `USB` bugs testing.
## Subsystems
For all its bugs, `syzbot` automatically assigns kernel subsystems tags. For Linux,
the predefined list of kernel subsystems can be found at
https://syzkaller.appspot.com/upstream/subsystems.
By clicking on a name in the subsystem list or by following a tag after a bug's
title, you can get the full list of bugs belonging to the subsystem. For example,
all `nfc` bugs are listed here: https://syzkaller.appspot.com/upstream/s/nfc.
`syzbot` includes subsystem tags into email subject as well, with `?` indicating
that it's an automatic guess: `[syzbot] [ntfs?] kernel BUG in ntfs_iget`.
Over time, as we improve the classification rules or as syzbot obtains more
information about the bug (e.g. finds a reproducer), `syzbot` will update tags.
You can also manually override the automatic guess by replying to the `syzbot` email:
```
#syz set subsystems: net, mm
```
Names of subsystems must be taken from the subsystem list page on the syzbot web
dashboard.
## Bug labels
It is possible to assign labels to syzkaller-reported bugs. These labels
are displayed near bug titles on the bug lists and on individual bug pages.
There are two types of labels:
* Flags
* Send `#syz set