make generate step is failing

274 views
Skip to first unread message

Tushar Vyavahare

unread,
Jun 23, 2022, 7:10:02 AM6/23/22
to syzkaller
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.md

1.    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

Aleksandr Nogikh

unread,
Jun 23, 2022, 7:11:58 AM6/23/22
to Tushar Vyavahare, syzkaller
Hi,

Note that you also need to specify in the descriptions file where
exactly syzkaller can find your CUSTOM_IOCTL_CREATE constant. Grep
sys/linux folder for "include <" string and you'll see some examples.

Best Regards,
Aleksandr
> --
> You received this message because you are subscribed to the Google Groups "syzkaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller/12498349-8732-44a7-8347-e1a4ab58ca54n%40googlegroups.com.

Tushar Vyavahare

unread,
Jun 23, 2022, 8:42:12 AM6/23/22
to syzkaller
Thanks Aleks for quick response :)

After adding related header files , I am able to execute below commands:
    • $bin/syz-extract -os linux -arch amd64 -sourcedir $KSRC -builddir $LINUXBLD custom_driver.txt
    • $make generate
    • $make
    -Tushar
    Reply all
    Reply to author
    Forward
    0 new messages