]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.14/bpf-fix-missing-prototype-warnings.patch
Linux 4.9.168
[thirdparty/kernel/stable-queue.git] / queue-4.14 / bpf-fix-missing-prototype-warnings.patch
1 From aafcf2f05b511a2166d738cec7b27cd90b8cc49b Mon Sep 17 00:00:00 2001
2 From: Valdis Kletnieks <valdis.kletnieks@vt.edu>
3 Date: Tue, 29 Jan 2019 01:04:25 -0500
4 Subject: bpf: fix missing prototype warnings
5
6 [ Upstream commit 116bfa96a255123ed209da6544f74a4f2eaca5da ]
7
8 Compiling with W=1 generates warnings:
9
10 CC kernel/bpf/core.o
11 kernel/bpf/core.c:721:12: warning: no previous prototype for ?bpf_jit_alloc_exec_limit? [-Wmissing-prototypes]
12 721 | u64 __weak bpf_jit_alloc_exec_limit(void)
13 | ^~~~~~~~~~~~~~~~~~~~~~~~
14 kernel/bpf/core.c:757:14: warning: no previous prototype for ?bpf_jit_alloc_exec? [-Wmissing-prototypes]
15 757 | void *__weak bpf_jit_alloc_exec(unsigned long size)
16 | ^~~~~~~~~~~~~~~~~~
17 kernel/bpf/core.c:762:13: warning: no previous prototype for ?bpf_jit_free_exec? [-Wmissing-prototypes]
18 762 | void __weak bpf_jit_free_exec(void *addr)
19 | ^~~~~~~~~~~~~~~~~
20
21 All three are weak functions that archs can override, provide
22 proper prototypes for when a new arch provides their own.
23
24 Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
25 Acked-by: Song Liu <songliubraving@fb.com>
26 Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
27 Signed-off-by: Sasha Levin <sashal@kernel.org>
28 ---
29 include/linux/filter.h | 4 +++-
30 1 file changed, 3 insertions(+), 1 deletion(-)
31
32 diff --git a/include/linux/filter.h b/include/linux/filter.h
33 index 42197b16dd78..56d2cda9931b 100644
34 --- a/include/linux/filter.h
35 +++ b/include/linux/filter.h
36 @@ -741,7 +741,9 @@ bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr,
37 unsigned int alignment,
38 bpf_jit_fill_hole_t bpf_fill_ill_insns);
39 void bpf_jit_binary_free(struct bpf_binary_header *hdr);
40 -
41 +u64 bpf_jit_alloc_exec_limit(void);
42 +void *bpf_jit_alloc_exec(unsigned long size);
43 +void bpf_jit_free_exec(void *addr);
44 void bpf_jit_free(struct bpf_prog *fp);
45
46 struct bpf_prog *bpf_jit_blind_constants(struct bpf_prog *fp);
47 --
48 2.19.1
49