From patchwork Thu Feb 1 07:13:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13540708 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 6CE95C47DDB for ; Thu, 1 Feb 2024 07:13:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C39528D0002; Thu, 1 Feb 2024 02:13:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BE8A28D0001; Thu, 1 Feb 2024 02:13:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AD7488D0002; Thu, 1 Feb 2024 02:13:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 9D5F48D0001 for ; Thu, 1 Feb 2024 02:13:21 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 375EB140DBB for ; Thu, 1 Feb 2024 07:13:21 +0000 (UTC) X-FDA: 81742369002.04.E0DB71E Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) by imf14.hostedemail.com (Postfix) with ESMTP id 8E562100022 for ; Thu, 1 Feb 2024 07:13:18 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=SUx6mtOi; dmarc=pass (policy=quarantine) header.from=collabora.com; spf=pass (imf14.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.194 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706771598; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=3onw1mJQURiBgzeJT8oR49TnYeBVZEVKX8+4GVvKg8E=; b=kw1t2a/EcT247LZIjS0MNZE7AQ/McZbAYHVLD06U8DOJAwwpMONW0DDyAlYoiy6OmEpGk5 2C19B/ueW5sFct+dZkxJk/E8H8Wlu4jWbZ0o9HHI4TJLagme1G+KvdtCchL/WfGFbItx+Y WCIUg8KDe84j/YgyJ7rMLED0q5RSYEw= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=SUx6mtOi; dmarc=pass (policy=quarantine) header.from=collabora.com; spf=pass (imf14.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.194 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706771598; a=rsa-sha256; cv=none; b=NJfGZvJchNmMEr+jaf/xQooXKjDJ0h09gXXY8DR8sFahLUCPEWdrs37cIgDV8RyatGa6W/ D3d4E84dVEuRbhLlOfhsQF9rXxIpQgfaDzdvDvm6ucNPlMadFZMhj8f9SkIC0fJhco8j2L sU1kykVFwm36qodc7rFEpK6JFMbWDIY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1706771597; bh=+R4/cooCCuK4cnjbDE/i4pYhhrE258IRPNaowXzJuKE=; h=From:To:Cc:Subject:Date:From; b=SUx6mtOi1Ji3hXD7sh/pC66Zg0d4uBN5I1A2UrMSGM+dTPItXm0p1+jzNuQ0pVRZB IyPECVM1kXGi7FfVGN/ba2lh22wez2Ft1ck0eT5A8pjdndBOEoyBsNWxstZUOamLDi XEPESDMo6Zk8GcsbtRXR3mxUIhcD3yNBI6tDU5j6Iz9vYVmMJ8H1V2TkvKNaeSMlMM MYMJ+Z6UxKpOP8v753fmj9nJg19tNEeJAvO3AjXtQ5hOjhu02VFa4x64rwHKrzDENS jf8zvdfOs0528ao91LXCW1ciTFF42O+fC4PlMovHXnsleKcdNI6tUII2UPniqDUU83 h5UmyAI/nl2pw== Received: from localhost.localdomain (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 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 A5714378208B; Thu, 1 Feb 2024 07:13:14 +0000 (UTC) From: Muhammad Usama Anjum To: Andrew Morton , Shuah Khan , Muhammad Usama Anjum Cc: kernel@collabora.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] selftests/mm: on-fault-limit: run test without root privileges otherwise skip Date: Thu, 1 Feb 2024 12:13:06 +0500 Message-ID: <20240201071307.592317-1-usama.anjum@collabora.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 8E562100022 X-Stat-Signature: xgmnpa35x97h7earwb6c6qxo8ut4gncd X-HE-Tag: 1706771598-200324 X-HE-Meta: U2FsdGVkX1+7o4sfGrpUmcMcXOuY7ixGpptUHfB2JVVi6cptXOVSrvxYQrmimgVH6EaDyjTmLJ+wmUD6DbQcjcA+6UGuvVGAgtKQLJloWWWl2n2YzvuTCANC9PCwXMZ9HIw/rDtbEwSvzs0kDK19tEAlhtTgJueOzyShbL7NUboX/Gf6KX8ghOGvc9MnLINwu16hVs5d3uU6wFlit+SeyznrnNFmJ5SSjPzzVroYNSKhqdmQGgD6BzGuXXpn/ffr7LsEwqNG7ZfA3aaBhgCiGkKGXyItNqGF5ltRO/xcYoWH2upZc6u8cxZgDPoXU4DP9TTnoaNr3YngTibHK1fIuT8gx46J+QDHy/Bc1KZkqp+xoEsmvIrcyKqL5AU+MXjc8vWQQ3uc5750/w/qJWzgdV9W/gN0rdcmQROsRJoxEYKfjLC6+uXbyFWkrLa7Ywv/bx36CCZrdz27UGEfLn1YU+uLGIsvzCKyNTnA0NMFqs4TAi6u1x/P3TUNLEEl492uOZvbp+FERWp430X00nU5JN1/2e04kVXL8kHn+evLpb3FPkSh+v/QCIM4drsVWCrbs3Kvzws18FKwS21aK+TBSITxz9W4TgdGBFn/zhtRzTvFUSKgTjq/PdcNYMcUGhMZweWMmVoKObxDKtdZmmxQZH5iUWdEUgE3Iu48goEbV8o7oCRvNQb+qOY5IERfqjYm3LETj9AM4sW7glMvFsglzkg5dqVGN9lPwSjA75fmtrpzM1lR6JHgbHOg+glzryqe7Ml0ueIkuhNWknFxa/fXxGJGly5zQxrzlnkokHZgODp6JD5Y8bcz6pd4QA+DnBGqSnGzg6uauswy8FqKIFLhnXm/mmWPiIQV3DqKmcEmmoJZa0/HX57CVFfY6wlutYeWsTvgbyClCI+OUIlxxcoGnyPQx4qugqGcwh634HmVkCimE7ygSiJtBqYvBPVAN06FwbeelcX5O+wNm80kaq4 WXX5+OjA BRb1xwCiVvGcFiLP4wCgwjy5SrGA8aG3yBn4elBIiCFCLSMs/jHuHEYBIG1rKijN2TQoB4xZ/mdn12oOP4QrY08QHgFYOZE2l6fwRTo4h1v+XAeDm1mMy2YdjLO8w9PpsAHuEGQt1cxUPoRdzT8YM2WTmz/sVRlU5OoJSO9LFGOGRk00jFq1ofnyg1UqUTy4362a7WIeP8PIXulQsnPjNArCbOzQUtiI0W7iGmdm0ltGzTGhLYxF/OBiuAA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000232, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: The mmap() respects rlimit only for normal users. This test should be run as normal user, without root privileges. Fixes: b6221771d468 ("selftests/mm: run_vmtests: remove sudo and conform to tap") Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/on-fault-limit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/mm/on-fault-limit.c b/tools/testing/selftests/mm/on-fault-limit.c index 0ea98ffab3589..431c1277d83a1 100644 --- a/tools/testing/selftests/mm/on-fault-limit.c +++ b/tools/testing/selftests/mm/on-fault-limit.c @@ -21,7 +21,7 @@ static void test_limit(void) map = mmap(NULL, 2 * lims.rlim_max, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_POPULATE, -1, 0); - ksft_test_result(map == MAP_FAILED, "Failed mmap\n"); + ksft_test_result(map == MAP_FAILED, "The map failed respecting mlock limits\n"); if (map != MAP_FAILED) munmap(map, 2 * lims.rlim_max); @@ -33,8 +33,8 @@ int main(int argc, char **argv) ksft_print_header(); ksft_set_plan(1); - if (getuid()) - ksft_test_result_skip("Require root privileges to run\n"); + if (!getuid()) + ksft_test_result_skip("The test must be run from a normal user\n"); else test_limit();