Re: [PATCH] seccomp: Add missing return in non-void function

From
Kees Cook <hidden>
Date
2021-01-11 20:05:53
Also in
lkml
Reply to
Paul Cercueil, 2021-01-11
On Mon, Jan 11, 2021 at 05:28:39PM +0000, Paul Cercueil wrote:
We don't actually care about the value, since the kernel will panic
before that; but a value should nonetheless be returned, otherwise the
compiler will complain.

Fixes: 8112c4f140fa ("seccomp: remove 2-phase API")
Cc: <redacted> # 4.7+
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Ah, yes, thanks. What was the build config where this actually got
exposed?
quoted hunk ↗ jump to hunk
---
 kernel/seccomp.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/kernel/seccomp.c b/kernel/seccomp.c
index 952dc1c90229..63b40d12896b 100644
--- a/kernel/seccomp.c
+++ b/kernel/seccomp.c
@@ -1284,6 +1284,8 @@ static int __seccomp_filter(int this_syscall, const struct seccomp_data *sd,
 			    const bool recheck_after_trace)
 {
 	BUG();
+
+	return -1;
 }
 #endif
 
-- 
2.29.2
-- 
Kees Cook
Thread (4 messages) 4 messages, 2 authors, last reply 2021-01-11
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help