This is the mail archive of the systemtap@sources.redhat.com mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Kprobes: Fix to prevent possible race conditions


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]