File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -414,8 +414,12 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op,
414
414
}
415
415
416
416
/*
417
- * Replace breakpoints (int3 ) with relative jumps.
417
+ * Replace breakpoints (INT3 ) with relative jumps (JMP.d32) .
418
418
* Caller must call with locking kprobe_mutex and text_mutex.
419
+ *
420
+ * The caller will have installed a regular kprobe and after that issued
421
+ * syncrhonize_rcu_tasks(), this ensures that the instruction(s) that live in
422
+ * the 4 bytes after the INT3 are unused and can now be overwritten.
419
423
*/
420
424
void arch_optimize_kprobes (struct list_head * oplist )
421
425
{
@@ -441,7 +445,13 @@ void arch_optimize_kprobes(struct list_head *oplist)
441
445
}
442
446
}
443
447
444
- /* Replace a relative jump with a breakpoint (int3). */
448
+ /*
449
+ * Replace a relative jump (JMP.d32) with a breakpoint (INT3).
450
+ *
451
+ * After that, we can restore the 4 bytes after the INT3 to undo what
452
+ * arch_optimize_kprobes() scribbled. This is safe since those bytes will be
453
+ * unused once the INT3 lands.
454
+ */
445
455
void arch_unoptimize_kprobe (struct optimized_kprobe * op )
446
456
{
447
457
arch_arm_kprobe (& op -> kp );
You can’t perform that action at this time.
0 commit comments