lkml.org 
[lkml]   [2000]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectwrite protect kernel page problem
Hi,

I'm using the following code in an attempt to write protect
a kernel page dependent on a particular address:

char *ptr;
unsigned long addr;
pgd_t *kpgd;
pmd_t *kpmd;
pte_t *kpte;
pte_t pte;

ptr = kmalloc(sizeof(int),GFP_ATOMIC);
addr = (unsigned long)ptr;
kpgd = pgd_offset_k(addr);
kpmd = pmd_offset(kpgd,addr);
kpte = pte_offset(kpmd,addr);
pte = *kpte;
pte = pte_wrprotect(pte);
set_pte(kpte,pte);
flush_tlb_all();


Using 2.2.14 and have edited linux/arch/i386/mm/init.c to remove
the use of the 4MB kernel page tables. Everything seems to work
until the set_pte(kpte,pte) call. I crash the kernel at that point.

I followed a similar thread on this list concerning a 2.3.x
kernel, but am still a bit confused as to the problem I'm creating
here. Any thoughts or suggestions would be most appreciated.

Please cc to me, as I am not currently on the list.

thanks.

-joel
jkholl@cs.wm.edu

-
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/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.021 / U:0.656 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site