Commit cf79a124 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Add more paranoid checking in x86-64 prefetch checker

From: Andi Kleen <ak@muc.de>

Make sure we never access anything in kernel mapping while
doing the prefetch workaround checks on x86-64.

Originally suggested by Jamie Lockier.
parent 8f0f4aaa
...@@ -73,6 +73,9 @@ static int is_prefetch(struct pt_regs *regs, unsigned long addr) ...@@ -73,6 +73,9 @@ static int is_prefetch(struct pt_regs *regs, unsigned long addr)
if (regs->cs & (1<<2)) if (regs->cs & (1<<2))
return 0; return 0;
if ((regs->cs & 3) != 0 && regs->rip >= TASK_SIZE)
return 0;
while (scan_more && instr < max_instr) { while (scan_more && instr < max_instr) {
unsigned char opcode; unsigned char opcode;
unsigned char instr_hi; unsigned char instr_hi;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment