--- a/mm/ksm.c~ksm-fix-potential-missing-rmap_item-for-stable_node +++ a/mm/ksm.c @@ -791,6 +791,7 @@ static void remove_rmap_item_from_tree(s stable_node->rmap_hlist_len--; put_anon_vma(rmap_item->anon_vma); + rmap_item->head = NULL; rmap_item->address &= PAGE_MASK; } else if (rmap_item->address & UNSTABLE_FLAG) {