lkml.org 
[lkml]   [2000]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
Subjectwrite-protecting a kernel page
Hi,

I'm trying to write-protect a kernel page, for debugging purposes. I
want to get an oops when something (in ther kernel) tries to write to
it. Here is what I have (ptr points to the start of the page):

unsigned long address = (unsigned long)ptr;
pgd_t *src_pgd = pgd_offset_k(address);
pmd_t *src_pmd = pmd_offset(src_pgd, address);
pte_t *src_pte = pte_offset(src_pmd, address);
pte_t pte = *src_pte;
pte = pte_wrprotect(pte);
set_pte(src_pte, pte);
flush_tlb_all();

The problem is I can still write to the page after that. What am I
doing wrong? This is on a dual PIII machine, btw.

Thanks,
Borislav


-
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.074 / U:1.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site