[PATCH hotfix 6.12 0/2] fork: do not expose incomplete mm on fork

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



During fork we may place the virtual memory address space into an
inconsistent state before the fork operation is complete.

In addition, we may encounter an error during the fork operation that
indicates that the virtual memory address space is invalidated.

As a result, we should not be exposing it in any way to external machinery
that might interact with the mm or VMAs, machinery that is not designed to
deal with incomplete state.

We specifically update the fork logic to defer khugepaged and ksm to the
end of the operation and only to be invoked if no error arose, and disallow
uffd from observing fork events should an error have occurred.

Lorenzo Stoakes (2):
  fork: do not invoke uffd on fork if error occurs
  fork: only invoke khugepaged, ksm hooks if no error

 fs/userfaultfd.c              | 28 ++++++++++++++++++++++++++++
 include/linux/ksm.h           | 10 ++++------
 include/linux/userfaultfd_k.h |  5 +++++
 kernel/fork.c                 | 12 ++++++------
 4 files changed, 43 insertions(+), 12 deletions(-)

--
2.46.2




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux