Skip to content

Commit 54a7d50

Browse files
committed
x86: mark kprobe templates as character arrays, not single characters
They really are, and the "take the address of a single character" makes the string fortification code unhappy (it believes that you can now only acccess one byte, rather than a byte range, and then raises errors for the memory copies going on in there). We could now remove a few 'addressof' operators (since arrays naturally degrade to pointers), but this is the minimal patch that just changes the C prototypes of those template arrays (the templates themselves are defined in inline asm). Reported-by: kernel test robot <[email protected]> Acked-and-tested-by: Masami Hiramatsu <[email protected]> Cc: Daniel Micay <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 791f2df commit 54a7d50

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/x86/include/asm/kprobes.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ typedef u8 kprobe_opcode_t;
5252
#define flush_insn_slot(p) do { } while (0)
5353

5454
/* optinsn template addresses */
55-
extern __visible kprobe_opcode_t optprobe_template_entry;
56-
extern __visible kprobe_opcode_t optprobe_template_val;
57-
extern __visible kprobe_opcode_t optprobe_template_call;
58-
extern __visible kprobe_opcode_t optprobe_template_end;
55+
extern __visible kprobe_opcode_t optprobe_template_entry[];
56+
extern __visible kprobe_opcode_t optprobe_template_val[];
57+
extern __visible kprobe_opcode_t optprobe_template_call[];
58+
extern __visible kprobe_opcode_t optprobe_template_end[];
5959
#define MAX_OPTIMIZED_LENGTH (MAX_INSN_SIZE + RELATIVE_ADDR_SIZE)
6060
#define MAX_OPTINSN_SIZE \
6161
(((unsigned long)&optprobe_template_end - \

0 commit comments

Comments
 (0)