How does OS enforce memory access control?
05:56 26 Feb 2025

In my Information Security course textbook, it mentions about:object reuse

To prevent object reuse leakage, operating systems clear (that is, overwrite) all space to be reassigned before allowing the next user to access it.

However in that case why is out of bound memory access allowed ?


int a[10];

printf("%d", a[11]);

This program provides random data accessed from outside the memory bounds.

Based on the contents of the book about Trusted Control Base, security kernel controls memory access and the object reuse, I would expect:

  1. For this to not be allowed by OS.
  2. If this happens, the values we get are all zero.

Why is out of bound memory access controlled by language implementation like Rust and not by OS ?

c security operating-system