[PATCH net-next] bpfilter: don't pass O_CREAT when opening console for debug

Subsystems: networking [general], the rest

STALE2995d

3 messages, 3 authors, 2018-05-24 · open the first message on its own page

[PATCH net-next] bpfilter: don't pass O_CREAT when opening console for debug

From: Jakub Kicinski <hidden>
Date: 2018-05-24 07:41:29

Passing O_CREAT (00000100) to open means we should also pass file
mode as the third parameter.  Creating /dev/console as a regular
file may not be helpful anyway, so simply drop the flag when
opening debug_fd.

Fixes: d2ba09c17a06 ("net: add skeleton of bpfilter kernel module")
Signed-off-by: Jakub Kicinski <redacted>
---
 net/bpfilter/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bpfilter/main.c b/net/bpfilter/main.c
index 81bbc1684896..1317f108df8a 100644
--- a/net/bpfilter/main.c
+++ b/net/bpfilter/main.c
@@ -55,7 +55,7 @@ static void loop(void)
 
 int main(void)
 {
-	debug_fd = open("/dev/console", 00000002 | 00000100);
+	debug_fd = open("/dev/console", 00000002);
 	dprintf(debug_fd, "Started bpfilter\n");
 	loop();
 	close(debug_fd);
-- 
2.17.0

Re: [PATCH net-next] bpfilter: don't pass O_CREAT when opening console for debug

From: Daniel Borkmann <daniel@iogearbox.net>
Date: 2018-05-24 10:33:05

On 05/24/2018 09:41 AM, Jakub Kicinski wrote:
Passing O_CREAT (00000100) to open means we should also pass file
mode as the third parameter.  Creating /dev/console as a regular
file may not be helpful anyway, so simply drop the flag when
opening debug_fd.

Fixes: d2ba09c17a06 ("net: add skeleton of bpfilter kernel module")
Signed-off-by: Jakub Kicinski <redacted>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>

Re: [PATCH net-next] bpfilter: don't pass O_CREAT when opening console for debug

From: David Miller <davem@davemloft.net>
Date: 2018-05-24 13:37:44

From: Jakub Kicinski <redacted>
Date: Thu, 24 May 2018 00:41:19 -0700
Passing O_CREAT (00000100) to open means we should also pass file
mode as the third parameter.  Creating /dev/console as a regular
file may not be helpful anyway, so simply drop the flag when
opening debug_fd.

Fixes: d2ba09c17a06 ("net: add skeleton of bpfilter kernel module")
Signed-off-by: Jakub Kicinski <redacted>
Applied, thanks Jakub.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help