]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.14.111/bpf-fix-missing-prototype-warnings.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.14.111 / bpf-fix-missing-prototype-warnings.patch
CommitLineData
04fd09d4
SL
1From aafcf2f05b511a2166d738cec7b27cd90b8cc49b Mon Sep 17 00:00:00 2001
2From: Valdis Kletnieks <valdis.kletnieks@vt.edu>
3Date: Tue, 29 Jan 2019 01:04:25 -0500
4Subject: bpf: fix missing prototype warnings
5
6[ Upstream commit 116bfa96a255123ed209da6544f74a4f2eaca5da ]
7
8Compiling with W=1 generates warnings:
9
10 CC kernel/bpf/core.o
11kernel/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 | ^~~~~~~~~~~~~~~~~~~~~~~~
14kernel/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 | ^~~~~~~~~~~~~~~~~~
17kernel/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
21All three are weak functions that archs can override, provide
22proper prototypes for when a new arch provides their own.
23
24Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
25Acked-by: Song Liu <songliubraving@fb.com>
26Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
27Signed-off-by: Sasha Levin <sashal@kernel.org>
28---
29 include/linux/filter.h | 4 +++-
30 1 file changed, 3 insertions(+), 1 deletion(-)
31
32diff --git a/include/linux/filter.h b/include/linux/filter.h
33index 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--
482.19.1
49