From patchwork Fri Dec 16 20:10:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Serge E. Hallyn" X-Patchwork-Id: 9478481 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 50927601C2 for ; Fri, 16 Dec 2016 20:10:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43A7B28766 for ; Fri, 16 Dec 2016 20:10:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3827928767; Fri, 16 Dec 2016 20:10:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8F48287A5 for ; Fri, 16 Dec 2016 20:10:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932967AbcLPUK3 (ORCPT ); Fri, 16 Dec 2016 15:10:29 -0500 Received: from h2.hallyn.com ([78.46.35.8]:44970 "EHLO h2.hallyn.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932929AbcLPUKS (ORCPT ); Fri, 16 Dec 2016 15:10:18 -0500 Received: by h2.hallyn.com (Postfix, from userid 1001) id B0D89120402; Fri, 16 Dec 2016 14:10:26 -0600 (CST) Date: Fri, 16 Dec 2016 14:10:26 -0600 From: "Serge E. Hallyn" To: "Michael Kerrisk (man-pages)" Cc: Casey Schaufler , John Stultz , "Serge E. Hallyn" , James Morris , Kees Cook , Andy Lutomirski , Jann Horn , "Eric W. Biederman" , linux-man , linux-security-module , lkml Subject: Re: RFC: capabilities(7): notes for kernel developers Message-ID: <20161216201026.GB14856@mail.hallyn.com> References: <43dcc6dc-265b-5eaf-3a70-701e05200b9f@gmail.com> <9ed6371f-3d38-45b1-a85b-1fbb3e5b4fc7@schaufler-ca.com> <7a6b5f38-de8e-d8d4-e6f7-feae3f8d192e@schaufler-ca.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Quoting Michael Kerrisk (man-pages) (mtk.manpages@gmail.com): > On 12/16/2016 01:44 AM, Casey Schaufler wrote: > > On 12/15/2016 4:31 PM, John Stultz wrote: > >> On Thu, Dec 15, 2016 at 12:40 PM, Casey Schaufler > >> wrote: > >>> On 12/15/2016 11:41 AM, Michael Kerrisk (man-pages) wrote: > >>>> On 12/15/2016 05:29 PM, Casey Schaufler wrote: > >>>>> CAP_WAKE_ALARM could readily be CAP_TIME. > >>>> Actually, I don't quite understand what you mean with that sentence. > >>>> Could you elaborate? > >>> Should have said CAP_SYS_TIME > >>> > >>> Setting an alarm could be considered a time management function, > >>> depending on what it actually does. > >> Just a nit here. CAP_WAKE_ALARM is more about the privilege of waking > >> a system from suspend, while CAP_SYS_TIME covers the ability to set > >> the time. One wouldn't necessarily want to give applications which > >> could wake a system up the capability to also set the time. > > > > Doesn't really matter, except that an ignorant developer > > might make the mistake I did and assume that WAKE_ALARM > > was somehow related to time management. If you want to use > > it as an example don't let my dunderheadedness get in your > > way. > > Actually, I decided it wasn't such a good example anyway. > That capability could potentially be generic. (But it probably > should better have been named something like 'CAP_WAKE_SYSTEM'.) How about: Subject: [PATCH 1/1] capabilities: alias CAP_WAKE_SYSTEM to CAP_WAKE_ALARM As suggested by Michael Kerrisk his is a less confusing name, and this won't break any old userspace. Signed-off-by: Serge Hallyn Cc: Michael Kerrisk --- include/uapi/linux/capability.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/uapi/linux/capability.h b/include/uapi/linux/capability.h index fd4f87d..ba972ff 100644 --- a/include/uapi/linux/capability.h +++ b/include/uapi/linux/capability.h @@ -357,6 +357,8 @@ struct vfs_ns_cap_data { #define CAP_WAKE_ALARM 35 +#define CAP_WAKE_SYSTEM CAP_WAKE_ALARM + /* Allow preventing system suspends */ #define CAP_BLOCK_SUSPEND 36