Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6509988rdb; Thu, 14 Dec 2023 23:56:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IFaK0e1Mo4oRgUlCDd9G1bW9pN63ZRGzP+GLBAtRYcVXVcp7LSb6HkcFecypMSN1m6oeYSB X-Received: by 2002:a81:8585:0:b0:5d7:1940:53c7 with SMTP id v127-20020a818585000000b005d7194053c7mr9623188ywf.63.1702626984553; Thu, 14 Dec 2023 23:56:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702626984; cv=none; d=google.com; s=arc-20160816; b=JJFHpo3+bG9Q2gDp+kUA/yjdRAqO+AXa1GZHI0YiiiaEu4ARQD0KaN3w5lLHRqza3X w8RN5vJVQzy6kf0efIXnN4gf5h8yrdFV///pAmxES5+NJmim147lzDKOwp8MEpeYCZEn O45nn7y02DuZyk85E4idfNuSneA4rm5OM25iUFMRGa8DDgpB8S0tHlzOTi1F1Gr4sTye DUFwfY7QW5LLAw0tDH1+k07k4Cz1Ep8gbe403ALb4ew7FQZqa+KRg+79bL8dAR+vmJfs hca1mUeLfKA5Sk22f1kHhdFtzqKSE9I6cqZOAJ/u+qSQA73jHwFkT1vnPUUN+KBoTKX3 o5Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:cc:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=A24O9hmrABMsr5U4vrRnTZke70do+PJq60a978UfGr8=; fh=z2Zp6SU/UaB88RGke/m3OcxJ7Wb51OTSBlsRR6pFEqk=; b=XYvQcx+ugeCMLsR/R22dI64j4KDRYjWRng5OLvorJJxP1QuCs3ILhlIbZEZxjUNOTn /P+Lvhgmy6691BlcQl8IaBBoAFarI8G4sGgncLD1xh1hfV7SBPq8QvIaECMR2v5vNE1K DrNJWFhGjWFBBfNmoNlyfP1qqbjj1XZtQ+pghTbOSEek5NsQffAtMGoqdnqOvzI5yVaJ tDzZYYfTGlDHI2LNuE9EQt6CgXEd70rqHwKEr5QoY4IpX7H5H2eD48SewbTF4te/TKj7 KZ8uYIGEk9JuSvDxk6sosb4+CNEMv14qgWs5rypvlaqlRHksvscy1lVPbhhlzM1aNorf RIDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="HNR/1eHL"; spf=pass (google.com: domain of linux-kernel+bounces-567-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-567-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j9-20020a0ce009000000b0067a2c0848casi4045262qvk.116.2023.12.14.23.56.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 23:56:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-567-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="HNR/1eHL"; spf=pass (google.com: domain of linux-kernel+bounces-567-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-567-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4EEBF1C22430 for ; Fri, 15 Dec 2023 07:56:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D76B1094D; Fri, 15 Dec 2023 07:56:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="HNR/1eHL" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (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 F278A12E49; Fri, 15 Dec 2023 07:56:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1702626974; bh=mAzpZ2f4BJM5eR5FSSU8TV6Mxhh8Z/aAMsRv8jD1bRc=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=HNR/1eHLnd0viOV+aHNDzc5a5U78Wf9gw9Icr/gmxIVPhttHLtgIvzp7opGestxOG e7mk87G1bvLJS+zRHnZnv0sB+u+hJ0XHbdwSU7jPqYGfouz4XYqJJhl5dAcCM5++vK 7hYPE1b25KDIovETWldP0/Mp8wFrumdO1uKfZnYVx5lA6CeIBmP746k7NmR9VYrOMc Z6hkSGq2LZTpncvoPdeYtIuqPeoS5tvGS5HGrFkvi+z3OiDDos90/H6hfPCGEaMl++ N66XufmXLvrvr9aB4IvUIQfzZRudt641+hmkvnsxWrV38wKksLp3tjnnGNGd4wOXfU A1nb09D5Hu2VQ== Received: from [100.96.234.34] (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 6CE0C3781433; Fri, 15 Dec 2023 07:56:11 +0000 (UTC) Message-ID: <90939a1f-8519-4645-b869-5c1f8e701a3c@collabora.com> Date: Fri, 15 Dec 2023 12:56:08 +0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: Muhammad Usama Anjum , 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 To: Andrew Morton References: <20231214101931.1155586-1-usama.anjum@collabora.com> <20231214114056.ec687939a411961db10e73df@linux-foundation.org> Content-Language: en-US From: Muhammad Usama Anjum In-Reply-To: <20231214114056.ec687939a411961db10e73df@linux-foundation.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Andrew, On 12/15/23 12:40 AM, Andrew Morton wrote: > 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. This was getting triggered on KernelCI regularly because of different ulimit settings which wasn't multiple of the page_size. Find logs here: https://linux.kernelci.org/test/plan/id/657654bd8e81e654fae13532/ The bug in was present from the time test was first added. > >> 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:. I was looking for email report from KernelCI. But I didn't find it. Not sure if we can do something like following: Closes: https://linux.kernelci.org/test/plan/id/657654bd8e81e654fae13532/ > > -- BR, Muhammad Usama Anjum