From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60BADE77180 for ; Wed, 11 Dec 2024 08:35:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D21088D0015; Wed, 11 Dec 2024 03:35:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CD0DF8D0013; Wed, 11 Dec 2024 03:35:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AFC4D8D0015; Wed, 11 Dec 2024 03:35:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 8D7088D0013 for ; Wed, 11 Dec 2024 03:35:39 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 0884441E7F for ; Wed, 11 Dec 2024 08:35:39 +0000 (UTC) X-FDA: 82882019346.14.94DD62D Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf30.hostedemail.com (Postfix) with ESMTP id 1FC0D80009 for ; Wed, 11 Dec 2024 08:34:51 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="S9byy/WA"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=D1VqOGcG; spf=pass (imf30.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); dmarc=pass (policy=reject) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733906118; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=AskMFozkmKRVoHajZ2Ubk3/o0rX2LW1Hu+YvwFxdliI=; b=MicJ30WYbtcB0QKf8pUYfeOR6SCq3xZP2ACTZgPu2u0203dcM1P0fInLaBagYVJei+DrCn HBHrZU/oHaPuwntstO1hrck4VwAamRVoiO6mTGsnldjIwkgEdGoQ8hLwNXuFlcFu62mMj3 MXK3JTzucE7q80rNSaAwkMVmxXJVGMk= ARC-Authentication-Results: i=2; imf30.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="S9byy/WA"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=D1VqOGcG; spf=pass (imf30.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); dmarc=pass (policy=reject) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1733906118; a=rsa-sha256; cv=pass; b=CZw3hCP3e19UdcItX4obvHh+pMlrrpwQASotpn6o3sbZ5yrdhBd/f9MuLoY0YWcLIjWeGv S03uKjEX3KsbSFUoENRdgd5MRIO8uBN3fdMjW8K088Eqzpz57kSKmOdMfD8CrJfyMQEBQ3 ht99jaibllFNnY3RPDXEEMpBb5m5vpk= Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BB8RMED004948; Wed, 11 Dec 2024 08:35:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=AskMFozkmKRVoHajZ2Ubk3/o0rX2LW1Hu+YvwFxdliI=; b= S9byy/WAzZ9AMNBb4iubU92RvejyfgzfVPRNsMMTz+Bnnf9qmKJrs0/PdmavDEMT BFso8vucB1xBd7/VpCKiVf02Wby19daGBDWerPAAnEmzKhnud/oXVJEOr6cKF4Om oONCAppOORa0Smf1ITujrKrGTVNU6aVyV40HpGpMXk8lOCK8oclUdW/fzj2NWWVT QKYbGUapGltCD5OAG7JN7Ek1xg4jS7BH7c+KCPUYab9pRFdE05pgoc384bbuti+D jkKVXoFqW7+jKMJHpmgEr9rauy8OOUsktwH0x8+7FOKpm3BzNhFrKKdxNF9MP8Rz 4aQ33X5pmPZvJzJ4v55agQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43dx5s55cp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Dec 2024 08:35:28 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4BB71URV020507; Wed, 11 Dec 2024 08:35:27 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2042.outbound.protection.outlook.com [104.47.55.42]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43cct9dxmr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Dec 2024 08:35:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Fpc54EXjj/SRLuJ1Bew7ahK3kH+yDiDbD01PIDR09chNAJlbtacNgWH6bvFI4o5IbGmbLcZOElL8PsoC9LzOAy0mL1OV2pr40DWPtGHC+boN8qg0+pu/+yloJgljc6lKGE4F6l/8Haa7qM6RwlteT1350MmrKKUZY/U1RZLhCLOcKmxOsRyAW8ir9QGfnC5+BwR6HFJDGOOsZxUj6PBkwiVN3OWSFnkaJuy4EGMn7uWpcXikxJCcOCQemzjzKnhabWw9z55E6dUioiIYyu3w6QZ5aJNrvO5fYcAAWWsD4S7mqgvEBj55cSn8JWMNbobL5i9UhI4dwgUCJfF3lhk3Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AskMFozkmKRVoHajZ2Ubk3/o0rX2LW1Hu+YvwFxdliI=; b=HmMvWpn754In7PTYlstWop+inywNtoTMumhLrShJTtj6EXFErVynUh2WbwWqPoy8YiMF10xjKf5NiJQXsRh4HQX25zjN15u7DzX/K72RQB4RNxVpG/+PVeMEG5wAdNwstg/KeYO3wWs+IFezncrcucOXGM7y2HDQ1xoAFO6sbiacQJb1haiyz6qMUwSpeFNKDXfmYWjS63zZ+65MBYxVwpkn6IC4DCip3puTpT0r+wYxFxe2/cNYZ8Rwg5IgNUC8u5MQRom3wfWGI1Gxb2ggyPTSvsvyxEsooUqmOWoWVe0c/hC4KYgwp0eJhblmy9QkErjXgd0zgQj/VnF4yd/cyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AskMFozkmKRVoHajZ2Ubk3/o0rX2LW1Hu+YvwFxdliI=; b=D1VqOGcG8fanlEWDZpiV1ctPCUFfVdwhXf0KcbTXanHSoNTr2XGDwzuE/H0kj9kpFhlTzK3JO/zFk1JUpTxwFqZJOt4lWUmkwvtCNWdaPjr9d4LF6zUtWqlFyj8bpJNl4MEDkZf3xx0AzhvkCOUFUpv62wRZE68QKUlEt+ZsZos= Received: from BYAPR10MB3366.namprd10.prod.outlook.com (2603:10b6:a03:14f::25) by LV3PR10MB8058.namprd10.prod.outlook.com (2603:10b6:408:286::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.15; Wed, 11 Dec 2024 08:35:24 +0000 Received: from BYAPR10MB3366.namprd10.prod.outlook.com ([fe80::baf2:dff1:d471:1c9]) by BYAPR10MB3366.namprd10.prod.outlook.com ([fe80::baf2:dff1:d471:1c9%7]) with mapi id 15.20.8251.008; Wed, 11 Dec 2024 08:35:24 +0000 Date: Wed, 11 Dec 2024 08:35:16 +0000 From: Lorenzo Stoakes To: Jeff Xu Cc: "Liam R. Howlett" , akpm@linux-foundation.org, vbabka@suse.cz, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, jorgelo@chromium.org, keescook@chromium.org, pedro.falcato@gmail.com, rdunlap@infradead.org, Jann Horn , David Hildenbrand Subject: Re: [PATCH v1] mseal: move can_do_mseal to mseal.c Message-ID: References: <20241206013934.2782793-1-jeffxu@google.com> <2m3zmlehfigs5r7rptwcoft3j4fipfkgfxmdrdttpf76hwhwae@vclfa5ulcmv2> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: LO4P123CA0119.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:192::16) To BYAPR10MB3366.namprd10.prod.outlook.com (2603:10b6:a03:14f::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR10MB3366:EE_|LV3PR10MB8058:EE_ X-MS-Office365-Filtering-Correlation-Id: e79f03f9-a775-4842-94a3-08dd19bec1de X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?B?ZWg2UGpXeVpMSzZFOVRpbzNEaGZrK2IvMzFuQmlUTUNUYnRZa3FLL3Jzc1Zw?= =?utf-8?B?S2lockNuZVZpZkNxM244U05HYjFMOVJnUVRPMmU0RW80M21UNEpkUm1kZG0y?= =?utf-8?B?RitMaFhzTEZHQWFIWHpNUDNCZzM0SlJMSmtSN0dBMXZGQ29IeEhrdUlxNFN2?= =?utf-8?B?Ti9oT3BMMEhMTjVJckJpSXg4cW9mQUZZUG1vZks1Mi96QnJZOTVmT0hNUGlU?= =?utf-8?B?RUlINDA2YTgzSkg1TFExM0hwa09uSlBjeWxBRWpRdjRCSnVxNkNsK0VtWUxr?= =?utf-8?B?TmlxMTlGWCtkMzNFWDFDaTlSK0N3aDNCeDlFaEk0Tmkzb3BFSTc0d0d6YnpO?= =?utf-8?B?dWl4ekVVWUZRM3ZTMWI0U2VMOFo4ZU0wZDBLUG5FdVFQYVRFN3l1eVpqZGdq?= =?utf-8?B?SGc1WlBEeGVqRVhFcktuS3ltUmN0NHZMS25TZFZkcWt5Z3FIcGtJakNzb0Q2?= =?utf-8?B?NmtPdW5vRkh6YUltdXA4WnkxQ1dZYjRSTWVuck11OHA5UlphSTZJVUdzRjNN?= =?utf-8?B?TzR2ek5GMTlGeWQxZXJrcGZacTZnUDNyM0RiSjBQZklxRFArVzBQMUkvcXNh?= =?utf-8?B?UStOcmFuUEdqMGpSSmQyeG11M1ZwSTZOa2xzK2RZSXVkR0kraG14Q3ZGb1RX?= =?utf-8?B?bGx2N05INXRuU0g5ZHNHTzgva3cxNnNYWEY1TlB0OGpJR2cxe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YkFLcHJva2VhR28wb1g1?= =?utf-8?B?TTE2M01WeUNISFNQYXg0ODB5WXBNSGZRRVFXWmtJdzdvdUVyelNMRHlWQW1h?= =?utf-8?B?QzlHWnZHeHZNU3NmeUtRQ1FNTFZNMWVFY1ZBZGxWMm9ZK2U5Yy9OVDhQa3hs?= =?utf-8?B?QjdkYmFYMkRVVHZYSFhwKzJZUjBCY3ZWdnFpNkw2aURLMVpMKzBtaVM3MzlX?= =?utf-8?Q?aEU6lFmGYcHCNCVKL4ODGiJUPNUCGRB1jzmnI=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB3366.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aEtSVW03MXlXS3V6LzJFbVdlSE1jRjl0NDN2ZFJZdW1kWURsbzBnMEgrdFps?= =?utf-8?B?R21MR0VkVnFRTWNDbDN2aHFZN0JlZndEeCtJRTMrQzFPRU1IUkRvbFVSK3lF?= =?utf-8?B?WUF0QkdyOUs5TnZpZGhVWjJGUE5TZDJtQlBzVG9uUHM4a1h1QnVmQVUzVFdT?= =?utf-8?B?cEtXUnM2UzdzWDl3dzZTTTAwRTE5ejBSdmlBQTBCMUdnN1BoOTJvZmhINjUv?= =?utf-8?B?YWswU1IxZVVlNkpYZS9KOVpuRDYxSVhrVHpZa2liWWk2eThpNERzQThhZGRT?= =?utf-8?B?cWxEWTFLZFMyZ2RsamJGdDExVXRCZ1BraFpRVmtrK1pua3lzSGVlNzV2RHZR?= =?utf-8?B?cktLRzFoMXp3eDhJY0JGZS9VeWRQQWw2dnJnVS9kdDd5YVROVWFudVFqdGYv?= =?utf-8?B?UFRyR05OS293dmE0RlJSdmY1RXcvTzJrcVhBTExqRFVRb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MessageData-0: EmcmFVW30LUBXWsiV1nFxhYkAnFL7woVlC4op2LGemqzmqTYVIaNhwO0s+WVPQ5brL+J3esWu2X/IZdlfcTYb2jd2IUXtbYbKHe9Xn1afZMw+N75+jIRPsGsktRNMWiG+/0Lh+SxNGXmszSnsfyZ5Eqs/6J7QzwYhzB8pbS7ZubGIuOsT1BOB0HyXWo3aRfxk6Atpd5MdeAr32i2ZXAkdgP1+altHyGKKHwKGgRIRpGQnLnvN+0Ws+vXb1hID0dZTIwjolyPWdNoYrjAG8pTk/yRvdhKYay6Q99ngov5Qqc3JG2QOIs2R2LdNUU8VKUIUN1pXpJamjY9UV40rxJlJlZ8sl0pomqEFe2Z/CnRY+VfINHeg2fiHw7ajpu40YUeWNHFAvaDMvOvevOIR2lc5bjB35gEnOkyL+h3DHjtoxSn/TuuCPq5HMjZQu2i50qNhrpa2+93ueP8+EsTLbhyMcwgrUG7hQJTEAIc+adF294eYs0IGEud2BNlXbKVbdi+Ej58pn/y44Uiweq1PcWH7PcWs1kCL4FQTA2R++4fPaSFGoCeB2qzZWKrsQcaBHwXAoKT0JCqUTV7+JVyJggmDjHqYeSPf3B0aOGQg5mEwGY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e79f03f9-a775-4842-94a3-08dd19bec1de X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3366.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2024 08:35:24.6684 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: syb1dUEn4zyrTgizqSDxsBOxDZeYrWVdc3fqO5fsxcxD+LcgpN+RDOAfAx/jgsg5Q668kPBub5RTTUusKCTIcJJLyrOsPJjnS/HspAhF9lg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR10MB8058 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-11_08,2024-12-10_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2412110064 X-Proofpoint-ORIG-GUID: 9Gf9j2aMMAVQcR7K__MacHqhDHufzVUY X-Proofpoint-GUID: 9Gf9j2aMMAVQcR7K__MacHqhDHufzVUY X-Rspamd-Queue-Id: 1FC0D80009 X-Rspamd-Server: rspam12 X-Stat-Signature: tm3qkzc3i57z7toyum8td3keq4sqa33y X-Rspam-User: X-HE-Tag: 1733906091-638303 X-HE-Meta: U2FsdGVkX1+az93hwmOD9qKxD9Vm14RNVVdvxHNIwi5Fy/RWSvq2njzFJukPWrPepKcSQ/EKYqWI9bhIY+w9UHsHMndfqUUCJigSmbO5Jwivan538jro5FF//PDoC7WFKhZBrtwfvhaKeIp/UnVOqrcQkCeBcf+dKIpHuJMqSqPKlJEMkm8e/BZ9mJaxrsANDuNb6LyisO4TvqHhjwkfuVHdjAAf8Ttrqv3pOFYWPpimfmQZiIGg6SLSvMNk4d37NEGMcpAEQUEYPaR2sDNDD0Ghw2+m67PZtp8z9tuOkRI23LRemL6L+JtFI26CVa18JyUHs00I6IwOZI/sv4w4hCEzgu6hiTwXWdj1beCRNdPeQaTR0IOGA4Y+RKMerhQgd55EZGfkLHr7qB6vS6XG12gFQArSFOeQrHjOAC+ZB4j8rpvnB1yiZ6v7TH3FP+sYW6bUTs9445QiKaUIB4Eyz/0DTrKFpYSE5XnHkVQnZzY12Y/ApFak6GJxtnWzy5pLD1gn9eArHtNVECXYvVBTix0LdD7U1gPWTLAzb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9GgVGOiQ6zAizJLzK7e5DpD4mkq8+oKEDgzpl1aoZ7cGJfJKS4vh6CoYCbuTo22/8b7qScX8mgjJGqixD02LZDQ4hp6WY8= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, Dec 10, 2024 at 06:38:49PM -0800, Jeff Xu wrote: > Hi Lorenzo, > > Regarding your proposal of moving mseal.c to vma.c for unit testing. > > On Fri, Dec 6, 2024 at 9:04 AM Lorenzo Stoakes > wrote: > > > > > > > > An aside - I actually think we need to move the bulk of this code to > > > > mm/vma.c - it makes absolutely no sense to keep the internals in this file, > > > > and that way we can userland test mseal functionality. > > > > > > > Is there a past discussion to read ? That will help me understand your > > > strategy of unit testing mm code. > > > Moving everything to vma.c, will lose log history, e.g. blame no > > > longer helps, did we consider alternatives ? > > > > Re; git blame - I'm not sure what alternative you think exists, and I've > > moved brk(), mmap(), etc. with a history spanning >30 years, so I'm not > > sure what blame history you're concerned about given how recent mseal is :) > > > > There is always code that gets moved or changed. You can't stay attached to > > your name appearing on a git blame line. > > > > Re: discussion, there's dozens of discussions and patch sets totalling ~3k > > lines of code... just search lore for vma testing, or search through my > > commits in mm/vma.c and you can see. > > > > I can put together links if you really need, but I think say [0] is a good > > motivating example of how I was able to actually write unit tests for VMA > > merge functionality which previously could not exist. > > > > In any case you can use the git blame -C option to 'see through' things like > > code moves. > > > > The whole point of this is to be able to _unit_ test functionality under > > circumstances that might be otherwise improbable/incredibly difficult to > > obtain if run as part of a kernel and self testing. > > > > Importantly it allows us to conduct fuzzing testing in future, something > > key and fundamental to security testing. > > > > I would say for somebody who has clearly stated his huge commitment to > > testing and how critically vital it is especially in the security realm, > > this is entirely something that is beneficial to the kernel and to mseal > > stability and security. > > > > If you want to see it 'in action', you can run the tests in > > tools/testing/vma via: > > > > $ make && ./vma > > > I want to express my support for unit testing and agree that more > testing would benefit mm. However, I'm unsure about the reasoning > behind moving code to vma.c in bulk. Could you please clarify this for > me? > > In my understanding, unit tests can be conducted regardless of the > code's location once dependencies are addressed with stubs. Have you > considered adding mseal.c to the unittest makefile at the same level > as vma.c? Since mseal.c doesn't introduce new dependencies, i.e. it > operates directly on the vm_area_struct, so I would start with that. These aren't ordinary unit tests, this is a whole new structure to allow for _userland_ unit tests, that is the ability to compile kernel code in userland. The mm/vma.c file has been specially set up to allow for this, it outsources its imports to vma_internal.h, one which exists in mm/ for the kernel and one which exists in tools/testing/vma for the userland unit tests. It also strictly means that vma.c is _internal_ only and _cannot_ be used from any other part of the kernel except mm - it's a sealed environment unto itself. None of these things are true of mseal.c. In any case it was something I was considering, if it makes sense to. You can see VMA manipulation code in mprotect.c, etc. which may not actually make a huge amount of sense to move over. So this isn't for certain, and you'll be involved in any discussion if this were to be done... :) > > I guess, for UT, you might need to change some functions' signatures, > e.g. remove static, if you want to test an internal function (e.g > mseal_fixup) , from your unit-test, but this is the same even after > moving them to vma.c. > > There will be additional work of clean up including header (".h"), > still I believe this is the same work even after moving the code into > vma.c. You might still need to move the prototype of some functions > into vma.h or vma_internal.h (e.g. definition of MADV_FREE). But I > think this work is also orthogonal to where the mseal business logic > is located. > > I understand the logic behind the current vma.c (on the linux_main > branch) and the unit test for the VMA merge functionality. However, if > your plan is to move all VMA-related code into vma.c, that means more > stubs are needed (depending on the boundary of the proposed unit > testing), and I don't understand how moving the code can help reduce > the amount of work or stubs (if that is the motivation). Yeah it isn't to move _all_ VMA-related code, because some don't make sense there, but rather core VMA operations which make sense to be there and also tested. The possibilities are pretty exciting as to what we can do with this (ok maybe only to me but still :P). So again, it's far from certain I'll try to do this with mseal, it was just a heads up ahead of time just in case I do. I mean speciflcally speaking it'd be the very straightforward stuff about applying mseal flags, checking compatibility etc. > > To avoid spending too much of your time, if there are previous > discussions on this topic, please share links or a brief summary, so I > can study them first. Sure, I mean again the best thing is the original series [1] [1]:https://lore.kernel.org/all/cover.1722251717.git.lorenzo.stoakes@oracle.com/ > > Thanks! > Best Regards, > -Jeff > > > > [0]https://lore.kernel.org/linux-mm/1c7a0b43cfad2c511a6b1b52f3507696478ff51a.1725040657.git.lorenzo.stoakes@oracle.com/ > > > > Thanks, Lorenzo This won't happen until next year at the earliest anyway, as I'm off for Christmas/NY at the end of this week and this is nowhere near my TODO list even at the moment :)