From patchwork Tue Oct 18 23:50:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zach O'Keefe X-Patchwork-Id: 13011209 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 AE760C43219 for ; Tue, 18 Oct 2022 23:51:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3B8B06B0074; Tue, 18 Oct 2022 19:51:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 368736B0075; Tue, 18 Oct 2022 19:51:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1E2516B0078; Tue, 18 Oct 2022 19:51:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 0E6AC6B0074 for ; Tue, 18 Oct 2022 19:51:10 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id BE6BA1A01B2 for ; Tue, 18 Oct 2022 23:51:09 +0000 (UTC) X-FDA: 80035718658.16.20C6DEA Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.202]) by imf20.hostedemail.com (Postfix) with ESMTP id 4FFDA1C0006 for ; Tue, 18 Oct 2022 23:51:09 +0000 (UTC) Received: by mail-pg1-f202.google.com with SMTP id e187-20020a6369c4000000b0041c8dfb8447so8884833pgc.23 for ; Tue, 18 Oct 2022 16:51:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=xX7SZCGfmXZ9MOjmP6qyYqMKH5CuY/6TOQvAYYPIYYw=; b=sHdWx7G9/fM/c7r6+WsofMB7vJ9sI1JAAObHcdZNH616Gp1lQbsJRPvhDu7Xd2B194 +vrmMs9tTJgglNdY2WqJa1ngBneV0HuUCNHVuoq+iOyLEQkE78VzhkYZi32RqLibB0js W9b4vUtBXVLSptnxcRa+kvdmIJaN2+INYv44xU0bNSVdncAFkPMj+uMsvnNo4UwDhmjR EKVIWSf/nvBrLN3qUyte5Yiz/4eeM1UaBCbYAHVpFTOKkvarQfDMewOZ/QS+3D5kUbWJ 8bcTTLX3ddwOE/GYLMhpJKEyuq/NgARqn/nbwEsEzpNUEjV4SPwopcpHjpDcJ6srJ5Vs Y7iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=xX7SZCGfmXZ9MOjmP6qyYqMKH5CuY/6TOQvAYYPIYYw=; b=iGddGoJENkWL/8GRWbIDxUu5iZRGH2SYLFFy1xApBimNJmI71PglviBs+oB1iktO1u cGh74/7MgXkrX/7nt4L3CA1JKu4JTajiQB4EjSWQxk2fsBZHIeFOyHTE527DbSdU4REp RCTTsHlOqVh5+wB/rs3osQkxNfNzNFxe9rqrJrSu3T+rHN2rXNB/lk5F8wYyQdMrVHxe L06XkdmOeY46tUYMYe2CnrL5VKzzw+NjtdFc8e4w/n7tZ0f2g1NTRNaa7RFj5XSxuSsL qJJpcH/QZsaHu0ESTYeOHYLHl386yMyOHeGLcF3o/jXy7eqNnde6LeYSi1kpGZMkqwWh Dwyw== X-Gm-Message-State: ACrzQf3pU8IC+YhMTIsIW7/8QWcG0wvmbt6bQ0/+XKkgunAkNuj3t9d9 0lSn9C9O4v+VMhCS57M9GrqSRqt80VF+ X-Google-Smtp-Source: AMsMyM4v6d/D/srODISveiVroAryRJvrZrOw7rGp4Zd4Yrdrmph7oorymu4glSMyQYuMTHgI23j+Iqrvgr0P X-Received: from zokeefe3.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:1b6]) (user=zokeefe job=sendgmr) by 2002:a17:902:d58a:b0:17f:7ed0:233a with SMTP id k10-20020a170902d58a00b0017f7ed0233amr5290016plh.23.1666137068275; Tue, 18 Oct 2022 16:51:08 -0700 (PDT) Date: Tue, 18 Oct 2022 16:50:50 -0700 In-Reply-To: <20221018235051.152548-1-zokeefe@google.com> Mime-Version: 1.0 References: <20221018235051.152548-1-zokeefe@google.com> X-Mailer: git-send-email 2.38.0.413.g74048e4d9e-goog Message-ID: <20221018235051.152548-4-zokeefe@google.com> Subject: [PATCH man-pages v2 3/4] process_madvise.2: CAP_SYS_ADMIN cleanup From: Zach OKeefe To: Alejandro Colomar , Michael Kerrisk Cc: Yang Shi , linux-mm@kvack.org, linux-man@vger.kernel.org, "Zach O'Keefe" , Suren Baghdasaryan , Minchan Kim ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666137069; a=rsa-sha256; cv=none; b=drFt5TnCsO6gPOj/0AcSVQzX1aVdIAOnbsIXDGOfOQIQb0Bw4WxkknvcTq9ys7kEPM+0i+ 9JawHhpsuhApjTeMuF3WbXMAaFXqnyc8UvL9JO2SYIX3oTFSicj16IdUzff/km+NehZuTO 7Jkdc7fkjr8j2hzj37b3pJLXG5A5ex4= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=sHdWx7G9; spf=pass (imf20.hostedemail.com: domain of 37DtPYwcKCME6vrllmlnvvnsl.jvtspu14-ttr2hjr.vyn@flex--zokeefe.bounces.google.com designates 209.85.215.202 as permitted sender) smtp.mailfrom=37DtPYwcKCME6vrllmlnvvnsl.jvtspu14-ttr2hjr.vyn@flex--zokeefe.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666137069; 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=xX7SZCGfmXZ9MOjmP6qyYqMKH5CuY/6TOQvAYYPIYYw=; b=pv9mnBfJIxTW8l5ra0jbJr/bFOCDruyEUz4zxCCkpNM55MV/oGa0gcAYaNaOOT8+g0cSt3 ZFRsoDgbS3FINg6sXXEBFR3TWanQvJuQRw835jNtS6R1nNOTUS2XiP11MAH/ZMv1a02JAG pda6eVY8r2W/kBxAuKATcr+aSNiW+38= X-Rspam-User: Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=sHdWx7G9; spf=pass (imf20.hostedemail.com: domain of 37DtPYwcKCME6vrllmlnvvnsl.jvtspu14-ttr2hjr.vyn@flex--zokeefe.bounces.google.com designates 209.85.215.202 as permitted sender) smtp.mailfrom=37DtPYwcKCME6vrllmlnvvnsl.jvtspu14-ttr2hjr.vyn@flex--zokeefe.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com X-Stat-Signature: yhqrnknzqq66ntx8qg5xdixuqnmccd14 X-Rspamd-Queue-Id: 4FFDA1C0006 X-Rspamd-Server: rspam10 X-HE-Tag: 1666137069-26790 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: From: Zach O'Keefe The initial commit of process_madvise(2) to man-pages project included an error, indicating that CAP_SYS_ADMIN capability was required when, in fact, CAP_SYS_NICE was the required capability. The initial commit of process_madvise(2) to Linux, commit ecb8ac8b1f14 ("mm/madvise: introduce process_madvise() syscall: an external memory hinting API"), relied on PTRACE_MODE_ATTACH_FSCREDS (see ptrace(2)), but was amended by commit 96cfe2c0fd23 ("mm/madvise: replace ptrace attach requirement for process_madvise") which replaced this with a combination of PTRACE_MODE_READ and CAP_SYS_NICE (PTRACE_MODE_READ to prevent leaking ASLR metadata and CAP_SYS_NICE for influencing process performance). Correct this in the man-page for process_madvise(2). Fixes: a144f458b ("process_madvise.2: Document process_madvise(2)") Cc: Suren Baghdasaryan Cc: Minchan Kim Signed-off-by: Zach O'Keefe Reviewed-by: Suren Baghdasaryan --- man2/process_madvise.2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/man2/process_madvise.2 b/man2/process_madvise.2 index 6208206e4..7bee1a098 100644 --- a/man2/process_madvise.2 +++ b/man2/process_madvise.2 @@ -113,7 +113,8 @@ check (see in addition, because of the performance implications of applying the advice, the caller must have the -.B CAP_SYS_ADMIN +.\" commit 96cfe2c0fd23ea7c2368d14f769d287e7ae1082e +.B CAP_SYS_NICE capability. .SH RETURN VALUE On success,