Skip to content

Commit

Permalink
Made changes in the ssh config and netbsd sources part
Browse files Browse the repository at this point in the history
  • Loading branch information
R3x authored and dvyukov committed Feb 12, 2019
1 parent 5917820 commit b23b81c
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions docs/netbsd/README.md
Expand Up @@ -6,21 +6,24 @@ Instructions to set up syzkaller for a Linux Host and an amd64 NetBSD kernel.

1. Get the NetBSD kernel source (preferably HEAD).
```sh
$ mdkir $HOME/netbsd
$ cd $HOME/netbsd
$ git clone https://github.com/NetBSD/src.git
```

2. Build the tools
2. Build the tools (You will have the toolchain in $HOME/netbsd/tools)
```sh
$ cd src
$ ./build.sh -m amd64 -U -T ../tools tools
```

3. Build the Distribution (This might take a while)
```sh
$ cd src
$ ./build.sh -m amd64 -U -T ../tools -D ../dest distribution
```

At this point you should have a NetBSD distribution at `$HOME/netbsd/dest`.

## Installing and building Syzkaller on Linux Host

1. Install all the dependencies for Syzkaller (Go distribution can be downloaded from https://golang.org/dl/)
Expand All @@ -31,9 +34,9 @@ Instructions to set up syzkaller for a Linux Host and an amd64 NetBSD kernel.
$ cd ~/go/src/github.com/google/syzkaller
```

3. Compile Syzkaller for NetBSD
3. Compile Syzkaller for NetBSD
```sh
$ make TARGETOS=netbsd SOURCEDIR=path/to/netbsd/src
$ make TARGETOS=netbsd SOURCEDIR=$HOME/netbsd/src
```

The above steps should have built the Syzkaller binaries for NetBSD.
Expand All @@ -54,16 +57,18 @@ configure ssh.
$ ssh-keygen -t rsa
```

2. Append the following lines to `/etc/rc.conf` on the guest.
2. Append the following lines to `/etc/rc.conf` on the guest. (use `vi` editor)
```
sshd=YES
dhcpcd=YES
ifconfig_wm0="inet 10.0.2.15 netmask 255.255.255.0"
```

3. Append this to `/etc/ssh/sshd_config` on the guest.
```
Port 22
ListenAddress 10.0.2.15
PermitRootLogin yes
PermitRootLogin without-password
```

Expand All @@ -72,8 +77,8 @@ configure ssh.
$ ssh -p 10022 root@127.0.0.1
```

5. Copy your public key to `/root/.ssh/authorized_keys` on the guest and `reboot` the
VM.
5. Copy and paste your public key to `/root/.ssh/authorized_keys` on the guest
and `reboot` the VM.

6. After reboot make sure that the ssh is working properly. Replace the port with what
you have configured.
Expand All @@ -90,6 +95,7 @@ You can compile a kernel with KASAN to increase the chances of finding bugs.

1. Make a copy of the config file
```sh
$ cd $HOME/netbsd/src
$ cp sys/arch/amd64/conf/GENERIC sys/arch/amd64/conf/SYZKALLER
```

Expand All @@ -100,16 +106,17 @@ You can compile a kernel with KASAN to increase the chances of finding bugs.
#no options SVS
```

4. Compile the kernel with KASAN (Assuming you have followed the inital steps to
3. Compile the kernel with KASAN (Assuming you have followed the inital steps to
build tools)
```sh
$ cd $HOME/netbsd/src
$ ./build.sh -m amd64 -U -T ../tools -j4 kernel=SYZKALLER

```

4. Compiled kernel image should be found in `sys/arch/amd64/compile/SYZKALLER` and
should have the name `netbsd`. You need to copy it to the installed VM and reboot
the VM.
4. At this point you should have the new compiled kernel image which can be found in
`$HOME/netbsd/src/sys/arch/amd64/compile/SYZKALLER` and should have the name
`netbsd`. You need to copy it to the installed VM and reboot the VM.

## Running Syzkaller

Expand Down

0 comments on commit b23b81c

Please sign in to comment.