Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch.embedded > #29837

Memory Protections

From Don Y <blockedofcourse@foo.invalid>
Newsgroups comp.arch.embedded
Subject Memory Protections
Date 2020-07-13 13:30 -0700
Organization A noiseless patient Spider
Message-ID <reig95$pab$1@dont-email.me> (permalink)

Show all headers | View raw


Conceptually, memory (or a memory region) can be thought of as
being readable, writeable or executable -- and any combination
of these.  Hardware *may* enforce these protections -- to
varying degrees.

Usually, you opt to PREVENT some set of these operations
(i.e., no write, no read, no execute).  In many cases, this
acts as an invariant -- "this is data; nothing should be
mucking with it so mark it not-writeable; furthermore, I
know that it is not intended to be representative of
program opcodes so mark it as non-executable... and tell
me if something has been overlooked, at run-time, that
causes one of these types of accesses to transpire!"

So, it's a belts-and-braces mechanism.

But, for no-read and no-write, there are real uses
that rely on the hardware protections for successful
implementation (e.g., CoW, zero-copy semantics, etc.).

A developer expecting to use these hooks simply to
give enhanced confidence in his code (i.e., nothing
ever overflowing the stack) COULD, possibly, live
without them.

OTOH, a developer relying on them to implement specific
*features* REQUIRES their presence.

So, if, at run-time, you requested a particular set of
protections on a region of memory and they weren't
granted (e.g., because they aren't supported on this
processor instance), you might <shrug> in some cases
and <panic> in others.

For no-execute, I don't see any use beyond that of enhancing
confidence in the codebase; I don't see any *features* that
rely on detecting "legal" attempts to execute particular
regions of memory (assuming execute-access is treated as
a special case of read-access).

The ONE question I am posing here is "are there any?"

Back to comp.arch.embedded | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Memory Protections Don Y <blockedofcourse@foo.invalid> - 2020-07-13 13:30 -0700
  Re: Memory Protections Don Y <blockedofcourse@foo.invalid> - 2020-07-13 23:45 -0700
    Re: Memory Protections Theo <theom+news@chiark.greenend.org.uk> - 2020-07-14 10:40 +0100
      Re: Memory Protections Don Y <blockedofcourse@foo.invalid> - 2020-07-14 11:44 -0700
      Re: Memory Protections mac <acolvin@efunct.com> - 2020-07-19 15:03 +0000
  Re: Memory Protections George Neuner <gneuner2@comcast.net> - 2020-07-14 06:21 -0400
    Re: Memory Protections Stefan Reuther <stefan.news@arcor.de> - 2020-07-14 18:17 +0200
    Re: Memory Protections Don Y <blockedofcourse@foo.invalid> - 2020-07-14 11:48 -0700
      Re: Memory Protections George Neuner <gneuner2@comcast.net> - 2020-07-16 02:02 -0400
        Re: Memory Protections Don Y <blockedofcourse@foo.invalid> - 2020-07-17 18:25 -0700

csiph-web