Re: PTRACE_POKEDATA on PROT_NONE page hangs kernel

Linus Torvalds (torvalds@transmeta.com)
Sat, 19 Sep 1998 11:36:39 -0700 (PDT)


On Sat, 19 Sep 1998, Michael Elizabeth Chastain wrote:
>
> The "put_long" function in arch/i386/kernel/ptrace.c goes into a loop
> holding the kernel lock. I added some printk's and discovered that the
> page table entry, pte_val(*pgtable), has the value 0x00ad3062 and stays
> at that value while put_long keeps calling handle_mm_fault.

Good spotting.

I suspect the _correct_ fix is to change the test

if (!pte_write(*pgtable))

to

if (!(pte_val(*pgtable) & _PAGE_RW))

(What the above does is checks that the page is just writable, even if it
is marked _PAGE_PROTNONE).

Does this fix it for you? If so, send me email, and I'll do it in my
kernel.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/