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 42C27CF9C5A for ; Fri, 20 Sep 2024 16:37:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6760F6B007B; Fri, 20 Sep 2024 12:37:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5FEDC6B0083; Fri, 20 Sep 2024 12:37:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 478B86B0085; Fri, 20 Sep 2024 12:37:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 2558D6B007B for ; Fri, 20 Sep 2024 12:37:34 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id BF6E7A0396 for ; Fri, 20 Sep 2024 16:37:33 +0000 (UTC) X-FDA: 82585672386.28.018E0DC Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) by imf20.hostedemail.com (Postfix) with ESMTP id ECAB71C000A for ; Fri, 20 Sep 2024 16:37:31 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=GYi+euf6; spf=pass (imf20.hostedemail.com: domain of jeffxu@chromium.org designates 209.85.167.175 as permitted sender) smtp.mailfrom=jeffxu@chromium.org; dmarc=pass (policy=none) header.from=chromium.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1726850100; 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=aeUoiC4xV3CiCxio8wPUbYZ9DxOg+zY+E1xCmjqF+qE=; b=MJyA9E2zh0UN3MtEcajJA8QWVHVb+JGL2mVUeFXzBISLm/kSeQxT87EQHzCTibK99eVQxJ u5UCJtGHISzgFF8ThgPi7ovnmcBzLQt4gO2x1tQnSD027mtbwrnBEnZhxp2ROF3D2sbuEU 9YjJkPCK6eDhqIlBx0+L08yzPvBSzVE= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=GYi+euf6; spf=pass (imf20.hostedemail.com: domain of jeffxu@chromium.org designates 209.85.167.175 as permitted sender) smtp.mailfrom=jeffxu@chromium.org; dmarc=pass (policy=none) header.from=chromium.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1726850100; a=rsa-sha256; cv=none; b=iY5Cs360DmDCcjdedvg8UDGAtKe9r62RmTQ1Hz1u4FMHjXaAY8AYyN61w57kM8v3UVERz0 SgH7JL4fvRql2MqPOQgWKlHu8vzjzfMl+PwOsgCoqIzbKfHho6cKsmWbWbGrSq/J8V29eJ Aq1V6uJ2/VUgQe6WmlXlFXAcLWuryo4= Received: by mail-oi1-f175.google.com with SMTP id 5614622812f47-3dd4297af75so148336b6e.0 for ; Fri, 20 Sep 2024 09:37:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1726850251; x=1727455051; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=aeUoiC4xV3CiCxio8wPUbYZ9DxOg+zY+E1xCmjqF+qE=; b=GYi+euf6YXvJw8ZYnr/KESU8KFL1vTeNLOqrQ6IBHs6u67DI9y+bYifI4uBJusR7Dz ZTvScV25LSPSlTJVBz7gxPxUUOVUAO1X2chRl0xNH+6L3cKE+PRCC9hAVJklF5P0+s5D dU0AXnZsxE8/k+fdooGqGJAYmGvT74bXWXO7M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726850251; x=1727455051; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aeUoiC4xV3CiCxio8wPUbYZ9DxOg+zY+E1xCmjqF+qE=; b=nR/11yI1VmRWEjw7fL7ZSGtw3gbgbXNZ1dRop2l0pKiL7LfkY3ls0AHQ6LQ/K+y8sP 91HYm3WQ1yurvlvDqoD4Cq4Hcq50hUznCnNHTXSPotqlmUnFgUyRc8vdwp4PrFlr/Hxc cvYQySvsUuSGRETCEwf/5IBE4H4G4nhMnghrOsCZu+hA8nwhmw+75lezoZvhi3fPRDK4 7DcV6qymNdWmPoh5C6ok27w7JTI1c01IFqwHukvKxIIeNPjK0isGaoQR6X577rETEoKs 6XkkOZoCFZ7RDgsH/C9KMXwts3PGIEKlxkfvDP2lOBCt2VE3ZmdIvYTc9577qLYdWarp M4pg== X-Forwarded-Encrypted: i=1; AJvYcCXW3LHdAkBmqdZXp9D3AkFZPAtET0U733w5o228+P+J454QJ/CajXzeGI2or/oPO6T6bsOqYQt52A==@kvack.org X-Gm-Message-State: AOJu0Yyesnyj+KxsCgdPZDbuqyTwegWlqS6qQsvW8/pluGWMOCLoz3BG YD4+/QDjrGKo0df28MTsLd4LdIXJ9IN6FaylmDXGMITZPM4fuAMxQU8i76bCGaW1PF4Z1H6RaaF HchG3fZ6frRAoOahk6yvK1vIvWAXu3AGYvBdl X-Google-Smtp-Source: AGHT+IEgc6oFjG/AVNeyCwNJdiZ7/4I53v5fqxBfmjiWXrV2OLBvKIkIyisPGyrs125247P4H7Q2d819NzxIHSA2I1E= X-Received: by 2002:a05:6870:870c:b0:277:db1c:7c6a with SMTP id 586e51a60fabf-2803a62c744mr749865fac.7.1726850250833; Fri, 20 Sep 2024 09:37:30 -0700 (PDT) MIME-Version: 1.0 References: <20240830180237.1220027-1-jeffxu@chromium.org> <20240830180237.1220027-5-jeffxu@chromium.org> <4944ce41-9fe1-4e22-8967-f6bd7eafae3f@lucifer.local> In-Reply-To: From: Jeff Xu Date: Fri, 20 Sep 2024 09:37:17 -0700 Message-ID: Subject: Re: [PATCH v3 4/5] selftests/mseal: add more tests for mmap To: Mark Brown Cc: Lorenzo Stoakes , Muhammad Usama Anjum , akpm@linux-foundation.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, pedro.falcato@gmail.com, willy@infradead.org, vbabka@suse.cz, Liam.Howlett@oracle.com, rientjes@google.com, keescook@chromium.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: ECAB71C000A X-Stat-Signature: jzergyr7f5yr7rxr5kmambsgwkdsobby X-Rspam-User: X-HE-Tag: 1726850251-795970 X-HE-Meta: U2FsdGVkX18MuRZmEAZrV1Mho2V2f6dn2DDLD6IYhvzhIbrjaxASLizgHeXU+LUdkvSq9varJ21bSil7pwvOrkMdSASztpGZBfELUKZ45dFm125TMCD1RBHPipDMmLAqDKKEwE7gf4IG9o4OSyyPq9S83ftTgamtkexqiP1QXhm5ZECd+Mxsd5ejRWGD0hlzUBURx7l2xK7fcusR1d9t2TMkdU9mYCtOtrYIpVhNbUpmCYAGfJxXmxh7YXCjbuad6ApQO0Gvc+TkvrDPro7KPbXYEBrrhdc2OtSvw98ryPDU35Cn+f5KbqASVNEsq2JjRDxZ0YYOdVWHjQGtDGXNe7dM6/X3uyvjFXcyRVnOrfTatmuWegSrfrMeA4rdDvVpHctC972SxNvcUeqeQUkKmppjZmPOL+2nZQR5yVueut72qEMESYpbDiz8dIGixTtdiJi+vTmHXnZXI2itMShC/sh9kNB0Srr2afQn9QiC+t4usw5fsre7IrF+37fzZjVY7B269QgMeWKfKxM0FcGxjzpiWm8OTtI/kBmaOIVghqIBAC3GXY/s7kS9BoTYisX7n++75W7pCV4IA49WiLnGuH+TNtYSyQ8lFjQSV+0dGWMQj/2otCO974TLFBjnj5lxzjCkqn7pNmLliAg9JWSXPQ8YlNqBvzZYLDa3X1Kx+cGnWW9B47dWEV0+WL2MyZcQRaz7Ex+qTFPIIqQVn8tHZ10C1tju6NS0Mwqjr4T0VOmB2Ot0iwOZU9Y9paQ1BRp+qxUtWUNfnOREjfMB/J8RICFrmcdJ8PsjRNMIfmfJAD4x/yZjxGHt6MFFYhYLiy3RwToUplPlzBJ2MqNtKmCUwWsinCE4hvOKb+ysyvbXSbpFzjDSsLNa047AkJO45mVfx2ZSpmkxljfH/rTI9ZC8ZTURMUPN2kRpP9Crnv24Gu0cPwNHZenGkKfDuLilS4y9KqOssvMjnNW/anaykAz dEGBjaUu iSSUrX5lLy9tUectuI96+hgCdahEmYUygZW58r52mf8CHL1rPDW62NTxRmOv7MLLxXUpx7gqhWH4RaQ4fb4W2e9YvJSQicUlnD6iHC8SIcEPJTGD24LGuST4Dl8MP9sMDymVwbhAcxJMfGNGBZ3NrMmu9QTfYWcqm1FUBv/sihn6zOXErNNHoVAUkGrrYpPD0YYFvNv7+JBEOOoMhTf3Uf2sTqxUY9/Rp43Ym1j8H4trUaZRglaEXTdRQZxO2qJvjzw/tlGCVxsD+s36vUGgvYuQPSiveHO6Ys2nLPzG6qtH9DG4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000010, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hi Mark On Wed, Sep 18, 2024 at 6:18=E2=80=AFAM Mark Brown wro= te: > > On Fri, Sep 13, 2024 at 03:50:00PM -0700, Jeff Xu wrote: > > > Even though the number of lines is large in these patches, its main > > intention is to test Pedro's in-place change (from can_modify_mm to > > can_modify_vma). Before this patch, the test had a common pattern: > > setup memory layout, seal the memory, perform a few mm-api steps, verif= y > > return code (not zero). Because of the nature of out-of-loop, it is > > sufficient to just verify the error code in a few cases. > > > With Pedro's in-loop change, the sealing check happens later in the > > stack, thus there are more things and scenarios to verify. And there we= re > > feedback to me during in-loop change that selftest should be extensive > > enough to discover all regressions. Even though this viewpoint is subj= ect > > to debate. Since none would want to do it, I thought I would just do it= . > > > So the Patch V3 1/5 is dedicated entirely to increasing the verificatio= n > > for existing scenarios, this including checking return code code, vma-s= ize, > > etc after mm api return. > > > Patch V3 3/5 are for unmap(), during review of V2 of Pedro's in-loop > > change, we discovered a bug in unmap(), and unmap() is not atomic. > > This leads to 4/5(mmap), 5/5(mremap), which calls munmap(). > > In addition, I add scenarios to cover cross-multiple-vma cases. > > > The high-level goal of mseal test are two folds: > > 1> make sure sealing is working correctly under different scenarios, > > i.e. sealed mapping are not modified. > > 2> For unsealed memory, added mseal code doesn't regress on regular mm= API. > > > The goal 2 is as important as 1, that is why tests usually are done in > > two phases, one with sealing, the other without. > > That's vastly more detail than is in the changelogs for the actual > patches (which are just a few lines each) or the cover letter of the > series. I don't have the MM knowledge to assess the detail of what > you're saying but I can't help but think that it'd help a lot with > review if all this detail were part of the actual submission. Agreed, will update and give more detail in the next version of the patch. Thanks -Jeff