Re: How to develop a random number generation device
- From: Nobody <nobody@xxxxxxxxxxx>
- Date: Sat, 15 Sep 2007 17:49:36 +0100
On Fri, 14 Sep 2007 21:51:23 -0700, John Larkin wrote:
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.
The 80286 and later have a built-in MMU, and Windows 3.1 and later make
use of it (although the 95/98/ME branch don't make quite as much use of it
as they should). With NT/2K/XP, processes don't trash each other's memory
(one process might "persuade" another to trash its *own* memory, but
that's a separate issue).
Given decent hardware tools, an OS should abort a process that tries
to execute data.
That feature is available at least on current Linux and BSD systems; I'm
not sure about Windows. It can break certain programs, e.g. those written
in languages which make extensive use of thunks (trampolines), as well as
some emulators and languages which use just-in-time compilation.
That doesn't *prevent* buffer overflows, but it prevents exploitation via
the "classic" mechanism (write "shellcode" into a stack variable and
overwrite the return address to point into the shellcode).
However, there are other ways to exploit buffer overflows, e.g.
overwriting function pointers, or data which affects control flow. If you
can't inject your own code, you're limited to whatever code is already
part of the process, but that may be more than enough (system() will
almost certainly be available; if you're lucky, there may be a complete
interpreted language available to use).
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.
There's no technical reason why it couldn't have happened under DOS.
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.
But that almost certainly isn't due to the user-level process directly
trashing OS memory. It's far more likely that the user process passes
"bad" data to the OS and the OS trashes its own memory.
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,
That will prevent code injection, limiting an attack to whatever is
code is already available in the process' address space.
and if there were separate data and return-address stack pointers,
That would eliminate the return address as a vector. There's still
function pointers; C++ uses these extensively (virtual methods), COM
even moreso (all COM methods are virtual).
And there's still the case of overwriting data which affects control flow
(the most extreme case is data which is "code" for a feature-rich
interpreter).
the OS *would* know when a process does something dangerous.
Only sometimes.
In any case, none of this deals with *preventing* buffer overflows, but
with mitigating the consequences.
.
- 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
- From: John Larkin
- Re: How to develop a random number generation device
- Prev by Date: Slightly OT: The paperless office: How far can we go?
- Next by Date: Re: li-poly battery protection for high cell count packs
- Previous by thread: Re: dimbulb alert
- Next by thread: Re: How to develop a random number generation device
- Index(es):
Relevant Pages
|
Loading