Bug Classes/Use after free

From Linux Kernel Security Subsystem
(Difference between revisions)
Jump to: navigation, search
(Undo revision 3837 by DavidWindsor (talk))
(Undo revision 3836 by DavidWindsor (talk))
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)
 

Revision as of 05:13, 4 February 2017

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.

Examples

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)
Personal tools
Namespaces

Variants
Actions
Navigation
Tools