Hi,
I am using syzkaller for fuzzing linux kernel and I have added a new system call in my custom kernel source.
Now I want to add new system call in syzkaller as well, so in order to accomplish that, I followed this link (Non-mainline subsystems):
https://github.com/google/syzkaller/blob/master/docs/syscall_descriptions.md1. I have added a new system call file custom_driver.txt in which I have mentioned the system call. Here is the entry of this file:
# Copyright 2022 syzkaller project authors. All rights reserved.
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
resource fd_custom[fd]
syz_open_dev$custom(dev ptr[in, string["/dev/custom"]], id intptr, flags flags[open_flags]) fd_custom
ioctl$CUSTOM_IOCTL_CREATE(fd fd_custom, cmd const[CUSTOM_IOCTL_CREATE], arg ptr[in, intptr])
2. After this I followed below commands on Ubuntu hostOS:
$export KSRC=$HOME/linux
$export SRCDIR=$KSRC
$export LINUXBLD=$KSRC
$make bin/syz-extract
GOOS=linux GOARCH=amd64 go build "-ldflags=-s -w -X
github.com/google/syzkaller/prog.GitRevision=8f633d840e3eb6454f036e9da3285bcf27345616 -X '
github.com/google/syzkaller/prog.gitRevisionDate=20220617-150733'" -o bin/syz-extract ./sys/syz-extract
$bin/syz-extract -os linux -arch amd64 -sourcedir $KSRC -builddir $LINUXBLD custom_driver.txt
generating linux/amd64...
$
$make generate
make descriptions
go list -f '{{.Stale}}' ./sys/syz-sysgen | grep -q false || go install ./sys/syz-sysgen
make .descriptions
bin/syz-sysgen
syscall ioctl$CUSTOM_IOCTL_CREATE is unsupported on all arches (typo?)
make[2]: *** [Makefile:148: .descriptions] Error 1
make[1]: *** [Makefile:145: descriptions] Error 2
make: *** [Makefile:236: generate] Error 2
$git status
On branch master
Your branch is up to date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
sys/linux/custom_driver.txt