Skip to contentSkip to conversation

Query: How to blacklist asm symbols for kprobe

DISCUSSION Pratyush Anand 2 participants 3 messages Jun 29, 2015 – Jul 6, 2015

lore
Share & tools
lore
#0 lore raw

Hi,

There might be some symbols defined in asm file, which need to be prevented for kprobe-ing.

For example, el0_sync, el1_sync, el0_dbg, el1_dbg etc (in arch/arm64/kernel/entry.S) should be added to the kprobe blacklist table. How can we do that?

~Pratyush

#1 lore raw
Quoted 8 lines · Pratyush Anand

Hi,

There might be some symbols defined in asm file, which need to be prevented for kprobe-ing.

For example, el0_sync, el1_sync, el0_dbg, el1_dbg etc (in arch/arm64/kernel/entry.S) should be added to the kprobe blacklist table. How can we do that?

I think, we need to define them under "section .entry.text" and then to use arch_within_kprobe_blacklist to prevent such symbols from kprobing.

~Pratyush

#2 lore raw
In reply to Pratyush Anand
Quoted 9 lines · Pratyush Anand

Hi,

There might be some symbols defined in asm file, which need to be prevented for kprobe-ing.

For example, el0_sync, el1_sync, el0_dbg, el1_dbg etc (in arch/arm64/kernel/entry.S) should be added to the kprobe blacklist table. How can we do that?

You can port and use _ASM_NOKPROBE(symbol) macro in .S file.

In arch/x86/include/asm/asm.h, it is defined as below.

# define _ASM_NOKPROBE(entry)                                   \
        .pushsection "_kprobe_blacklist","aw" ;                 \
        _ASM_ALIGN ;                                            \
        _ASM_PTR (entry);                                       \
        .popsection

Thank you,

Signature · 5 lines
Masami HIRAMATSU
Linux Technology Research Center, System Productivity Research Dept.
Center for Technology Innovation - Systems Engineering
Hitachi, Ltd., Research & Development Group
E-mail: [email protected]