Patch "uprobes/x86: Allow to probe a NOP instruction with 0x66 prefix" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    uprobes/x86: Allow to probe a NOP instruction with 0x66 prefix

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     uprobes-x86-allow-to-probe-a-nop-instruction-with-0x.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit ff65b0284902b04ab9481b3183be40f27e3ed508
Author: Oleg Nesterov <oleg@xxxxxxxxxx>
Date:   Sun Dec 4 18:39:33 2022 +0100

    uprobes/x86: Allow to probe a NOP instruction with 0x66 prefix
    
    [ Upstream commit cefa72129e45313655d53a065b8055aaeb01a0c9 ]
    
    Intel ICC -hotpatch inserts 2-byte "0x66 0x90" NOP at the start of each
    function to reserve extra space for hot-patching, and currently it is not
    possible to probe these functions because branch_setup_xol_ops() wrongly
    rejects NOP with REP prefix as it treats them like word-sized branch
    instructions.
    
    Fixes: 250bbd12c2fe ("uprobes/x86: Refuse to attach uprobe to "word-sized" branch insns")
    Reported-by: Seiji Nishikawa <snishika@xxxxxxxxxx>
    Suggested-by: Denys Vlasenko <dvlasenk@xxxxxxxxxx>
    Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>
    Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
    Acked-by: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221204173933.GA31544@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c
index 138bdb1fd136..9f948b2d26f6 100644
--- a/arch/x86/kernel/uprobes.c
+++ b/arch/x86/kernel/uprobes.c
@@ -722,8 +722,9 @@ static int branch_setup_xol_ops(struct arch_uprobe *auprobe, struct insn *insn)
 	switch (opc1) {
 	case 0xeb:	/* jmp 8 */
 	case 0xe9:	/* jmp 32 */
-	case 0x90:	/* prefix* + nop; same as jmp with .offs = 0 */
 		break;
+	case 0x90:	/* prefix* + nop; same as jmp with .offs = 0 */
+		goto setup;
 
 	case 0xe8:	/* call relative */
 		branch_clear_offset(auprobe, insn);
@@ -753,6 +754,7 @@ static int branch_setup_xol_ops(struct arch_uprobe *auprobe, struct insn *insn)
 			return -ENOTSUPP;
 	}
 
+setup:
 	auprobe->branch.opc1 = opc1;
 	auprobe->branch.ilen = insn->length;
 	auprobe->branch.offs = insn->immediate.value;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux