fork: do not expose incomplete mm on fork
Status from this message: [merged mm-hotfixes-stable] fork-only-invoke-khugepaged-ksm-hooks-if-no-error.patch removed from -mm tree
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 All 2 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | fork: do not invoke uffd on fork if error occursfs/ include/ kernel/ | +37 | 0 replies | Applied |
| 2/2 | fork: only invoke khugepaged, ksm hooks if no errorinclude/ kernel/ | +6 | 0 replies | Applied |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Jann Horn | Liam R. Howlett | Vlastimil Babka |
|---|---|---|---|
| 1/2 | R-b | R-b | |
| 2/2 | R-b | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH hotfix 6.12 0/2] fork: do not expose incomplete mm on fork
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