Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2421725pxa; Mon, 24 Aug 2020 13:49:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyg6rb0GnK7DPobrwCNOatTHcI9Q+WNAkwYoZXRi54u3MzYbaMX79dW440VSk2ucj9Z+rI7 X-Received: by 2002:a17:906:da19:: with SMTP id fi25mr7166337ejb.405.1598302178764; Mon, 24 Aug 2020 13:49:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598302178; cv=none; d=google.com; s=arc-20160816; b=gefO9UPBPiaPAXjTWbA2IsP61O99NdxXMtY5SQ+klOJuPZdwi/TXAMZvO0z3EVJdL/ T3/uYCUJzne0UA+TxU1XvCbHrXw/OeB9yVySRXe7Ic3avE4d7rAKXFEU+p+mWvNKkLrG Do5RJfncoUnszGWGnmEtjYV5U6d/o+liLr5/P3fthM3esdWYQOJBojdImX3Tz1YAtldU AMU4NrtDo1qtZykSx7OtXYJtn/nkbD6ljoRkaoOTyQTVk3dfZDsomL3RQMMpt1GGEWEV fTUP50Za5loJIm/uxfYAuYlPwBRWdpXG8jLklx6H/pL4AHIdQYQYoNY+yOMtiVVAUMYD JOnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=kM5joqg+RHXoHRl0S6oSlj/GuNS5zs03d29CFc1FbZE=; b=QRpzw2Xzm6dghl9cQ6Q04NChQL7SMYqXP63UHDKz0KyI42MyZvi7j4vBN+XKZroEE5 8QOALiAI6m55Dkh7hOAgDCMaZogYZ88Yb5H1oZeCxE656+k0M+YW5BCuW9QvHkN7mvVL tHI84ZKfT6WnRDHNDlytyayapdUrsscd+/xotnrM3MN3t1NUe0tEWY8a/fvh6CiLdATF LJdE7yzPhGns0cVjAAmjSGp5dZEV4CVM0TrsJAMtvXbF0xlUsPH/01+UzmPudUtj/oVw R7Kq6/hVS/g/5dO/wWqukxjN0kjb0qkom7CBXeF3PbszMZc1zAGLZ8joSt13u5ZuTdhw bLLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=lsOl2RGf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x8si7634698ejs.414.2020.08.24.13.49.15; Mon, 24 Aug 2020 13:49:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=lsOl2RGf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726739AbgHXUsT (ORCPT + 99 others); Mon, 24 Aug 2020 16:48:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726617AbgHXUsS (ORCPT ); Mon, 24 Aug 2020 16:48:18 -0400 Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 393CBC061755 for ; Mon, 24 Aug 2020 13:48:18 -0700 (PDT) Received: by mail-qt1-x841.google.com with SMTP id s16so7358273qtn.7 for ; Mon, 24 Aug 2020 13:48:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kM5joqg+RHXoHRl0S6oSlj/GuNS5zs03d29CFc1FbZE=; b=lsOl2RGfq8vv0g91rMtdvi4E9LrqaC0ZlTeAEmldYwBIG1DIYwKsv69yAbhNNkFgQQ dprlDkbL0Of8EkEqIZhtCc7vBI9VRumfjvoi502BDMZdIjFEENVgnGx0UAsvDWBzX1/S zN/tCbt5aAFwPejsPzkMhwN/TlrrUjCu9vfFppCd+WXEO5tfct4/8zgDXD3RAja/tLIC 5AiY/xyiJAR7ILzZlXZErppXNi3CANgysW6TWcVS86OvhFETJ5n6ZHMrsUjMBGu8t1U2 fV1Zt3m0Weim7Flemhb4ZM6E4w9oH4v8Lkj3EV6u+WKgo3Tmha4Z0Iut2BSQSoHl0ZaW +L4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kM5joqg+RHXoHRl0S6oSlj/GuNS5zs03d29CFc1FbZE=; b=OlzMsDsO/aI2/aXdcGLWyAm5sZRvzxLWLHtIlR2Hfpprhk4Hb5duFbDRd3h4w3UmmL DThswwJYxisvFyI6VYx7xU3E9CFahseyQYSY4HS9Hajn/2+6yNO8akD1HIOycTgUNj6L +sW8SEtUj4OY64xHaOY/vHPVaCPy11okH1W8aPK+dZk7ukNsepBvkek7xI/+VfuCVBus +Ow6v1b5rUFFMJbRQoxUErzKwBXH9sCLOps1jK91hGRyn9zVPNgJFArlvqfqTRhi8/1V m0Xf6XF58P68V54gTbha7clnrLCsUfgGl132dfncgr+E1QqazEGJybQqphVYxTEN4fJE d60w== X-Gm-Message-State: AOAM5330qLLFJtUJLuHi/3dwQG7nTENEyn2Vx4WBQRpuKqgK6IGNwVJs BdGsC0by8FF5rs7wOjWF8lQut1vppELJG89GrWENuA== X-Received: by 2002:aed:20cb:: with SMTP id 69mr6721963qtb.106.1598302097162; Mon, 24 Aug 2020 13:48:17 -0700 (PDT) MIME-Version: 1.0 References: <20200824204501.1707957-1-khazhy@google.com> In-Reply-To: <20200824204501.1707957-1-khazhy@google.com> From: Khazhismel Kumykov Date: Mon, 24 Aug 2020 13:48:05 -0700 Message-ID: Subject: Re: [PATCH] block: grant IOPRIO_CLASS_RT to CAP_SYS_NICE To: Jens Axboe Cc: Serge Hallyn , Paolo Valente , Bart Van Assche , linux-block@vger.kernel.org, Linux Kernel Mailing List , linux-security-module@vger.kernel.org Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="000000000000c704f105ada5b4d9" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --000000000000c704f105ada5b4d9 Content-Type: text/plain; charset="UTF-8" On Mon, Aug 24, 2020 at 1:45 PM Khazhismel Kumykov wrote: > > CAP_SYS_ADMIN is too broad, and ionice fits into CAP_SYS_NICE's grouping. > > Retain CAP_SYS_ADMIN permission for backwards compatibility. > > Signed-off-by: Khazhismel Kumykov > --- > block/ioprio.c | 2 +- > include/uapi/linux/capability.h | 2 ++ > 2 files changed, 3 insertions(+), 1 deletion(-) > > diff --git a/block/ioprio.c b/block/ioprio.c > index 77bcab11dce5..4572456430f9 100644 > --- a/block/ioprio.c > +++ b/block/ioprio.c > @@ -69,7 +69,7 @@ int ioprio_check_cap(int ioprio) > > switch (class) { > case IOPRIO_CLASS_RT: > - if (!capable(CAP_SYS_ADMIN)) > + if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_NICE)) yikes, sorry for the spam > return -EPERM; > /* fall through */ > /* rt has prio field too */ > diff --git a/include/uapi/linux/capability.h b/include/uapi/linux/capability.h > index 395dd0df8d08..c6ca33034147 100644 > --- a/include/uapi/linux/capability.h > +++ b/include/uapi/linux/capability.h > @@ -288,6 +288,8 @@ struct vfs_ns_cap_data { > processes and setting the scheduling algorithm used by another > process. */ > /* Allow setting cpu affinity on other processes */ > +/* Allow setting realtime ioprio class */ > +/* Allow setting ioprio class on other processes */ > > #define CAP_SYS_NICE 23 > > -- > 2.28.0.297.g1956fa8f8d-goog > --000000000000c704f105ada5b4d9 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIPBgYJKoZIhvcNAQcCoIIO9zCCDvMCAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg ggxpMIIEkjCCA3qgAwIBAgINAewckktV4F6Q7sAtGDANBgkqhkiG9w0BAQsFADBMMSAwHgYDVQQL ExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMK R2xvYmFsU2lnbjAeFw0xODA2MjAwMDAwMDBaFw0yODA2MjAwMDAwMDBaMEsxCzAJBgNVBAYTAkJF MRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMSEwHwYDVQQDExhHbG9iYWxTaWduIFNNSU1FIENB IDIwMTgwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCUeobu8FdB5oJg6Fz6SFf8YsPI dNcq4rBSiSDAwqMNYbeTpRrINMBdWuPqVWaBX7WHYMsKQwCOvAF1b7rkD+ROo+CCTJo76EAY25Pp jt7TYP/PxoLesLQ+Ld088+BeyZg9pQaf0VK4tn23fOCWbFWoM8hdnF86Mqn6xB6nLsxJcz4CUGJG qAhC3iedFiCfZfsIp2RNyiUhzPAqalkrtD0bZQvCgi5aSNJseNyCysS1yA58OuxEyn2e9itZJE+O sUeD8VFgz+nAYI5r/dmFEXu5d9npLvTTrSJjrEmw2/ynKn6r6ONueZnCfo6uLmP1SSglhI/SN7dy L1rKUCU7R1MjAgMBAAGjggFyMIIBbjAOBgNVHQ8BAf8EBAMCAYYwJwYDVR0lBCAwHgYIKwYBBQUH AwIGCCsGAQUFBwMEBggrBgEFBQcDCTASBgNVHRMBAf8ECDAGAQH/AgEAMB0G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