aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/uprobes.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c
index 098e56ec7954..963c121c0307 100644
--- a/arch/x86/kernel/uprobes.c
+++ b/arch/x86/kernel/uprobes.c
@@ -253,14 +253,11 @@ static int validate_insn_32bits(struct arch_uprobe *auprobe, struct insn *insn)
253 * - The displacement is always 4 bytes. 253 * - The displacement is always 4 bytes.
254 */ 254 */
255static void 255static void
256handle_riprel_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, struct insn *insn) 256handle_riprel_insn(struct arch_uprobe *auprobe, struct insn *insn)
257{ 257{
258 u8 *cursor; 258 u8 *cursor;
259 u8 reg; 259 u8 reg;
260 260
261 if (mm->context.ia32_compat)
262 return;
263
264 if (!insn_rip_relative(insn)) 261 if (!insn_rip_relative(insn))
265 return; 262 return;
266 263
@@ -314,7 +311,6 @@ handle_riprel_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, struct ins
314 cursor++; 311 cursor++;
315 memmove(cursor, cursor + insn->displacement.nbytes, insn->immediate.nbytes); 312 memmove(cursor, cursor + insn->displacement.nbytes, insn->immediate.nbytes);
316 } 313 }
317 return;
318} 314}
319 315
320static int validate_insn_64bits(struct arch_uprobe *auprobe, struct insn *insn) 316static int validate_insn_64bits(struct arch_uprobe *auprobe, struct insn *insn)
@@ -343,7 +339,7 @@ static int validate_insn_bits(struct arch_uprobe *auprobe, struct mm_struct *mm,
343 return validate_insn_64bits(auprobe, insn); 339 return validate_insn_64bits(auprobe, insn);
344} 340}
345#else /* 32-bit: */ 341#else /* 32-bit: */
346static void handle_riprel_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, struct insn *insn) 342static void handle_riprel_insn(struct arch_uprobe *auprobe, struct insn *insn)
347{ 343{
348 /* No RIP-relative addressing on 32-bit */ 344 /* No RIP-relative addressing on 32-bit */
349} 345}
@@ -376,7 +372,7 @@ int arch_uprobe_analyze_insn(struct arch_uprobe *auprobe, struct mm_struct *mm,
376 * and annotate arch_uprobe->fixups accordingly. To start with, ->fixups 372 * and annotate arch_uprobe->fixups accordingly. To start with, ->fixups
377 * is either zero or it reflects rip-related fixups. 373 * is either zero or it reflects rip-related fixups.
378 */ 374 */
379 handle_riprel_insn(auprobe, mm, &insn); 375 handle_riprel_insn(auprobe, &insn);
380 376
381 switch (OPCODE1(&insn)) { 377 switch (OPCODE1(&insn)) {
382 case 0x9d: /* popf */ 378 case 0x9d: /* popf */