Find the answer to your Linux question:
Results 1 to 4 of 4
Arch - Linux 2.6.27.7-9-default x86_64 GNU/Linux Can a user process, while in kernel mode, dereference the address in the cr3 register to obtain the values in the page global directory?? ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714

    User process and cr3 register


    Arch - Linux 2.6.27.7-9-default x86_64 GNU/Linux

    Can a user process, while in kernel mode, dereference the address in the cr3 register to obtain the values in the page global directory?? I tried but Linux keeps crashing...So my question is, is this possible, a yes or no response is all I'm looking for...Thanks in advance Gerard4143

  2. #2
    Just Joined!
    Join Date
    Jan 2009
    Posts
    1
    How did you test? If you write a user level program, it will never have kernel privilege. It can call system calls to do something like writing to a file. In that case, the kernel is said to be running under the process context but the kernel does not run your code directly.
    If you want to access the cr3 register, you need to write a kernel module.

  3. #3
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714
    I wrote my own software interrupt via a kernel module...this allows me controlled access to the kernel from a user process...Gerard4143

  4. #4
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714

    Found the Answer for cr3 address

    Found the answer...
    The address contained in the cr3 register is a physical address not a virtual address. So all I had to do was convert it, the cr3 address, to a virtual address and dereference it....Gerard4143

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •