Code+Data separation

Allowing code and data to reside in the same areas of memory is a nice convenience, but it makes security harder to implement because it means code is modifiable and data can be created which just happens to do bad things if it is executed. Are there any modern processors which keep the code and data separated? Peter Hendrickson ph@netcom.com

Peter Hendrickson wrote:
Are there any modern processors which keep the code and data separated?
I dunno about processors which make that distinction, but it can be done in software using page-protection features of the Intel CPU. Under DPMI for DOS and I would think somehow under Windows, the DATA segment can be specified as loading into a seperate page/selector from the code (Im a little hazy on the specifics), and that page then marked essentially as "read only". I think this was designed to make software more crash-resistant though, not hack-resistance. There's probably many ways to circumvent this (explicity changing the access to that page, tricking the VMM into swapping that page out to disk, then editting the swap file while it's out there, etc). -- Vangelis <vangelis@qnis.net> /\oo/\ Finger for public key. PGP KeyID 1024/A558B025 PGP Fingerprint AE E0 BE 68 EE 7B CF 04 02 97 02 86 F0 C7 69 25 Life is my religion, the world is my altar.

At 12:08 PM -0800 12/19/96, Peter Hendrickson wrote:
Are there any modern processors which keep the code and data separated?
Many modern processors keep separate L1 caches for code and data. Sparc architecture requires a special instruction to say, "I have just used data operations to change this part of the program." I assume that program fetchers and linkers must use this instruction. Keeping separate main memory makes program loading and in-memory dynamic linking hard. The linker's data is the processor's program. ------------------------------------------------------------------------- Bill Frantz | I still read when I should | Periwinkle -- Consulting (408)356-8506 | be doing something else. | 16345 Englewood Ave. frantz@netcom.com | It's a vice. - R. Heinlein | Los Gatos, CA 95032, USA
participants (3)
-
Bill Frantz
-
ph@netcom.com
-
Vangelis