7f47 Check or read from potentially invalid virtual address catching GP/page faults - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Development > FreeBSD Development

FreeBSD Development Kernel development, writing drivers, coding, and questions regarding FreeBSD internals.

Reply
 
Thread Tools Display Modes
  #1  
Old May 8th, 2012, 12:41
rlyeh rlyeh is offline
Junior Member
 
Join Date: May 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Check or read from potentially invalid virtual address catching GP/page faults

Hello,

I've been working on a personal project, where I must handle potentially invalid information in scenario similar to a kernel panic. When I detect an erroneous condition, I try to dump certain structures, following pointers whenever possible.

So far I've implemented a test similar to those built in the copyin/copyout functions, using the MAX_USER_ADDRESS. On amd64, however, addresses like 0xdeadbeefdeadbeef would still fall within the range of kernel addresses assumed as "valid".
  1. Is there any fault-tolerant way to test for the true validity of a given virtual address? ie. it can be read/accessed. kernacc is not working for me in certain cases, because it only searches for kernel_map pmaps, which is not going to work, say, for boot memory pages.
  2. Is there any arch-independent helper API to "examine" an address and dump its information in a similar way to ddb? How does ddb implement the override for the general protection fault handler when accessing unmapped memory?
  3. 121212

I could foresee questions about why do I actually need to do this, but I would appreciate it if we could just stick to providing answers disregarding of any subjective opinions. I have reasons to do this rather unorthodox checking and do not intend to waste anyone's time submitting my patch, for now. I'm just learning more about the vm internals.

Thanks!

Last edited by DutchDaemon; May 8th, 2012 at 23:19.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual Box Can't read cd0 urlugal Installation and Maintenance of FreeBSD Ports or Packages 1 April 13th, 2012 21:48
Page table representation in the virtual address space of FreeBSD nav143 FreeBSD Development 1 December 5th, 2011 15:59
read pid-file and check process Cycrus Userland Programming & Scripting 12 December 23rd, 2010 18:41
how to check how fast ZFS is read/writing? wonslung General 11 July 6th, 2009 10:59
"Invalid address" Running apps via WINE tbyte Installation and Maintenance of FreeBSD Ports or Packages 12 December 14th, 2008 21:27


All times are GMT +1. The time now is 08:45.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0