Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2325796rdb; Thu, 21 Sep 2023 15:35:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGzHrWCk4CfNierIRzLwLba/r4BidZIX61ReLqmVjTCypBeBtZkJt4RyU8KhKjakzJny4kN X-Received: by 2002:a17:902:da89:b0:1c3:bc7b:8805 with SMTP id j9-20020a170902da8900b001c3bc7b8805mr7375652plx.52.1695335735604; Thu, 21 Sep 2023 15:35:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695335735; cv=none; d=google.com; s=arc-20160816; b=KEu9qRHyTJqcuP0log5wx+kYaiTi5Ay2m1s9iQBqWuhbb6MjQ0QoUUcRJuKqMsZHaE 0XgywmAhfqW/y3WUAzPDqN1U815veaLqQp8OU12fwT7CBlOZ6E8PO1g5yvhcvrzvnCuk +TOsgWg/BRYavyREzeCUNHTGWKfK1NVmOIPEU4IHc5zRe4IlcuWAhV7rlgBrLQfQl8mW O8OeWjeR5g3v4w1Fe7a8zPRh7AjJXfA0Qj1aMQnIctWSj+X28XDxXiDwW2UmfsW6tztk Q+GktTkMDaxsEVk0D2wFUPQIXNOoMwH7gx7e7jMNwfjIDFmB0YG+FffhBI4Z0EhbR95W xHhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Q5eXsN6o+cp0dRU6wJOSguQAuugpqR6at+DPeLAQPVg=; fh=sS+J4OyOC0EcVLWJpS3mBHGeO+0+dYZJ+ImCUfzsrH4=; b=FRLG/oyHyaNjKUfQdUWovntrJ43Vft50V4TCiecQGyRQb7H/WKoW2EpsJLVaClgQwJ l5Y45ZEPDtXjEJ9/B2lLEaPc/BHnZ1VKv0ogmxMUz/+hwFnQGX8f9uCWYZsSqbHQcH2Q iELGUJZs7jbFn7+bG6LL1FxKE5coAZ8lAtx68P9iR3k4jCyErMXEmmZKUwsQtyU8Tp89 bPXUebXmLyDll/q+hqNgLclRJCRhHhOOYfv6ewiGZlyT/T581x0BhRG8lY8arFl+9/Ru 73H5bRugkqfaMc3DWewtV1R86xqcVoOqwB0SyEOBx1A5New8f+kYsgyiMotX9cC7Wdqy c7jw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id t4-20020a170902e1c400b001c5bd53fa38si2285967pla.99.2023.09.21.15.35.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 15:35:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 2664F8271430; Thu, 21 Sep 2023 15:21:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233227AbjIUWVH (ORCPT + 99 others); Thu, 21 Sep 2023 18:21:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232373AbjIUWUp (ORCPT ); Thu, 21 Sep 2023 18:20:45 -0400 Received: from 66-220-144-178.mail-mxout.facebook.com (66-220-144-178.mail-mxout.facebook.com [66.220.144.178]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A3E97A8F for ; Thu, 21 Sep 2023 10:10:24 -0700 (PDT) Received: by devbig1114.prn1.facebook.com (Postfix, from userid 425415) id 6C37DC502486; Thu, 21 Sep 2023 09:47:11 -0700 (PDT) From: Stefan Roesch To: kernel-team@fb.com Cc: shr@devkernel.io, akpm@linux-foundation.org, david@redhat.com, hannes@cmpxchg.org, riel@surriel.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v3 0/2] mm/ksm: add fork-exec support for prctl Date: Thu, 21 Sep 2023 09:47:07 -0700 Message-Id: <20230921164709.3627565-1-shr@devkernel.io> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,RDNS_DYNAMIC, SPF_HELO_PASS,SPF_NEUTRAL,TVD_RCVD_IP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 21 Sep 2023 15:21:31 -0700 (PDT) A process can enable KSM with the prctl system call. When the process is forked the KSM flag is inherited by the child process. However if the process is executing an exec system call directly after the fork, the KSM setting is cleared. This patch series addresses this problem. 1) Change the mask in coredump.h for execing a new process 2) Add a new test case in ksm_functional_tests Changes: - V3: - Combined two lines in function ksm_fork_exec_child() - V2: - Removed the child program from the patch series - Child program is implemented by the program itself - Added a new command line parameter for the child program - Removed new section from Makefile - Removed duplicate ; charaters - Added return in if clause - Used PR_GET_MEMORY_MERGE instead of magic numbers - Resetting PR_SET_MEMROY_MERGE at the end. Stefan Roesch (2): mm/ksm: support fork/exec for prctl mm/ksm: Test case for prctl fork/exec workflow include/linux/sched/coredump.h | 7 +- .../selftests/mm/ksm_functional_tests.c | 66 ++++++++++++++++++- 2 files changed, 70 insertions(+), 3 deletions(-) base-commit: 15bcc9730fcd7526a3b92eff105d6701767a53bb --=20 2.39.3