aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-test/syzkaller/syzkaller/0001-executor-Include-missing-linux-falloc.h.patch
blob: 23bfb9a5e2d45fa2fe700ab9e93cfd644e37bf2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From 9db789b4498d4130450e988757914c03e42b40f5 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 19 Jun 2023 18:33:36 -0700
Subject: [PATCH] executor: Include missing linux/falloc.h

Its needed for FALLOC_FL_ZERO_RANGE which needs this header, it works
with glibc because fcntl.h includes this header indirectly, however the
failure comes to fore with musl C library where this header is not
included indirectly by other system headers, therefore include it as
required.

Fixes
In file included from executor/common.h:505:
executor/common_linux.h:5604:16: error: use of undeclared identifier 'FALLOC_FL_ZERO_RANGE'
        fallocate(fd, FALLOC_FL_ZERO_RANGE, 0, SWAP_FILE_SIZE);
                      ^
Upstream-Status: Submitted [https://github.com/google/syzkaller/pull/3974]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 executor/common_linux.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/executor/common_linux.h b/executor/common_linux.h
index d5152e058..9ae3fb159 100644
--- a/executor/common_linux.h
+++ b/executor/common_linux.h
@@ -5585,6 +5585,7 @@ static long syz_pkey_set(volatile long pkey, volatile long val)
 #include <sys/stat.h>
 #include <sys/swap.h>
 #include <sys/types.h>
+#include <linux/falloc.h>
 
 #define SWAP_FILE "./swap-file"
 #define SWAP_FILE_SIZE (128 * 1000 * 1000) // 128 MB.
-- 
2.41.0