MarketKernel same-page merging
Company Profile

Kernel same-page merging

In computing, kernel same-page merging (KSM), also known as kernel shared memory, memory merging, memory deduplication, and page deduplication is a kernel feature that makes it possible for a hypervisor system to share memory pages that have identical contents between multiple processes or virtualized guests. While not directly linked, Kernel-based Virtual Machine (KVM) can use KSM to merge memory pages occupied by virtual machines.

Deduplication
KSM performs memory deduplication by scanning through main memory for physical pages that have identical content, and identifies the virtual pages that are mapped to those physical pages. It leaves one page unchanged, and re-maps each duplicate page to point to the same physical page, after which it releases the extra physical pages for re-use. It also marks both virtual pages as "copy-on-write" (COW), so that kernel will automatically remap a virtual page back to having its own separate physical page as soon as any process begins to write to it. Upon its implementation, users found KSM to also be useful for non-virtualized environments in which memory is at a premium. KSM was merged into the Linux kernel mainline in version 2.6.32, which was released on December 3, 2009. ==Security risks==
Security risks
Security is also a concern: • Allows circumvention of address space layout randomization (ASLR) • Exposes information via timing attacks • Allows contamination of cryptographic resources in other virtualized guests via the memory row hammer attack ==See also==
tickerdossier.comtickerdossier.substack.com