Re: How to develop a random number generation device
- From: John Larkin <jjlarkin@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 14 Sep 2007 21:51:23 -0700
On Sat, 15 Sep 2007 04:52:54 +0100, Nobody <nobody@xxxxxxxxxxx> wrote:
On Fri, 14 Sep 2007 11:47:32 -0700, John Larkin wrote:
Nothing the OS does can prevent machine code from overrunning a
buffer.
Absolute nonsense. Perhaps buffer overruns can't be prevented
using C++, but they *can* be prevented.
Not by the *OS*.
Sure it can. Not in Windows and not with C++, perhaps. An OS can
surely make it impossible to write safe code and a real OS is required
to make safe code possible.
That doesn't address the issue, which was whether the OS can prevent
buffer overruns.
I can't prevent them, but it could and should trap them and abort the
offending task, with no possibility of subsequent damage.
Under a decent OS, bad code should only hurt itself.
I don't think you understand what a buffer overrun is. FWIW, it isn't
related to process isolation (preventing one process from trashing another
process' memory). That's a non-issue with modern OSes and modern CPUs (for
x86, that means 80286 and later).
Well, Windows is not a modern OS, and x86 is not a modern processor.
Given decent hardware tools, an OS should abort a process that tries
to execute data.
There was a joke, in the DOS days, that a certain jpeg file contained
a virus. It was a joke because it was obviously impossible. A few
years later, Windows managed to make it happen.
And XP occasionally crashes when a user-level process screws up. Not
as often as '98 type systems, but it still happens. And Patch Tuesday
has become a ritual.
The reason why the OS cannot do anything about this is because it lacks
the detailed knowledge regarding which portions of memory are used for
what purpose. That information is normally discarded during compilation
(unless you compile with debug information). By the time you get to
running a binary executable, you're at a level of "code writes data",
with no details about which parts of memory belong to specific variables.
If the code segment was write protected and execute-only, and data
segments were not executable, and if there were separate data and
return-address stack pointers, the OS *would* know when a process does
something dangerous.
John
.
- Follow-Ups:
- Re: How to develop a random number generation device
- From: Nobody
- Re: How to develop a random number generation device
- References:
- Re: How to develop a random number generation device
- From: John Devereux
- Re: How to develop a random number generation device
- From: John Larkin
- Re: How to develop a random number generation device
- From: Nobody
- Re: How to develop a random number generation device
- From: krw
- Re: How to develop a random number generation device
- From: MooseFET
- Re: How to develop a random number generation device
- From: Nobody
- Re: How to develop a random number generation device
- From: krw
- Re: How to develop a random number generation device
- From: Nobody
- Re: How to develop a random number generation device
- From: John Larkin
- Re: How to develop a random number generation device
- From: Nobody
- Re: How to develop a random number generation device
- Prev by Date: Re: Need a few obsolete part numbers
- Next by Date: Re: Including tonal output on a multimeter?
- Previous by thread: Re: How to develop a random number generation device
- Next by thread: Re: How to develop a random number generation device
- Index(es):
Relevant Pages
|