diff options
author | Oleg Nesterov <oleg@redhat.com> | 2014-03-31 12:09:36 -0400 |
---|---|---|
committer | Oleg Nesterov <oleg@redhat.com> | 2014-04-17 15:58:17 -0400 |
commit | 59078d4b96bb548f97d9fb429b929a289e4884d9 (patch) | |
tree | e0a2e2d9fe1480a9be083fe07945c0143dc371ff | |
parent | ddb69f276c4af8bb47ad4f24a72f72ddf58c228a (diff) |
uprobes/x86: Kill the "ia32_compat" check in handle_riprel_insn(), remove "mm" arg
Kill the "mm->context.ia32_compat" check in handle_riprel_insn(), if
it is true insn_rip_relative() must return false. validate_insn_bits()
passed "ia32_compat" as !x86_64 to insn_init(), and insn_rip_relative()
checks insn->x86_64.
Also, remove the no longer needed "struct mm_struct *mm" argument and
the unnecessary "return" at the end.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Reviewed-by: Jim Keniston <jkenisto@us.ibm.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
-rw-r--r-- | arch/x86/kernel/uprobes.c | 10 |
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 | */ |
255 | static void | 255 | static void |
256 | handle_riprel_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, struct insn *insn) | 256 | handle_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 | ||
320 | static int validate_insn_64bits(struct arch_uprobe *auprobe, struct insn *insn) | 316 | static 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: */ |
346 | static void handle_riprel_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, struct insn *insn) | 342 | static 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 */ |