aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/mm
diff options
context:
space:
mode:
authorGravatar Jinjiang Tu <tujinjiang@huawei.com> 2024-03-28 19:10:08 +0800
committerGravatar Andrew Morton <akpm@linux-foundation.org> 2024-04-25 20:56:29 -0700
commit3a9e567ca45fb5280065283d10d9a11f0db61d2b (patch)
treec8a3610e216552dd488fb739beee072d115e3b82 /tools/testing/selftests/mm
parentselftests/x86: add placement guard gap test for shstk (diff)
downloadlinux-3a9e567ca45fb5280065283d10d9a11f0db61d2b.tar.gz
linux-3a9e567ca45fb5280065283d10d9a11f0db61d2b.tar.bz2
linux-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/20240328111010.1502191-1-tujinjiang@huawei.com Link: https://lkml.kernel.org/r/20240328111010.1502191-2-tujinjiang@huawei.com Fixes: 3c6f33b7273a ("mm/ksm: support fork/exec for prctl") Signed-off-by: Jinjiang Tu <tujinjiang@huawei.com> Reviewed-by: David Hildenbrand <david@redhat.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Kefeng Wang <wangkefeng.wang@huawei.com> Cc: Nanyong Sun <sunnanyong@huawei.com> Cc: Rik van Riel <riel@surriel.com> Cc: Stefan Roesch <shr@devkernel.io> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'tools/testing/selftests/mm')
0 files changed, 0 insertions, 0 deletions