This is the mail archive of the
systemtap@sources.redhat.com
mailing list for the systemtap project.
Re: [PATCH] Kprobes: Fix to prevent possible race conditions
- From: Andi Kleen <ak at suse dot de>
- To: prasanna at in dot ibm dot com
- Cc: systemtap at sources dot redhat dot com
- Date: 01 Jul 2005 15:05:43 +0200
- Subject: Re: [PATCH] Kprobes: Fix to prevent possible race conditions
- References: <20050701124632.GC29514@in.ibm.com>
Prasanna S Panchamukhi <prasanna@in.ibm.com> writes:
> diff -puN arch/i386/kernel/kprobes.c~kprobes-exclude-region arch/i386/kernel/kprobes.c
> --- linux-2.6.13-rc1/arch/i386/kernel/kprobes.c~kprobes-exclude-region 2005-07-01 18:01:23.000000000 +0530
> +++ linux-2.6.13-rc1-prasanna/arch/i386/kernel/kprobes.c 2005-07-01 18:01:23.000000000 +0530
> @@ -46,8 +46,27 @@ static long *jprobe_saved_esp;
> /* copy of the kernel stack at the probe fire time */
> static kprobe_opcode_t jprobes_stack[MAX_STACK_SIZE];
> void jprobe_return_end(void);
> +static void kprobes_arch_code_end(void);
This won't work with unit-at-a-time mode in the compiler
which reorders functions freely.
You need to define a special section for all of this, similar to
what __sched does for scheduler functions and mark the functions
properly.
Also don't you need to do the same for the page fault and exception
handlers?
-Andi