Andrea Righi reported a case where an exiting task can race against ksmd. ksm_scan.mm_slot == the only registered mm CPU 1 (bug program) CPU 2 (ksmd) list_empty() is false lock ksm_scan.mm_slot list_del unlock slot == &ksm_mm_head (but list is now empty_) Close this race by revalidating that the new slot is not simply the list head again. Reproducer: http://www.spinics.net/lists/linux-mm/msg20233.html Proposed patch: http://www.spinics.net/lists/linux-mm/msg20301.html Acknowledgements: Red Hat would like to thank Andrea Righi for reporting this issue.
Statement: This issue did not affect the versions of the Linux kernel as shipped with Red Hat Enterprise Linux 4, 5, and Red Hat Enterprise MRG do not provide support for KSM (Kernel Samepage Merging). This has been addressed in Red Hat Enterprise Linux 6 via https://rhn.redhat.com/errata/RHSA-2011-1189.html.
Upstream commit: http://git.kernel.org/linus/2b472611a32a72f4a118c069c2d62a1a3f087afd
*** Bug 719238 has been marked as a duplicate of this bug. ***
This issue has been addressed in following products: Red Hat Enterprise Linux 6 Via RHSA-2011:1189 https://rhn.redhat.com/errata/RHSA-2011-1189.html
This issue has been addressed in following products: MRG for RHEL-6 v.2 Via RHSA-2011:1253 https://rhn.redhat.com/errata/RHSA-2011-1253.html