OSDev.org

The Place to Start for Operating System Developers
It is currently Fri May 03, 2024 3:32 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: strange bytecode idea...
PostPosted: Thu Mar 05, 2009 4:48 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
There's still the data flow analysis method, although kindof brute force :wink:

_________________
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]


Top
 Profile  
 
 Post subject: Re: strange bytecode idea...
PostPosted: Fri Apr 24, 2009 2:24 pm 
Offline
Member
Member

Joined: Thu Jul 07, 2005 11:00 pm
Posts: 1546
Yea.. old post but I had to revisit this and decided I have a sane idea.

use a half-address range type thing for the bytecode execution. IE, it can access only the top half(or bottom half, depending on flavor) so that all that must be done for type checking(making sure we don't write over kernel memory) is and address,0x7FFFFFFF

So ok.. lets just say we have a lower half kernel that runs programs at 0x80000000(via paging, in ring0)
It doesn't hurt if a bytecode app can somehow hack and get read-access to what it is executing, so we can mark appropriate executable pages as read-only.
so then all we have to do to ensure that it can never access anything outside of it's address range is
or address,0x800000000
This will set the top bit of the address so that it never has access below it's execution mark.

anyone have any commentary about this?

also, for the register bit. I'm still a little stuck. I can tell that memory-registers are not the answer though. And local variables sound nice but I'm not sure about it.. would that say I could do something like:
Code:
_func1:
creat 4 ;creates a new local variable on the stack of size 4
mov l0,0xF00D ;moves 0xf00d to local variable 0
push l0 ;push the value so the called function can't change it
call _func2

_func2:
;what here? how should access be given to the pushed value?

_________________
My new NEW blag


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group