Hi
This is Anurag Verma from Broadcom Inc.
I am using syzkaller for fuzzing linux kernel and I have added a new system call in my custom kernel source. The system is fully added in the custom kernel and am able to access it through a user program post reboot.
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 sisips.txt in which I have mentioned the system call. Here is the entry of this file:
# Copyright 2018 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.
include <uapi/linux/a.out.h>
include <uapi/linux/elf.h>
sisips_AppfireCreateProcess(file ptr[in, filename], argv ptr[in, array[ptr[in, string]]], envp ptr[in, array[ptr[in, string]]])
2. After that I followed the above link especially the section Non-mainline subsystems and ran following commands at bash prompt.
# export SRCDIR="/mnt/nfs_datadisk_sdc_dev_projects/linux_kernel_source_code/ubuntu/5.4.0-66.74.CUSTOM_KERNEL_WITH_BRCM_SYSCALLS_WITH_DCS_DRIVERS_SUPPORTED.default_kernel_build/linux-5.4.0"
# make bin/syz-extract
# bin/syz-extract -os linux -arch amd64 -sourcedir "$SRCDIR" sisips.txt
The issue is that every time I get following error:
GOOS=linux GOARCH=amd64 go build "-ldflags=-s -w -X github.com/google/syzkaller/prog.GitRevision=5c2fe34603646834e7fdb710c1b128aac772f772+ -X 'github.com/google/syzkaller/prog.gitRevisionDate=20210608-094917'" -o bin/syz-extract ./sys/syz-extract
generating linux/amd64...
sisips.txt: failed to run compiler: gcc [-nostdinc -w -fmessage-length=0 -O3 -I. -D__KERNEL__ -DKBUILD_MODNAME="-" -I/mnt/nfs_datadisk_sdc_dev_projects/linux_kernel_source_code/ubuntu/5.4.0-66.74.CUSTOM_KERNEL_WITH_BRCM_SYSCALLS_WITH_DCS_DRIVERS_SUPPORTED.default_kernel_build/linux-5.4.0/arch/x86/include -I/mnt/nfs_datadisk_sdc_dev_projects/linux_kernel_source_code/ubuntu/5.4.0-66.74.CUSTOM_KERNEL_WITH_BRCM_SYSCALLS_WITH_DCS_DRIVERS_SUPPORTED.default_kernel_build/linux-5.4.0/arch/x86/include/generated/uapi -I/mnt/nfs_datadisk_sdc_dev_projects/linux_kernel_source_code/ubuntu/5.4.0-66.74.CUSTOM_KERNEL_WITH_BRCM_SYSCALLS_WITH_DCS_DRIVERS_SUPPORTED.default_kernel_build/linux-5.4.0/arch/x86/include/generated -I/mnt/nfs_datadisk_sdc_dev_projects/linux_kernel_source_code/ubuntu/5.4.0-66.74.CUSTOM_KERNEL_WITH_BRCM_SYSCALLS_WITH_DCS_DRIVERS_SUPPORTED.default_kernel_build/linux-5.4.0/arch/x86/include/asm/mach-malta -I/mnt/nfs_datadisk_sdc_dev_projects/linux_kernel_source_code/ubuntu/5.4.0-66.74.CUSTOM_KERNEL_WITH_BRCM_SYSCALLS_WITH_DCS_DRIVERS_SUPPORTED.default_kernel_build/linux-5.4.0/arch/x86/include/asm/mach-generic -I/mnt/nfs_datadisk_sdc_dev_projects/linux_kernel_source_code/ubuntu/5.4.0-66.74.CUSTOM_KERNEL_WITH_BRCM_SYSCALLS_WITH_DCS_DRIVERS_SUPPORTED.default_kernel_build/linux-5.4.0/include -I/mnt/nfs_datadisk_sdc_dev_projects/linux_kernel_source_code/ubuntu/5.4.0-66.74.CUSTOM_KERNEL_WITH_BRCM_SYSCALLS_WITH_DCS_DRIVERS_SUPPORTED.default_kernel_build/linux-5.4.0/include -I/mnt/nfs_datadisk_sdc_dev_projects/linux_kernel_source_code/ubuntu/5.4.0-66.74.CUSTOM_KERNEL_WITH_BRCM_SYSCALLS_WITH_DCS_DRIVERS_SUPPORTED.default_kernel_build/linux-5.4.0/arch/x86/include/uapi -I/mnt/nfs_datadisk_sdc_dev_projects/linux_kernel_source_code/ubuntu/5.4.0-66.74.CUSTOM_KERNEL_WITH_BRCM_SYSCALLS_WITH_DCS_DRIVERS_SUPPORTED.default_kernel_build/linux-5.4.0/arch/x86/include/generated/uapi -I/mnt/nfs_datadisk_sdc_dev_projects/linux_kernel_source_code/ubuntu/5.4.0-66.74.CUSTOM_KERNEL_WITH_BRCM_SYSCALLS_WITH_DCS_DRIVERS_SUPPORTED.default_kernel_build/linux-5.4.0/include/uapi -I/mnt/nfs_datadisk_sdc_dev_projects/linux_kernel_source_code/ubuntu/5.4.0-66.74.CUSTOM_KERNEL_WITH_BRCM_SYSCALLS_WITH_DCS_DRIVERS_SUPPORTED.default_kernel_build/linux-5.4.0/include/generated/uapi -I/mnt/nfs_datadisk_sdc_dev_projects/linux_kernel_source_code/ubuntu/5.4.0-66.74.CUSTOM_KERNEL_WITH_BRCM_SYSCALLS_WITH_DCS_DRIVERS_SUPPORTED.default_kernel_build/linux-5.4.0 -I/mnt/nfs_datadisk_sdc_dev_projects/linux_kernel_source_code/ubuntu/5.4.0-66.74.CUSTOM_KERNEL_WITH_BRCM_SYSCALLS_WITH_DCS_DRIVERS_SUPPORTED.default_kernel_build/linux-5.4.0/include/linux -I/mnt/nfs_datadisk_sdc_dev_projects/linux_kernel_source_code/ubuntu/5.4.0-66.74.CUSTOM_KERNEL_WITH_BRCM_SYSCALLS_WITH_DCS_DRIVERS_SUPPORTED.default_kernel_build/linux-5.4.0/syzkaller -include /mnt/nfs_datadisk_sdc_dev_projects/linux_kernel_source_code/ubuntu/5.4.0-66.74.CUSTOM_KERNEL_WITH_BRCM_SYSCALLS_WITH_DCS_DRIVERS_SUPPORTED.default_kernel_build/linux-5.4.0/include/linux/kconfig.h -m64 -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -static]
exit status 1
In file included from <command-line>:0:0:
/mnt/nfs_datadisk_sdc_dev_projects/linux_kernel_source_code/ubuntu/5.4.0-66.74.CUSTOM_KERNEL_WITH_BRCM_SYSCALLS_WITH_DCS_DRIVERS_SUPPORTED.default_kernel_build/linux-5.4.0/include/linux/kconfig.h:5:10: fatal error: generated/autoconf.h: No such file or directory
#include <generated/autoconf.h>
^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
The fact is that I am able to compile my kernel source successfully and no issues observed there. Please let me know what am I missing here when I try to add a new system call in syzkaller.
Thanks and Regards
/A\nurag \V/erma
RnD Engineer
Broadcom Inc
--
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/2b914d63-ba5c-4db9-962d-a6188dfcb345n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller/4e942178-af69-413d-a8ee-a3128e7b9b8an%40googlegroups.com.
Thanks Aleksandr,
Appreciate your timely reply.
I’ll do the needful as you suggested and share the results.
Regards,