Sujet : Re: Memory protection between compilation units?
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.cDate : 13. Jun 2025, 17:23:28
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20250613092045.431@kylheku.com>
References : 1 2 3 4 5
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2025-06-13, Mateusz Viste <
mateusz@x.invalid> wrote:
On Fri, 13 Jun 2025 09:21 pozz wrote:
>
However this strategy assumes you already know there's some
instruction that write to the array at an out-of-bound position.
>
Yes, though I see Kaz's idea is to proactively protect all memory used
by the program. It's an interesting concept, though not particularly
practical.
The question you posed at the root of the thread, in the middle of the
article was: "Is there a way to enforce memory protection between module
files of the same program?".
Well, that is one way. Put guard pages around their statics, and have
a little framework whereby the init routines of all the modules can
regsiter these pages. You can make it so that it all disapepars based
on some #define.
It can be entirely practical, depending on the program. Even
in some programs of moderate complexity.
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca