diff options
| author | Jinjiang Tu <[email protected]> | 2024-03-28 11:10:08 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2024-04-26 03:56:29 +0000 |
| commit | 3a9e567ca45fb5280065283d10d9a11f0db61d2b (patch) | |
| tree | c8a3610e216552dd488fb739beee072d115e3b82 /mm/mm_init.c | |
| parent | selftests/x86: add placement guard gap test for shstk (diff) | |
| download | kernel-3a9e567ca45fb5280065283d10d9a11f0db61d2b.tar.gz kernel-3a9e567ca45fb5280065283d10d9a11f0db61d2b.zip | |
mm/ksm: fix ksm exec support for prctl
Patch series "mm/ksm: fix ksm exec support for prctl", v4.
commit 3c6f33b7273a ("mm/ksm: support fork/exec for prctl") inherits
MMF_VM_MERGE_ANY flag when a task calls execve(). However, it doesn't
create the mm_slot, so ksmd will not try to scan this task. The first
patch fixes the issue.
The second patch refactors to prepare for the third patch. The third
patch extends the selftests of ksm to verfity the deduplication really
happens after fork/exec inherits ths KSM setting.
This patch (of 3):
commit 3c6f33b7273a ("mm/ksm: support fork/exec for prctl") inherits
MMF_VM_MERGE_ANY flag when a task calls execve(). Howerver, it doesn't
create the mm_slot, so ksmd will not try to scan this task.
To fix it, allocate and add the mm_slot to ksm_mm_head in __bprm_mm_init()
when the mm has MMF_VM_MERGE_ANY flag.
Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 3c6f33b7273a ("mm/ksm: support fork/exec for prctl")
Signed-off-by: Jinjiang Tu <[email protected]>
Reviewed-by: David Hildenbrand <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Kefeng Wang <[email protected]>
Cc: Nanyong Sun <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Stefan Roesch <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'mm/mm_init.c')
0 files changed, 0 insertions, 0 deletions
