Skip to contentSkip to conversation

kdb: include header in signal handling code

PATCH In review Arnd Bergmann 5 participants 6 messages May 17, 2023 – Jun 30, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kdb: include header in signal handling code

From: Arnd Bergmann <[email protected]>

kdb_send_sig() is defined in the signal code and called from kdb, but the declaration is part of the kdb internal code. Include this from signal.c as well to avoid the warning:

kernel/signal.c:4789:6: error: no previous prototype for 'kdb_send_sig' [-Werror=missing-prototypes]

---
 kernel/signal.c | 2 ++
 1 file changed, 2 insertions(+)
kernel/signal.c +2 -0
index 8f6330f0e9ca..d38df14f71ac 100644
@@ -4780,6 +4780,8 @@ void __init signals_init(void)
 
 #ifdef CONFIG_KGDB_KDB
 #include <linux/kdb.h>
+#include "debug/kdb/kdb_private.h"
+
 /*
  * kdb_send_sig - Allows kdb to send signals without exposing
  * signal internals.  This function checks if the required locks are
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 7 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

kdb_send_sig() is defined in the signal code and called from kdb, but the declaration is part of the kdb internal code. Include this from signal.c as well to avoid the warning:

Quoted 6 lines

kernel/signal.c:4789:6: error: no previous prototype for 'kdb_send_sig' [-Werror=missing-prototypes]

---
 kernel/signal.c | 2 ++
 1 file changed, 2 insertions(+)
Reviewed-by on v1 1/1
#2 lore raw
In reply to Arnd Bergmann
Quoted 9 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

kdb_send_sig() is defined in the signal code and called from kdb, but the declaration is part of the kdb internal code. Include this from signal.c as well to avoid the warning:

kernel/signal.c:4789:6: error: no previous prototype for 'kdb_send_sig' [-Werror=missing-prototypes]

Signature · 1 line
Kees Cook
#3 lore raw
In reply to Arnd Bergmann
Quoted 9 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

kdb_send_sig() is defined in the signal code and called from kdb, but the declaration is part of the kdb internal code. Include this from signal.c as well to avoid the warning:

kernel/signal.c:4789:6: error: no previous prototype for 'kdb_send_sig' [-Werror=missing-prototypes]

Sorry to be so late with this feedback! I got as far as queuing this up for merge before the penny dropped...

Quoted 9 lines
---
 kernel/signal.c | 2 ++
 1 file changed, 2 insertions(+)
kernel/signal.c +0 -0
index 8f6330f0e9ca..d38df14f71ac 100644

kernel/signal.c void __init signals_init(void) · line 4784

Quoted 5 lines
kernel/signal.c +2 -0
@@ -4780,6 +4780,8 @@ void __init signals_init(void)
 
 #ifdef CONFIG_KGDB_KDB
 #include <linux/kdb.h>
+#include "debug/kdb/kdb_private.h"
+

Isn't is better to move the prototype for kdb_send_sig() into linux/kdb.h instead?

That's what other kdb helpers spread across the kernel do (kdb_walk_kallsyms() for example).

Daniel.

#4 lore raw
Quoted 15 lines · Daniel Thompson

kernel/signal.c void __init signals_init(void) · line 4784

Quoted 10 lines · Arnd Bergmann
kernel/signal.c +2 -0
index 8f6330f0e9ca..d38df14f71ac 100644
@@ -4780,6 +4780,8 @@ void __init signals_init(void)
 
 #ifdef CONFIG_KGDB_KDB
 #include <linux/kdb.h>
+#include "debug/kdb/kdb_private.h"
+

Isn't is better to move the prototype for kdb_send_sig() into linux/kdb.h instead?

Quoted 2 lines

That's what other kdb helpers spread across the kernel do (kdb_walk_kallsyms() for example).

Right, that is probably better here. Not sure if it's worth reworking the branch if you already merged it, the difference seems rather minor.

Arnd

#5 lore raw
Quoted 16 lines · Arnd Bergmann
Quoted 15 lines · Daniel Thompson

kernel/signal.c void __init signals_init(void) · line 4784

Quoted 10 lines · Arnd Bergmann
kernel/signal.c +2 -0
index 8f6330f0e9ca..d38df14f71ac 100644
@@ -4780,6 +4780,8 @@ void __init signals_init(void)
 
 #ifdef CONFIG_KGDB_KDB
 #include <linux/kdb.h>
+#include "debug/kdb/kdb_private.h"
+

Isn't is better to move the prototype for kdb_send_sig() into linux/kdb.h instead?

Quoted 6 lines
Quoted 2 lines

That's what other kdb helpers spread across the kernel do (kdb_walk_kallsyms() for example).

Right, that is probably better here. Not sure if it's worth reworking the branch if you already merged it, the difference seems rather minor.

I figure it will take me as long to rework the branch as it will to write the covering letter on the pull-request to explain why kgdb/kdb is messing around in kernel/signal.c ;-) .

Daniel.