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 3147CC48260 for ; Sat, 10 Feb 2024 12:35:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 33E8E6B006E; Sat, 10 Feb 2024 07:35:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2EE4B6B0072; Sat, 10 Feb 2024 07:35:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1DCCD6B0074; Sat, 10 Feb 2024 07:35:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 0DF946B006E for ; Sat, 10 Feb 2024 07:35:28 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 92B1C801C5 for ; Sat, 10 Feb 2024 12:35:27 +0000 (UTC) X-FDA: 81775839894.16.CE9D262 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf07.hostedemail.com (Postfix) with ESMTP id 3DBCA40009 for ; Sat, 10 Feb 2024 12:35:24 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pYmaXtYB; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf07.hostedemail.com: domain of broonie@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=broonie@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707568526; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=tfj6dSBUwotzqjONBUupxtB/js5wMhci0vcC3SOAJkc=; b=AcnvzkJWnis2gg0LV188HT4BV8iouJqeiKa7zgypGi6mqO/zTpaX0qxS3DswyIdt/k71b3 3XnBJdNYygKj2AROMm5WfZ/1zrHG4cMZj1YK/9ej+iWRu443Xc5n36qrsVu7RG5dwja87h xuJhdQU5OchTAEEPLpJcWjn8NuFko/Y= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pYmaXtYB; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf07.hostedemail.com: domain of broonie@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=broonie@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707568526; a=rsa-sha256; cv=none; b=KB3WvaooDGdMM0MkR/lQ6Qi62CF5gHWEcmbVF0VlPyTwKKXrzYIu7+/XRQ0xyB91HdzlTa OiL4q3klngc74LBq/BmjLpU6f5WhazHN6zu8UpalfB53EjwgaXs7FWgyxWpoobmuuh6+q1 2idWHu/k8H4kXCtaGGl86tZ0XxKDyfQ= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id CCF19CE0C6E; Sat, 10 Feb 2024 12:35:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B33BC433C7; Sat, 10 Feb 2024 12:35:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707568521; bh=fPwvazq3DG0WdOG6aq2UYP9PUCwTT/kKO+PLvnTVTd0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pYmaXtYBIgtBSb23sAOfcNDtvWdC1BsAopBvCQAKB9eed/VboJsaoj5TjGNARpR18 RXl8nYya22AfKbszeLZxkN59k/uBAUMNx0R5r0yPsT+/7R+Yw5+y+3Iuq0F+6hNPhp s7WjfPa9SkgC8FCgJZUjWFJ5O2qHJEla93q+6psIvpHXOO9DYYWv+/CTBPI/hJ/7xQ HEkDsXyAVlF2eTm56Zh8gNjJK7/NIaFbpPSTomW+iV+h31uZheyeTTH2IQpytmvcFq wkBBAcKhEU/jzmEKiz193FYfO3qX6dv+R/Ap+Hr+Cv/1DH9fJOvYnVDJJbMjMtH8FB ae/xIciIzrHGw== Date: Sat, 10 Feb 2024 12:35:17 +0000 From: Mark Brown To: Ryan Roberts Cc: Andrew Morton , Shuah Khan , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] selftests/mm: Don't needlessly use sudo to obtain root in run_vmtests.sh Message-ID: References: <20240209-kselftest-mm-check-deps-v1-1-19b09b151522@kernel.org> <17c0b7a1-6ec2-4504-8287-f0fa111b9748@arm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="eYv/2Dvkk6iewWK1" Content-Disposition: inline In-Reply-To: <17c0b7a1-6ec2-4504-8287-f0fa111b9748@arm.com> X-Cookie: You might have mail. X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 3DBCA40009 X-Stat-Signature: bkatkakzkw6xh86idkg1hrdu7p4y5cfh X-HE-Tag: 1707568524-990016 X-HE-Meta: U2FsdGVkX18qDAV1f5qvVy84Ryz4pBAqq8dsTadoVfOLswOrED6pXOpBWRgYp5fAta7K/9pHOF1vgENM33z30hYhmDBsJod38prCC9ZoeeUYKpQyBwBBZ6VmS/YcS4XIKDU0aioA89xOdGqAr6z5vUPW+XRRebYh7LYnvuPsEsmaFnjYmzTu2ypFLuBJ8r+QiKvo5Nbn0XdmfTRD8q0xIchEyNxGMg1WrdNbZkEx0383eF/+8cAuy7xuD0EiyZge8LxiwR+IQb7JSEFiwTSID76LgI4BMj8kPtAVSCW1XeGYd7gzqX/kNxqavGI66n0D61NA9xmrUQcFylwClCKX74QyI+coLjmjrJIt13XfmnXzeEQwOB9UKAhpq28jM3W+EclUr3wK8rL5khHhATeqy/3IT6HugJl10Dt/b78BVNhnw/k6V+MkpHtR8Vdva3v2mf0KAHqMRpcJBR9td0NwJ266+C3yQqNS0JMi4pXGhCwRZEc1TcACR3E3CcWXtz/fM6ozVk1OIACb3vgH8r7sT5SLWzCPc3qNELDpQwLZ0VxKeUCNeZDfQLet8qy0mlDhez4AEEaTdi3sGxjuC5SE9J4QhM0uizrY+8WuQY66y08XOzQ7hbb6FAb6qPXVsPO0Wdrk+hkedJLr3HrfUQZ5jxi3V/2kHW6PuGCieL659XQJTRpQ/Wi9hm9jlFja+DuQmdOp9xKgRtC5vt7TIKjEUJ8jHUao00rMJd5upOX5hXrj0TdUIia8mzKI333z947L3Z3HwEhK5VH8c4Ii53bQcLTVH6cQDNUEUeFg6Yl85NVgLdtvypuYL7q31w1E/qacNz+vKcEu2LWLOMXuZQigu1TnHc4MIWb47ZMP7d0qLbPNyOZmqrcFnI4Q6Oy131U22+zaOQ5/pJXrlYjLOMvs1jabMaIWGM3HTS5FJPpwk9ZfmpRHSm5zmkv2nDtzP1L6rg6qnjaUcvmV2gkeVNF MbcPDdx7 VshWg2TMfpSuRAv0Nu0mY3dNXGiPNb3svWvjd8fle8jLwhdmxAJ+xmPmfXOXxK8MS2qWjFPybq4K4OJbJ+iv3YnlAZWAwIPRF+qAGAyNFAzjY2jc09IawuXvzs4BBnGiARk+qvFzbpvlgkIILYsBvuSJwXbOE3963vhts/AQUdggdeSiVFtOPDIFVhrp89ckYqlWppkGX54ZA48Pz5c7GOeSyvYJQLIBMdhjjng/bqK0JCf7/shaXjaM2ctKa2sRN08Ck/JwyXwaNpmEJ/mzfHaJ4UP951vzwq0bH 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: --eYv/2Dvkk6iewWK1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Feb 10, 2024 at 07:40:16AM +0000, Ryan Roberts wrote: > On 09/02/2024 20:21, Mark Brown wrote: > > When opening yama/ptrace_scope we unconditionally use sudo to ensure we > > are running as root, resulting in failures if running in a minimal root > > filesystem where sudo is not installed. Since automated test systems will > > typically just run all of kselftest as root (and many kselftests rely on > > this for full functionality) add a check to see if we're already root and > > only invoke sudo if not. > I don't really see the point of this. run_vmtests.sh needs to be run as root; > there are lots of operations that depend on it and most tests will fail if not > root. So I think it would be much cleaner just to remove this instance sudo. Ah, I was assuming that some of the suite ran usefully as non-root given that the only point of that sudo was to acquire root. If the whole thing needs to be root then we should instead have a check for root at the top of run_vmtests.sh and just skip the whole thing if we aren't root, but then I'm unclear why it's invoking sudo in the first place. > The problem that I was referring to yesterday, about needing sudo was for this case: > CATEGORY="mlock" run_test sudo -u nobody ./on-fault-limit > Here, we are using sudo to deprivilege ourselves from root and run > on-fault-limit as nobody. This is required because the test is checking an > rlimit that is only enforced for normal users. > Somebody on list was talking about skipping this test if sudo wasn't present a > couple of weeks back. Not sure if that happened. Yes, there's a check: if command -v sudo &> /dev/null; then CATEGORY="mlock" run_test sudo -u nobody ./on-fault-limit else echo "# SKIP ./on-fault-limit" fi --eYv/2Dvkk6iewWK1 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmXHbYQACgkQJNaLcl1U h9DLPgf7BkjKKkjtfQjwDw++hKvi33jgQojpcIEX8Nu2qNgfO5NtKNFvpwBp5AVk kjF3sA17LOMPSaROlYkXyCcha11316o9Aq9NpMrOv/1cUjd5ono1Ac2iua9y5RMY fMkTYW3DmuTqzLCnkzzkx8atvoc5Gk9IXUUJHE81sNLtRF1ZSMp7nihP2U/vxVre 07d7O6nz50tNLbT5M0FZ6x74q9KlZVrDvv9hd/UyOTl2L6gl4dUlp/osb3Ij+f3b +yLgE7PVhoLmeYbfErmWnnU3CsR0wQPZ/qtWzQphiL/tHJSTy7o/A76L0EIB/2vU biQAROFp0YvNmzMw/vM5iz3cnF98fg== =15fQ -----END PGP SIGNATURE----- --eYv/2Dvkk6iewWK1--