Pointers Essentials

Learn about the null pointer, invalid pointer, variables as pointers, and pointer initialization.

The NULL pointers

The first addresses starting from 0x0000000000000000 are specifically made inaccessible on Linux. On a typical ARM64 system, the range is 0x00000000000000000x0000000000007FFF. The following code will force an application crash or kernel panic if executed inside a driver:

Press + to interact
mov x0, #0
str x1, [x0] // Access violation

Invalid pointers

There are different kinds of invalid pointers that cause an access violation when we try to dereference them:

  • NULL pointers
  • Pointers to an inaccessible memory
  • Pointers to a read-only memory when writing

Other pointers that may or may not cause an access violation:

  • Pointers pointing to random memory
  • Uninitialized pointers that have a random value inherited from past code execution
  • Dangling pointers

The last three ...

Access this course and 1400+ top-rated courses and projects.