On running 'make extract'

22 views
Skip to first unread message

Dmitry Antipov

unread,
Oct 15, 2025, 10:48:54 AMOct 15
to syzk...@googlegroups.com
What kernel version is expected to be used when doing 'make extract'? Running against
current upstream on Fedora 42 with gcc 15.2.1, I've got:

$ make extract TARGETOS=linux SOURCEDIR=/home/antipov/projects/kernel/sources/upstream
Makefile:31: run command via tools/syz-env for best compatibility, see:
Makefile:32: https://github.com/google/syzkaller/blob/master/docs/contributing.md#using-syz-env
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w -X github.com/google/syzkaller/prog.GitRevision=b6605ba8b96835063c5eb766c38d27fac98b84d4 -X
github.com/google/syzkaller/prog.gitRevisionDate=20251013-102005" -o bin/syz-extract ./sys/syz-extract
bin/syz-extract -build -os=linux -sourcedir=/home/antipov/projects/kernel/sources/upstream
generating linux/386...
acpi_thermal_rel.txt: failed to run compiler: x86_64-linux-gnu-gcc [-nostdinc -w -fmessage-length=0 -O3 -I. -D__KERNEL__ -DKBUILD_MODNAME="-" -DKBUILD_MODFILE="-" -D__LINUX_ARM_ARCH__=7
-I/home/antipov/projects/kernel/sources/upstream/arch/x86/include -I/tmp/syzkaller-kernel-build4095482670/arch/x86/include/generated/uapi
-I/tmp/syzkaller-kernel-build4095482670/arch/x86/include/generated -I/home/antipov/projects/kernel/sources/upstream/arch/x86/include/asm/mach-malta
-I/home/antipov/projects/kernel/sources/upstream/arch/x86/include/asm/mach-generic -I/tmp/syzkaller-kernel-build4095482670/include -I/home/antipov/projects/kernel/sources/upstream/include
-I/home/antipov/projects/kernel/sources/upstream/arch/x86/include/uapi -I/home/antipov/projects/kernel/sources/upstream/include/uapi -I/tmp/syzkaller-kernel-build4095482670/include/generated/uapi
-I/home/antipov/projects/kernel/sources/upstream -I/home/antipov/projects/kernel/sources/upstream/include/linux -I/tmp/syzkaller-kernel-build4095482670/syzkaller -include
/home/antipov/projects/kernel/sources/upstream/include/linux/kconfig.h -m32 -O2 -pthread -Wall -Werror -Wparentheses -Wframe-larger-than=16384]
exit status 1
In file included from /home/antipov/projects/kernel/sources/upstream/include/uapi/linux/posix_types.h:5,
from /home/antipov/projects/kernel/sources/upstream/include/uapi/linux/types.h:14,
from /home/antipov/projects/kernel/sources/upstream/include/linux/types.h:6,
from /home/antipov/projects/kernel/sources/upstream/include/linux/kasan-checks.h:5,
from /home/antipov/projects/kernel/sources/upstream/include/asm-generic/rwonce.h:26,
from /tmp/syzkaller-kernel-build4095482670/arch/x86/include/generated/asm/rwonce.h:1,
from /home/antipov/projects/kernel/sources/upstream/include/linux/compiler.h:382,
from /home/antipov/projects/kernel/sources/upstream/include/linux/build_bug.h:5,
from /home/antipov/projects/kernel/sources/upstream/include/linux/bits.h:30,
from /home/antipov/projects/kernel/sources/upstream/include/linux/ioport.h:13,
from /home/antipov/projects/kernel/sources/upstream/include/linux/acpi.h:12,
from <stdin>:7:
/home/antipov/projects/kernel/sources/upstream/include/linux/stddef.h:11:9: error: cannot use keyword ‘false’ as enumeration constant
11 | false = 0,
| ^~~~~
/home/antipov/projects/kernel/sources/upstream/include/linux/stddef.h:11:9: note: ‘false’ is a keyword with ‘-std=c23’ onwards
/home/antipov/projects/kernel/sources/upstream/include/linux/types.h:35:33: error: ‘bool’ cannot be defined via ‘typedef’
35 | typedef _Bool bool;
| ^~~~
/home/antipov/projects/kernel/sources/upstream/include/linux/types.h:35:33: note: ‘bool’ is a keyword with ‘-std=c23’ onwards

This is (almost) obvious since the kernel's Makefile explicitly requires '-std=gnu11'. So, after

diff --git a/sys/syz-extract/linux.go b/sys/syz-extract/linux.go
index 28354dcbb..a030b4a14 100644
--- a/sys/syz-extract/linux.go
+++ b/sys/syz-extract/linux.go
@@ -134,6 +134,7 @@ func (*linux) processFile(arch *Arch, info *compiler.ConstInfo) (map[string]uint
args := []string{
// This makes the build completely hermetic, only kernel headers are used.
"-nostdinc",
+ "-std=gnu11",
"-w", "-fmessage-length=0",
"-O3", // required to get expected values for some __builtin_constant_p
"-I.",

the next thing is:

$ make extract TARGETOS=linux SOURCEDIR=/home/antipov/projects/kernel/sources/upstream
Makefile:31: run command via tools/syz-env for best compatibility, see:
Makefile:32: https://github.com/google/syzkaller/blob/master/docs/contributing.md#using-syz-env
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w -X github.com/google/syzkaller/prog.GitRevision=b6605ba8b96835063c5eb766c38d27fac98b84d4+ -X
github.com/google/syzkaller/prog.gitRevisionDate=20251013-102005" -o bin/syz-extract ./sys/syz-extract
bin/syz-extract -build -os=linux -sourcedir=/home/antipov/projects/kernel/sources/upstream
generating linux/386...
sys.txt: failed to run compiler: x86_64-linux-gnu-gcc [-nostdinc -std=gnu11 -w -fmessage-length=0 -O3 -I. -D__KERNEL__ -DKBUILD_MODNAME="-" -DKBUILD_MODFILE="-" -D__LINUX_ARM_ARCH__=7
-I/home/antipov/projects/kernel/sources/upstream/arch/x86/include -I/tmp/syzkaller-kernel-build696475947/arch/x86/include/generated/uapi
-I/tmp/syzkaller-kernel-build696475947/arch/x86/include/generated -I/home/antipov/projects/kernel/sources/upstream/arch/x86/include/asm/mach-malta
-I/home/antipov/projects/kernel/sources/upstream/arch/x86/include/asm/mach-generic -I/tmp/syzkaller-kernel-build696475947/include -I/home/antipov/projects/kernel/sources/upstream/include
-I/home/antipov/projects/kernel/sources/upstream/arch/x86/include/uapi -I/home/antipov/projects/kernel/sources/upstream/include/uapi -I/tmp/syzkaller-kernel-build696475947/include/generated/uapi
-I/home/antipov/projects/kernel/sources/upstream -I/home/antipov/projects/kernel/sources/upstream/include/linux -I/tmp/syzkaller-kernel-build696475947/syzkaller -include
/home/antipov/projects/kernel/sources/upstream/include/linux/kconfig.h -m32 -O2 -pthread -Wall -Werror -Wparentheses -Wframe-larger-than=16384]
exit status 1
In file included from <stdin>:93:
/home/antipov/projects/kernel/sources/upstream/fs/overlayfs/overlayfs.h: In function ‘ovl_do_getxattr’:
/home/antipov/projects/kernel/sources/upstream/fs/overlayfs/overlayfs.h:283:15: error: implicit declaration of function ‘vfs_getxattr’; did you mean ‘vfs_getattr’? [-Wimplicit-function-declaration]
283 | err = vfs_getxattr(mnt_idmap(path->mnt), path->dentry,
| ^~~~~~~~~~~~
| vfs_getattr
/home/antipov/projects/kernel/sources/upstream/fs/overlayfs/overlayfs.h: In function ‘ovl_do_setxattr’:
/home/antipov/projects/kernel/sources/upstream/fs/overlayfs/overlayfs.h:317:19: error: implicit declaration of function ‘vfs_setxattr’; did you mean ‘vfs_getattr’? [-Wimplicit-function-declaration]
317 | int err = vfs_setxattr(ovl_upper_mnt_idmap(ofs), dentry, name,
| ^~~~~~~~~~~~
| vfs_getattr
/home/antipov/projects/kernel/sources/upstream/fs/overlayfs/overlayfs.h: In function ‘ovl_do_removexattr’:
/home/antipov/projects/kernel/sources/upstream/fs/overlayfs/overlayfs.h:335:19: error: implicit declaration of function ‘vfs_removexattr’; did you mean ‘vfs_remove_acl’? [-Wimplicit-function-declaration]
335 | int err = vfs_removexattr(ovl_upper_mnt_idmap(ofs), dentry, name);
| ^~~~~~~~~~~~~~~
| vfs_remove_acl
...

Dmitry

Aleksandr Nogikh

unread,
Oct 22, 2025, 5:03:04 AMOct 22
to Dmitry Antipov, syzk...@googlegroups.com, Pimyn Girgis
Hi Dmitry,

On Wed, Oct 15, 2025 at 4:48 PM Dmitry Antipov <dman...@yandex.ru> wrote:
>
> What kernel version is expected to be used when doing 'make extract'? Running against
> current upstream on Fedora 42 with gcc 15.2.1, I've got:

AFAIK we used to run it on the latest linux-next.
That's interesting because I see neither the problem above nor the
problem below when I run from under our `syz-env` Docker container:
./tools/syz-env make extract SOURCEDIR=$HOME/linux
I'd recommend trying it this way, too.

I see only the following error:
dev_msm.txt: MSM_SUBMIT_SYNCOBJ_RESET is unsupported on all arches (typo?)

But that's seemingly due to the fact that we haven't updated our
constants for a while, and some are no longer present. The next time
we update them, we'll have to explicitly define these in the syzlang
descriptions so that `make extract` can proceed.

Dmitry Antipov

unread,
Oct 22, 2025, 11:37:47 AMOct 22
to Aleksandr Nogikh, syzk...@googlegroups.com, Pimyn Girgis
On 10/22/25 12:02 PM, 'Aleksandr Nogikh' via syzkaller wrote:

> That's interesting because I see neither the problem above nor the
> problem below when I run from under our `syz-env` Docker container:
> ./tools/syz-env make extract SOURCEDIR=$HOME/linux
> I'd recommend trying it this way, too.

So this creates an environment with ancient (and unsupported, see
https://gcc.gnu.org/gcc-12) tools like GCC 12.

Any chance to get this to work inside a reasonably recent environment?

Dmitry

Aleksandr Nogikh

unread,
Oct 27, 2025, 5:23:15 AMOct 27
to Dmitry Antipov, syzk...@googlegroups.com, Pimyn Girgis
I've filed https://github.com/google/syzkaller/issues/6432 to update
our containers and figure out what breaks when using new gcc versions.

>
> Dmitry

Dmitry Antipov

unread,
Oct 28, 2025, 9:52:03 AM (13 days ago) Oct 28
to Aleksandr Nogikh, syzk...@googlegroups.com, Pimyn Girgis
On 10/27/25 12:23 PM, Aleksandr Nogikh wrote:

> I've filed https://github.com/google/syzkaller/issues/6432 to update
> our containers and figure out what breaks when using new gcc versions.
To whom it may be interesting, I've almost succeeded with 'make extract':

$ make TARGETOS=linux SOURCEDIR=/home/antipov/projects/kernel/sources/linux-next extract
Makefile:31: run command via tools/syz-env for best compatibility, see:
Makefile:32: https://github.com/google/syzkaller/blob/master/docs/contributing.md#using-syz-env
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w -X github.com/google/syzkaller/prog.GitRevision=fd2207e7cf691493b5b81c50a8a625b4b71dd544+ -X
github.com/google/syzkaller/prog.gitRevisionDate=20251027-090055" -o bin/syz-extract ./sys/syz-extract
bin/syz-extract -build -os=linux -sourcedir=/home/antipov/projects/kernel/sources/linux-next
generating linux/386...
generating linux/amd64...
generating linux/arm...
generating linux/arm64...
generating linux/mips64le...
generating linux/ppc64le...
generating linux/riscv64...
generating linux/s390x...
dev_msm.txt: MSM_SUBMIT_SYNCOBJ_RESET is unsupported on all arches (typo?)
make: *** [Makefile:235: extract] Error 1

on Fedora 42 using the latest linux-next, cross-compilers bundled into a distribution
and the following quirks:

diff --git a/sys/syz-extract/linux.go b/sys/syz-extract/linux.go
index 28354dcbb..1ad3750de 100644
--- a/sys/syz-extract/linux.go
+++ b/sys/syz-extract/linux.go
@@ -132,6 +132,10 @@ func (*linux) processFile(arch *Arch, info *compiler.ConstInfo) (map[string]uint
sourceDir := arch.sourceDir
buildDir := arch.buildDir
args := []string{
+ // This is explicitly required by never kernels and tools.
+ "-std=gnu11",
+ // EFI kernel headers uses wide character constants.
+ "-fshort-wchar",
// This makes the build completely hermetic, only kernel headers are used.
"-nostdinc",
"-w", "-fmessage-length=0",
diff --git a/sys/targets/targets.go b/sys/targets/targets.go
index a076d2710..ded26cee4 100644
--- a/sys/targets/targets.go
+++ b/sys/targets/targets.go
@@ -304,7 +304,7 @@ var List = map[string]map[string]*Target{
VMArch: ARM64,
PtrSize: 4,
PageSize: 4 << 10,
- Triple: "arm-linux-gnueabi",
+ Triple: "arm-linux-gnu",
KernelArch: "arm",
KernelHeaderArch: "arm",
},
@@ -312,7 +312,7 @@ var List = map[string]map[string]*Target{
PtrSize: 8,
PageSize: 4 << 10,
CFlags: []string{"-march=mips64r2", "-mabi=64", "-EL"},
- Triple: "mips64el-linux-gnuabi64",
+ Triple: "mips64-linux-gnu",
KernelArch: "mips",
KernelHeaderArch: "mips",
},
@@ -593,6 +593,7 @@ var (
"-Wparentheses",
"-Wunused-const-variable",
"-Wframe-larger-than=16384", // executor uses stacks of limited size, so no jumbo frames
+ "-Wno-implicit-function-declaration",
"-Wno-stringop-overflow",
"-Wno-array-bounds",
"-Wno-format-overflow",

Dmitry


Reply all
Reply to author
Forward
0 new messages