Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp99345pxk; Sat, 29 Aug 2020 18:01:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwR5J2zuF1dk1XNvawcrd6ShyWGaJZxbyw0Z3QiPxBKNnJ+IiVWCX7sCLbPLaVIUL1YSmeY X-Received: by 2002:a17:906:2acf:: with SMTP id m15mr2660155eje.257.1598749292859; Sat, 29 Aug 2020 18:01:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598749292; cv=none; d=google.com; s=arc-20160816; b=P6X8fCEmt3G9Es/Xf7LSgYn56gBrfbZc1lksskXVlGA0rbN0W9OKevA6b47WJv2p4b UKak9RHnK8UTWy/1H8Uea7jxZOT6tbZxKN6d03KwWhDaGPN5O5XS6P5a+vBza1MhAUAo CJvIT4K5VQYOh771YKRzQWW2Ff3sRWUEIU5EiOHYfe8vsRBGERyHoG3G9Ea6lQWH6Wk3 ox7m694J3xJa/+zoLqgOkpCo1Ier+8UfNmt2LXLx3Uq4CrOn171l/58r7hneFrohXALO 1pAxncD4IRX9HMjz12M0yB50wCecJeeQ9A8qvgBsYg77/SGKrvh0yh8EzoaD7KakiN2O Pyfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject; bh=4x9Y37hGo7dYMbHIwPQnyQub3kar4dZzeiDIibRQ0Z0=; b=SgfqTZ48PYdAfbR6E6oNC6II72yUV1Ll4X/1THFA6fqqlMvsswPYRKw7MP+svie5Ld tfMe/oZ0fB1ATXXWPKF5MaRHjZESh+Q9KA/8LBxxHvCflJ2lwMas4PKXjVJivyllLLni 6VoYbeV5O8I9/rR5Y8wGLfrdWLeq3OyR5shszuDFjy42vZsFVDu2//fxx1pa7Vtl6xXS apYt034Kmxp2CYon6gp3NodIVP03LDbULfFz3ImXZeOgfOu8gRHcMOoT71l+H8OzTb1K LHFBeTTUO7HVCOzOlEVuWjK8yjGGGW9YDSFJ7mIGtWLeqJBmwKl4xHlLyGghE3RZEbA8 UCtA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u23si2316617ejg.661.2020.08.29.18.01.07; Sat, 29 Aug 2020 18:01:32 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728567AbgH3BA3 (ORCPT + 99 others); Sat, 29 Aug 2020 21:00:29 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:35308 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728246AbgH3BA1 (ORCPT ); Sat, 29 Aug 2020 21:00:27 -0400 Received: by mail-pg1-f194.google.com with SMTP id g29so2330111pgl.2; Sat, 29 Aug 2020 18:00:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=4x9Y37hGo7dYMbHIwPQnyQub3kar4dZzeiDIibRQ0Z0=; b=DlSooqYJBqWiGlEggg1P8ytwz531RIRNJ6FCBZyacsPYnvjCBeaAlNwnnw70nEl+uz nmFX66Ej2P8O7/+OsgNkSgeiGYOv9mevgGa0BJ17wQswbM5c/lU8T5/hKPngTo2vTWmx q/spO8PCkf7DqhbW8qoNA3xSpeK2LCKK4McmO6PInWITYwL9fRHb8GeHVrEac6d9dOQI 1HPrrV2HhXXAlSpgKqIvCCFQiF76+sR84UFeKUfOuzfmDuIc4aomzHlmJpe2ifCnPnbN PVs/EPutrz+q69F+ZGXjmSTPSGauMTNVuAktwk/oaeh3ISnxaBrjU9+JSXFGYD+zffMZ UDbA== X-Gm-Message-State: AOAM530HH1agX7z0qLXCBZwi0ZMFVtwH9hRxXXrhmdglKqMTIR0tg1rt KDBoTy6cxMpQrfPfC00QqO8xOKhKsU4= X-Received: by 2002:aa7:8b0c:: with SMTP id f12mr4556707pfd.58.1598749226303; Sat, 29 Aug 2020 18:00:26 -0700 (PDT) Received: from [192.168.3.218] (c-73-241-217-19.hsd1.ca.comcast.net. [73.241.217.19]) by smtp.gmail.com with ESMTPSA id c143sm3891930pfb.84.2020.08.29.18.00.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 29 Aug 2020 18:00:25 -0700 (PDT) Subject: Re: [PATCH v2] block: grant IOPRIO_CLASS_RT to CAP_SYS_NICE To: Khazhismel Kumykov , Jens Axboe Cc: Serge Hallyn , Paolo Valente , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-api@vger.kernel.org References: <20200824221034.2170308-1-khazhy@google.com> From: Bart Van Assche Autocrypt: addr=bvanassche@acm.org; prefer-encrypt=mutual; keydata= mQENBFSOu4oBCADcRWxVUvkkvRmmwTwIjIJvZOu6wNm+dz5AF4z0FHW2KNZL3oheO3P8UZWr LQOrCfRcK8e/sIs2Y2D3Lg/SL7qqbMehGEYcJptu6mKkywBfoYbtBkVoJ/jQsi2H0vBiiCOy fmxMHIPcYxaJdXxrOG2UO4B60Y/BzE6OrPDT44w4cZA9DH5xialliWU447Bts8TJNa3lZKS1 AvW1ZklbvJfAJJAwzDih35LxU2fcWbmhPa7EO2DCv/LM1B10GBB/oQB5kvlq4aA2PSIWkqz4 3S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TANYG22y //x8dLe2Fv1By4SKGhmzwH87uXxbTJAUxiWIi1np0z3/RDnoVyfmfbbL1DY7zf2hYXLLzsJR mSsED/1nlJ9Oq5fALdNEPgDyPUerqHxcmIub+pF0AzJoYHK5punqpqfGmqPbjxrJLPJfHVKy goMj5DlBMoYqEgpbwdUYkH6QdizJJCur4icy8GUNbisFYABeoJ91pnD4IGei3MTdvINSZI5e Message-ID: Date: Sat, 29 Aug 2020 18:00:24 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200824221034.2170308-1-khazhy@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-08-24 15:10, 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(-) > > v2: fix embarrassing logic mistake > diff --git a/block/ioprio.c b/block/ioprio.c > index 77bcab11dce5..276496246fe9 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_NICE) && !capable(CAP_SYS_ADMIN)) > 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 From https://www.kernel.org/doc/man-pages/linux-api-ml.html: "all Linux kernel patches that change userspace interfaces should be CCed to linux-api@vger.kernel.org" So I have added the linux-api mailing list to the Cc-list. Anyway: Reviewed-by: Bart Van Assche