diff options
author | Khem Raj <raj.khem@gmail.com> | 2023-06-15 10:26:58 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2023-06-19 18:41:18 -0700 |
commit | 63b1dbd093c8efc13ad8fd0b58401fe8d91603e9 (patch) | |
tree | 65f44f998aa718e5f1557fbba69846e6912b4860 /meta-oe/recipes-test | |
parent | 39dfcaceba360374ada6aac7d8979c67752e9ba3 (diff) | |
download | meta-openembedded-63b1dbd093c8efc13ad8fd0b58401fe8d91603e9.tar.gz |
syzkaller: Upgrade to latest tip of trunk
- Enable cgo with this version
- Fix build with musl
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-test')
3 files changed, 44 insertions, 11 deletions
diff --git a/meta-oe/recipes-test/syzkaller/syzkaller/0001-executor-Include-missing-linux-falloc.h.patch b/meta-oe/recipes-test/syzkaller/syzkaller/0001-executor-Include-missing-linux-falloc.h.patch new file mode 100644 index 0000000000..23bfb9a5e2 --- /dev/null +++ b/meta-oe/recipes-test/syzkaller/syzkaller/0001-executor-Include-missing-linux-falloc.h.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | From 9db789b4498d4130450e988757914c03e42b40f5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Mon, 19 Jun 2023 18:33:36 -0700 | ||
4 | Subject: [PATCH] executor: Include missing linux/falloc.h | ||
5 | |||
6 | Its needed for FALLOC_FL_ZERO_RANGE which needs this header, it works | ||
7 | with glibc because fcntl.h includes this header indirectly, however the | ||
8 | failure comes to fore with musl C library where this header is not | ||
9 | included indirectly by other system headers, therefore include it as | ||
10 | required. | ||
11 | |||
12 | Fixes | ||
13 | In file included from executor/common.h:505: | ||
14 | executor/common_linux.h:5604:16: error: use of undeclared identifier 'FALLOC_FL_ZERO_RANGE' | ||
15 | fallocate(fd, FALLOC_FL_ZERO_RANGE, 0, SWAP_FILE_SIZE); | ||
16 | ^ | ||
17 | Upstream-Status: Submitted [https://github.com/google/syzkaller/pull/3974] | ||
18 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
19 | --- | ||
20 | executor/common_linux.h | 1 + | ||
21 | 1 file changed, 1 insertion(+) | ||
22 | |||
23 | diff --git a/executor/common_linux.h b/executor/common_linux.h | ||
24 | index d5152e058..9ae3fb159 100644 | ||
25 | --- a/executor/common_linux.h | ||
26 | +++ b/executor/common_linux.h | ||
27 | @@ -5585,6 +5585,7 @@ static long syz_pkey_set(volatile long pkey, volatile long val) | ||
28 | #include <sys/stat.h> | ||
29 | #include <sys/swap.h> | ||
30 | #include <sys/types.h> | ||
31 | +#include <linux/falloc.h> | ||
32 | |||
33 | #define SWAP_FILE "./swap-file" | ||
34 | #define SWAP_FILE_SIZE (128 * 1000 * 1000) // 128 MB. | ||
35 | -- | ||
36 | 2.41.0 | ||
37 | |||
diff --git a/meta-oe/recipes-test/syzkaller/syzkaller/0001-sys-targets-targets.go-allow-users-to-override-hardc.patch b/meta-oe/recipes-test/syzkaller/syzkaller/0001-sys-targets-targets.go-allow-users-to-override-hardc.patch index d647b8d4a0..61f4351651 100644 --- a/meta-oe/recipes-test/syzkaller/syzkaller/0001-sys-targets-targets.go-allow-users-to-override-hardc.patch +++ b/meta-oe/recipes-test/syzkaller/syzkaller/0001-sys-targets-targets.go-allow-users-to-override-hardc.patch | |||
@@ -18,11 +18,9 @@ Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> | |||
18 | sys/targets/targets.go | 19 +++++++++++-------- | 18 | sys/targets/targets.go | 19 +++++++++++-------- |
19 | 1 file changed, 11 insertions(+), 8 deletions(-) | 19 | 1 file changed, 11 insertions(+), 8 deletions(-) |
20 | 20 | ||
21 | diff --git a/sys/targets/targets.go b/sys/targets/targets.go | ||
22 | index f3be708f3..19a8bb681 100644 | ||
23 | --- a/sys/targets/targets.go | 21 | --- a/sys/targets/targets.go |
24 | +++ b/sys/targets/targets.go | 22 | +++ b/sys/targets/targets.go |
25 | @@ -258,7 +258,6 @@ var List = map[string]map[string]*Target{ | 23 | @@ -262,7 +262,6 @@ var List = map[string]map[string]*Target |
26 | PtrSize: 4, | 24 | PtrSize: 4, |
27 | PageSize: 4 << 10, | 25 | PageSize: 4 << 10, |
28 | LittleEndian: true, | 26 | LittleEndian: true, |
@@ -30,7 +28,7 @@ index f3be708f3..19a8bb681 100644 | |||
30 | Triple: "arm-linux-gnueabi", | 28 | Triple: "arm-linux-gnueabi", |
31 | KernelArch: "arm", | 29 | KernelArch: "arm", |
32 | KernelHeaderArch: "arm", | 30 | KernelHeaderArch: "arm", |
33 | @@ -670,12 +669,16 @@ func initTarget(target *Target, OS, arch string) { | 31 | @@ -700,12 +699,16 @@ func initTarget(target *Target, OS, arch |
34 | for i := range target.CFlags { | 32 | for i := range target.CFlags { |
35 | target.replaceSourceDir(&target.CFlags[i], sourceDir) | 33 | target.replaceSourceDir(&target.CFlags[i], sourceDir) |
36 | } | 34 | } |
@@ -53,15 +51,12 @@ index f3be708f3..19a8bb681 100644 | |||
53 | } | 51 | } |
54 | if target.CCompiler == "" { | 52 | if target.CCompiler == "" { |
55 | target.setCompiler(useClang) | 53 | target.setCompiler(useClang) |
56 | @@ -803,7 +806,7 @@ func (target *Target) lazyInit() { | 54 | @@ -839,7 +842,7 @@ func (target *Target) lazyInit() { |
57 | // On CI we want to fail loudly if cross-compilation breaks. | 55 | // On CI we want to fail loudly if cross-compilation breaks. |
58 | // Also fail if SOURCEDIR_GOOS is set b/c in that case user probably assumes it will work. | 56 | // Also fail if SOURCEDIR_GOOS is set b/c in that case user probably assumes it will work. |
59 | if (target.OS != runtime.GOOS || !runningOnCI) && os.Getenv("SOURCEDIR_"+strings.ToUpper(target.OS)) == "" { | 57 | if (target.OS != runtime.GOOS || !runningOnCI) && getSourceDir(target) == "" { |
60 | - if _, err := exec.LookPath(target.CCompiler); err != nil { | 58 | - if _, err := exec.LookPath(target.CCompiler); err != nil { |
61 | + if _, err := exec.LookPath(strings.Fields(target.CCompiler)[0]); err != nil { | 59 | + if _, err := exec.LookPath(strings.Fields(target.CCompiler)[0]); err != nil { |
62 | target.BrokenCompiler = fmt.Sprintf("%v is missing (%v)", target.CCompiler, err) | 60 | target.BrokenCompiler = fmt.Sprintf("%v is missing (%v)", target.CCompiler, err) |
63 | return | 61 | return |
64 | } | 62 | } |
65 | -- | ||
66 | 2.25.1 | ||
67 | |||
diff --git a/meta-oe/recipes-test/syzkaller/syzkaller_git.bb b/meta-oe/recipes-test/syzkaller/syzkaller_git.bb index f7c751f806..2adc06a2bc 100644 --- a/meta-oe/recipes-test/syzkaller/syzkaller_git.bb +++ b/meta-oe/recipes-test/syzkaller/syzkaller_git.bb | |||
@@ -8,8 +8,9 @@ GO_IMPORT = "github.com/google/syzkaller" | |||
8 | 8 | ||
9 | SRC_URI = "git://${GO_IMPORT};protocol=https;destsuffix=${BPN}-${PV}/src/${GO_IMPORT};branch=master \ | 9 | SRC_URI = "git://${GO_IMPORT};protocol=https;destsuffix=${BPN}-${PV}/src/${GO_IMPORT};branch=master \ |
10 | file://0001-sys-targets-targets.go-allow-users-to-override-hardc.patch;patchdir=src/${GO_IMPORT} \ | 10 | file://0001-sys-targets-targets.go-allow-users-to-override-hardc.patch;patchdir=src/${GO_IMPORT} \ |
11 | file://0001-executor-Include-missing-linux-falloc.h.patch;patchdir=src/${GO_IMPORT} \ | ||
11 | " | 12 | " |
12 | SRCREV = "67cb024cd1a3c95e311263a5c95e957f9abfd8ca" | 13 | SRCREV = "6d01f20890edf11b99bb54573025b11c1acd2d52" |
13 | 14 | ||
14 | COMPATIBLE_HOST = "(x86_64|i.86|arm|aarch64).*-linux" | 15 | COMPATIBLE_HOST = "(x86_64|i.86|arm|aarch64).*-linux" |
15 | 16 | ||
@@ -23,7 +24,7 @@ export TARGETOS = '${GOOS}' | |||
23 | export TARGETARCH = '${GOARCH}' | 24 | export TARGETARCH = '${GOARCH}' |
24 | export TARGETVMARCH = '${GOARCH}' | 25 | export TARGETVMARCH = '${GOARCH}' |
25 | 26 | ||
26 | CGO_ENABLED = "0" | 27 | CGO_ENABLED = "1" |
27 | 28 | ||
28 | DEPENDS:class-native += "qemu-system-native" | 29 | DEPENDS:class-native += "qemu-system-native" |
29 | 30 | ||