Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

parisc/kprobes: always include asm-generic/kprobes.h

The NOKPROBE_SYMBOL macro (and others) were moved to
asm-generic/kprobes.h in 2017 by commit 7d134b2ce639 ("kprobes: move
kprobe declarations to asm-generic/kprobes.h"), and this new header
was included by asm/kprobes.h unconditionally on all architectures.

When kprobe support was added to parisc in 2017 by commit
8858ac8e9e9b1 ("parisc: Implement kprobes"), that header was only
included when CONFIG_KPROBES was enabled.

This can lead to build failures when NOKPROBE_SYMBOL is used, but
CONFIG_KPROBES is disabled. This mistake however was never actually
noticed because linux/kprobes.h also includes asm-generic/kprobes.h
(though I do not understand why that is, because it also includes
asm/kprobes.h).

To prevent eventual build failures, I suggest to always include
asm-generic/kprobes.h on parisc, just like all the other architectures
do. This way, including asm/kprobes.h suffices, and nobody (outside
of arch/) ever needs to explicitly include asm-generic/kprobes.h.

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Signed-off-by: Helge Deller <deller@gmx.de>

authored by

Max Kellermann and committed by
Helge Deller
f945a404 250f5402

+2 -1
+2 -1
arch/parisc/include/asm/kprobes.h
··· 10 10 #ifndef _PARISC_KPROBES_H 11 11 #define _PARISC_KPROBES_H 12 12 13 + #include <asm-generic/kprobes.h> 14 + 13 15 #ifdef CONFIG_KPROBES 14 16 15 - #include <asm-generic/kprobes.h> 16 17 #include <linux/types.h> 17 18 #include <linux/ptrace.h> 18 19 #include <linux/notifier.h>