Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6225901rdb; Thu, 14 Dec 2023 11:41:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IFt1YEnZ+HT+Hm37cecBgBhDaHJ/wRjnVwcfOxMEQ6yL2wABj5JxAUTcBkBdqxeLF0VGjqT X-Received: by 2002:a17:906:1083:b0:a1e:2c27:8924 with SMTP id u3-20020a170906108300b00a1e2c278924mr6078018eju.17.1702582868396; Thu, 14 Dec 2023 11:41:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702582868; cv=none; d=google.com; s=arc-20160816; b=iqxzp+GTWw9QWT8h0ry51mQHGWJYYpVI3fSqKieuP4LmJX/Wg6xNxoRqpC0sWhIPQC 8iZsotcyqHJHBU2fTU3p1j+JV0B/4JbPFxdfhDfdgsTzyBXGpH0NLprr2+Y00S3bc5FX +5owh+hmAa2igqJxCYwQa4+eCfDVCCMP57afaznQ2o5+rzvesBfq2QTHEbBCY3q2faRf AXRnz+e9VzrvpNK182gAaDiPA7bf96ZybsAz9o3UiOQ2bDfgkUKymG9Y/RA0FZ5Sl9lm /+v0c3iz4AWMtJGICWoDqO5dvRv4nQWedMxlRWDqFijcKeyvEBaUFbu+2bfXNCLos1mG sp5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=Yk9ycaohZvV71WmWBk2GdElDFnXfiIpBClEjuDcahDE=; fh=X5We6JNhn+ibrYE+xsWTGIo/99WnnBH7sho/n7KFBWU=; b=SKTk41gAhcKmOgPudMkCuxmFkQZnKeV2EAfiyxY/ND3cMNrjs52eB2yQiS0w8kTcSW nSCk3oRxatuRHug6YtyqX3VTdQIPNPb3M5selLcuWDD+nVQC3uFaoekaHEboS7o+ox5A kK4b07qVcPUXhz3Ont4F2/Rjexj5iVUISm9Z9o/RaOGXg5RxEG4+amnZpTvyPUBAUGRO IcE8h1sPxr+cYvH3cAoV8nGnsoEdou2wZrWGGVKC1KXc2BuqRqPMBP2sdmAmfMf02jEW eJkp/KtCY0pNEuSlqIw3dltWxJwx0F/ZsLzDUhtKagZRQbMCq0x7f63WudtfZclSelaQ FFcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=ZBJ4R2IZ; spf=pass (google.com: domain of linux-kernel+bounces-23-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id y10-20020a1709060a8a00b00a1cf0b9db2asi6763399ejf.996.2023.12.14.11.41.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 11:41:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=ZBJ4R2IZ; spf=pass (google.com: domain of linux-kernel+bounces-23-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2C1F51F21F18 for ; Thu, 14 Dec 2023 19:41:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C3D6A697A9; Thu, 14 Dec 2023 19:40:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="ZBJ4R2IZ" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8BD2368EBE; Thu, 14 Dec 2023 19:40:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB018C433C7; Thu, 14 Dec 2023 19:40:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1702582858; bh=K9B2txQTgSN99zWiymlTobnzZROd0qplmIqjISRpvQw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ZBJ4R2IZRRRmCnfDh77WXtFkNC4CWWem9aaV9bQ/gtkE1e1KAqpTBTvDniPwCLNWq y1AS5HkupWrkEZ48wVv+Lct/2IKsYS7w+iab947cADM689VNdCBaPr/NxKIRWU4jTC +ELPAKemP2y9hD2EbUWxZFECFBe8sqKJYLOUprVI= Date: Thu, 14 Dec 2023 11:40:56 -0800 From: Andrew Morton To: Muhammad Usama Anjum Cc: Shuah Khan , Mike Rapoport , James Bottomley , kernel@collabora.com, "kernelci.org bot" , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] selftests: secretmem: Floor the memory size to the multiple of page_size Message-Id: <20231214114056.ec687939a411961db10e73df@linux-foundation.org> In-Reply-To: <20231214101931.1155586-1-usama.anjum@collabora.com> References: <20231214101931.1155586-1-usama.anjum@collabora.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 14 Dec 2023 15:19:30 +0500 Muhammad Usama Anjum wrote: > The "locked-in-memory size" limit per process can be non-multiple of > page_size. The mmap() fails if we try to allocate locked-in-memory > with same size as the allowed limit if it isn't multiple of the > page_size because mmap() rounds off the memory size to be allocated > to next multiple of page_size. > > Fix this by flooring the length to be allocated with mmap() to the > previous multiple of the page_size. I'd like to understand how this was noticed, what the ongoing effect might be, etc. To help decide which kernel version(s) need the patch. > Fixes: 76fe17ef588a ("secretmem: test: add basic selftest for memfd_secret(2)") > Reported-by: "kernelci.org bot" Which is one of the reasons we're now placing a Closes: tag after a Reported-by:.