Bug Classes/Use after free

From Linux Kernel Security Subsystem
(Difference between revisions)
Jump to: navigation, search
(Undo revision 3837 by DavidWindsor (talk))
(Add reference counter overflow protection to Mitigations)
 
(One intermediate revision by one user not shown)
Line 11: Line 11:
 
* segregating memory used by the kernel and by userspace can stop attacks where this boundary is crossed (e.g. PAX_USERCOPY)
 
* segregating memory used by the kernel and by userspace can stop attacks where this boundary is crossed (e.g. PAX_USERCOPY)
 
* randomizing heap allocations can frustrate the reallocation efforts the attack needs to perform (e.g. OpenBSD malloc)
 
* randomizing heap allocations can frustrate the reallocation efforts the attack needs to perform (e.g. OpenBSD malloc)
* reference counter overflow protection (PAX_REFCOUNT, HARDENED_ATOMIC)
+
* reference counter overflow protection (e.g. PAX_REFCOUNT, HARDENED_ATOMIC)

Latest revision as of 05:14, 4 February 2017

[edit] Details

When a memory allocation gets freed but there are still accidentally users of that memory, it is possible that an attacker could control the new memory allocation that fills the freed area, and then manipulate the contents in a way that the system uses its stale pointer and expects a different structure than is currently present. If there are function pointers contained in the structure, this allows for trivial execution control.

[edit] Examples

[edit] Mitigations

  • clearing memory on free can stop attacks where there is no reallocation control (e.g. PAX_MEMORY_SANITIZE)
  • segregating memory used by the kernel and by userspace can stop attacks where this boundary is crossed (e.g. PAX_USERCOPY)
  • randomizing heap allocations can frustrate the reallocation efforts the attack needs to perform (e.g. OpenBSD malloc)
  • reference counter overflow protection (e.g. PAX_REFCOUNT, HARDENED_ATOMIC)
Personal tools
Namespaces

Variants
Actions
Navigation
Tools