From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Lutomirski Subject: Re: [PATCH v2] capabilities.7, prctl.2: Document ambient capabilities Date: Tue, 29 Sep 2015 10:49:57 -0700 Message-ID: References: <5552a36c5511348a90806f9661a9382c2d362603.1443488521.git.luto@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Kees Cook Cc: Andy Lutomirski , Michael Kerrisk-manpages , Serge Hallyn , Andrew Morton , Jarkko Sakkinen , Ted Ts'o , "Andrew G. Morgan" , Linux API , Mimi Zohar , Austin S Hemmelgarn , linux-security-module , Aaron Jones , Serge Hallyn , LKML , Markku Savela , Jonathan Corbet List-Id: linux-api@vger.kernel.org On Tue, Sep 29, 2015 at 10:47 AM, Kees Cook wrote: > On Mon, Sep 28, 2015 at 6:03 PM, Andy Lutomirski wrote: >> Signed-off-by: Andy Lutomirski >> --- >> man2/prctl.2 | 12 ++++++++++++ >> man7/capabilities.7 | 40 ++++++++++++++++++++++++++++++++++------ >> 2 files changed, 46 insertions(+), 6 deletions(-) >> >> diff --git a/man2/prctl.2 b/man2/prctl.2 >> index e743a6305969..5bcec391c110 100644 >> --- a/man2/prctl.2 >> +++ b/man2/prctl.2 >> @@ -954,6 +954,18 @@ had been called. >> For further information on Intel MPX, see the kernel source file >> .IR Documentation/x86/intel_mpx.txt . >> .\" >> +.TP >> +.BR PR_CAP_AMBIENT " (since Linux 4.2)" >> +Reads or changes the ambient capability set. If arg2 is PR_CAP_AMBIENT_RAISE, >> +then the capability specified in arg3 is added to the ambient set. This will >> +fail, returning EPERM, if the capability is not already both permitted and >> +inheritable or if the SECBIT_NO_CAP_AMBIENT_RAISE securebit is set. If arg2 >> +is PR_CAP_AMBIENT_LOWER, then the capability specified in arg3 is removed >> +from the ambient set. If arg2 is PR_CAP_AMBIENT_IS_SET, then >> +.BR prctl (2) >> +will return 1 if the capability in arg3 is in the ambient set and 0 if not. >> +If arg2 is PR_CAP_AMBIENT_CLEAR_ALL, then all capabilities will >> +be removed from the ambient set. > > In the case of CLEAR_ALL, is arg3 "don't care", or must it be set to 0? Must be zero. --Andy