linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] perf_event_open.2: update the man page with CAP_PERFMON related information
@ 2020-02-17  8:18 Alexey Budankov
  2020-08-23 17:28 ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 5+ messages in thread
From: Alexey Budankov @ 2020-02-17  8:18 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages)
  Cc: linux-man, James Morris, Serge Hallyn, Stephen Smalley,
	Peter Zijlstra, Arnaldo Carvalho de Melo, Ingo Molnar,
	Thomas Gleixner, Andi Kleen, linux-kernel


Extend perf_event_open 2 man page with the information about
CAP_PERFMON capability designed to secure performance monitoring
and observability operation in a system according to the principle
of least privilege [1] (POSIX IEEE 1003.1e, 2.2.2.39).

[1] https://sites.google.com/site/fullycapable/, posix_1003.1e-990310.pdf

Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
---
 man2/perf_event_open.2 | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/man2/perf_event_open.2 b/man2/perf_event_open.2
index 89d267c02..e9aab2ca1 100644
--- a/man2/perf_event_open.2
+++ b/man2/perf_event_open.2
@@ -98,6 +98,8 @@ when running on the specified CPU.
 .BR "pid == \-1" " and " "cpu >= 0"
 This measures all processes/threads on the specified CPU.
 This requires
+.B CAP_PERFMON
+or
 .B CAP_SYS_ADMIN
 capability or a
 .I /proc/sys/kernel/perf_event_paranoid
@@ -2920,6 +2922,8 @@ to hold the result.
 This allows attaching a Berkeley Packet Filter (BPF)
 program to an existing kprobe tracepoint event.
 You need
+.B CAP_PERFMON
+or
 .B CAP_SYS_ADMIN
 privileges to use this ioctl.
 .IP
@@ -2962,6 +2966,8 @@ have multiple events attached to a tracepoint.
 Querying this value on one tracepoint event returns the id
 of all BPF programs in all events attached to the tracepoint.
 You need
+.B CAP_PERFMON
+or
 .B CAP_SYS_ADMIN
 privileges to use this ioctl.
 .IP
@@ -3170,6 +3176,8 @@ it was expecting.
 .TP
 .B EACCES
 Returned when the requested event requires
+.B CAP_PERFMON
+or
 .B CAP_SYS_ADMIN
 permissions (or a more permissive perf_event paranoid setting).
 Some common cases where an unprivileged process
@@ -3291,6 +3299,8 @@ setting is specified.
 It can also happen, as with
 .BR EACCES ,
 when the requested event requires
+.B CAP_PERFMON
+or
 .B CAP_SYS_ADMIN
 permissions (or a more permissive perf_event paranoid setting).
 This includes setting a breakpoint on a kernel address,
@@ -3321,6 +3331,23 @@ The official way of knowing if
 support is enabled is checking
 for the existence of the file
 .IR /proc/sys/kernel/perf_event_paranoid .
+.PP
+.B CAP_PERFMON
+capability (since Linux X.Y) provides secure approach to
+performance monitoring and observability operations in a system
+according to the principal of least privilege (POSIX IEEE 1003.1e).
+Accessing system performance monitoring and observability operations
+using
+.B CAP_PERFMON
+capability singly, without the rest of
+.B CAP_SYS_ADMIN
+credentials, excludes chances to misuse the credentials and makes
+the operations more secure.
+.B CAP_SYS_ADMIN
+usage for secure system performance monitoring and observability
+is discouraged with respect to
+.B CAP_PERFMON
+capability.
 .SH BUGS
 The
 .B F_SETOWN_EX
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] perf_event_open.2: update the man page with CAP_PERFMON related information
  2020-02-17  8:18 [PATCH v1] perf_event_open.2: update the man page with CAP_PERFMON related information Alexey Budankov
@ 2020-08-23 17:28 ` Michael Kerrisk (man-pages)
  2020-08-24 20:17   ` Alexey Budankov
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-08-23 17:28 UTC (permalink / raw)
  To: Alexey Budankov
  Cc: linux-man, James Morris, Serge Hallyn, Stephen Smalley,
	Peter Zijlstra, Arnaldo Carvalho de Melo, Ingo Molnar,
	Thomas Gleixner, Andi Kleen, linux-kernel

Hello Alexey,

Could you look at the question below and update the patch.

On 2/17/20 9:18 AM, Alexey Budankov wrote:
> 
> Extend perf_event_open 2 man page with the information about
> CAP_PERFMON capability designed to secure performance monitoring
> and observability operation in a system according to the principle
> of least privilege [1] (POSIX IEEE 1003.1e, 2.2.2.39).
> 
> [1] https://sites.google.com/site/fullycapable/, posix_1003.1e-990310.pdf
> 
> Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
> ---
>   man2/perf_event_open.2 | 27 +++++++++++++++++++++++++++
>   1 file changed, 27 insertions(+)
> 
> diff --git a/man2/perf_event_open.2 b/man2/perf_event_open.2
> index 89d267c02..e9aab2ca1 100644
> --- a/man2/perf_event_open.2
> +++ b/man2/perf_event_open.2
> @@ -98,6 +98,8 @@ when running on the specified CPU.
>   .BR "pid == \-1" " and " "cpu >= 0"
>   This measures all processes/threads on the specified CPU.
>   This requires
> +.B CAP_PERFMON
> +or
>   .B CAP_SYS_ADMIN
>   capability or a
>   .I /proc/sys/kernel/perf_event_paranoid
> @@ -2920,6 +2922,8 @@ to hold the result.
>   This allows attaching a Berkeley Packet Filter (BPF)
>   program to an existing kprobe tracepoint event.
>   You need
> +.B CAP_PERFMON
> +or
>   .B CAP_SYS_ADMIN
>   privileges to use this ioctl.
>   .IP
> @@ -2962,6 +2966,8 @@ have multiple events attached to a tracepoint.
>   Querying this value on one tracepoint event returns the id
>   of all BPF programs in all events attached to the tracepoint.
>   You need
> +.B CAP_PERFMON
> +or
>   .B CAP_SYS_ADMIN
>   privileges to use this ioctl.
>   .IP
> @@ -3170,6 +3176,8 @@ it was expecting.
>   .TP
>   .B EACCES
>   Returned when the requested event requires
> +.B CAP_PERFMON
> +or
>   .B CAP_SYS_ADMIN
>   permissions (or a more permissive perf_event paranoid setting).
>   Some common cases where an unprivileged process
> @@ -3291,6 +3299,8 @@ setting is specified.
>   It can also happen, as with
>   .BR EACCES ,
>   when the requested event requires
> +.B CAP_PERFMON
> +or
>   .B CAP_SYS_ADMIN
>   permissions (or a more permissive perf_event paranoid setting).
>   This includes setting a breakpoint on a kernel address,
> @@ -3321,6 +3331,23 @@ The official way of knowing if
>   support is enabled is checking
>   for the existence of the file
>   .IR /proc/sys/kernel/perf_event_paranoid .
> +.PP
> +.B CAP_PERFMON
> +capability (since Linux X.Y) provides secure approach to

What's the version?

> +performance monitoring and observability operations in a system
> +according to the principal of least privilege (POSIX IEEE 1003.1e).
> +Accessing system performance monitoring and observability operations
> +using
> +.B CAP_PERFMON
> +capability singly, without the rest of
> +.B CAP_SYS_ADMIN
> +credentials, excludes chances to misuse the credentials and makes

I think that wording like "using CAP_PERFMON rather than the much
more powerful CAP_SYS_ADMIN..."

> +the operations more secure.
> +.B CAP_SYS_ADMIN
> +usage for secure system performance monitoring and observability
> +is discouraged with respect to
> +.B CAP_PERFMON
> +capability.
>   .SH BUGS
>   The
>   .B F_SETOWN_EX

Thanks,

Michael


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] perf_event_open.2: update the man page with CAP_PERFMON related information
  2020-08-23 17:28 ` Michael Kerrisk (man-pages)
@ 2020-08-24 20:17   ` Alexey Budankov
  2020-10-27  9:25     ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 5+ messages in thread
From: Alexey Budankov @ 2020-08-24 20:17 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages)
  Cc: linux-man, James Morris, Serge Hallyn, Stephen Smalley,
	Peter Zijlstra, Arnaldo Carvalho de Melo, Ingo Molnar,
	Thomas Gleixner, Andi Kleen, linux-kernel

Hi Michael,

On 23.08.2020 20:28, Michael Kerrisk (man-pages) wrote:
> Hello Alexey,
> 
> Could you look at the question below and update the patch.
> 
> On 2/17/20 9:18 AM, Alexey Budankov wrote:
>>
>> Extend perf_event_open 2 man page with the information about
>> CAP_PERFMON capability designed to secure performance monitoring
>> and observability operation in a system according to the principle
>> of least privilege [1] (POSIX IEEE 1003.1e, 2.2.2.39).
>>
>> [1] https://sites.google.com/site/fullycapable/, posix_1003.1e-990310.pdf
>>
>> Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
>> ---
>>   man2/perf_event_open.2 | 27 +++++++++++++++++++++++++++
>>   1 file changed, 27 insertions(+)
>>
>> diff --git a/man2/perf_event_open.2 b/man2/perf_event_open.2
>> index 89d267c02..e9aab2ca1 100644
>> --- a/man2/perf_event_open.2
>> +++ b/man2/perf_event_open.2
>> @@ -98,6 +98,8 @@ when running on the specified CPU.
>>   .BR "pid == \-1" " and " "cpu >= 0"
>>   This measures all processes/threads on the specified CPU.
>>   This requires
>> +.B CAP_PERFMON
>> +or
>>   .B CAP_SYS_ADMIN
>>   capability or a
>>   .I /proc/sys/kernel/perf_event_paranoid
>> @@ -2920,6 +2922,8 @@ to hold the result.
>>   This allows attaching a Berkeley Packet Filter (BPF)
>>   program to an existing kprobe tracepoint event.
>>   You need
>> +.B CAP_PERFMON
>> +or
>>   .B CAP_SYS_ADMIN
>>   privileges to use this ioctl.
>>   .IP
>> @@ -2962,6 +2966,8 @@ have multiple events attached to a tracepoint.
>>   Querying this value on one tracepoint event returns the id
>>   of all BPF programs in all events attached to the tracepoint.
>>   You need
>> +.B CAP_PERFMON
>> +or
>>   .B CAP_SYS_ADMIN
>>   privileges to use this ioctl.
>>   .IP
>> @@ -3170,6 +3176,8 @@ it was expecting.
>>   .TP
>>   .B EACCES
>>   Returned when the requested event requires
>> +.B CAP_PERFMON
>> +or
>>   .B CAP_SYS_ADMIN
>>   permissions (or a more permissive perf_event paranoid setting).
>>   Some common cases where an unprivileged process
>> @@ -3291,6 +3299,8 @@ setting is specified.
>>   It can also happen, as with
>>   .BR EACCES ,
>>   when the requested event requires
>> +.B CAP_PERFMON
>> +or
>>   .B CAP_SYS_ADMIN
>>   permissions (or a more permissive perf_event paranoid setting).
>>   This includes setting a breakpoint on a kernel address,
>> @@ -3321,6 +3331,23 @@ The official way of knowing if
>>   support is enabled is checking
>>   for the existence of the file
>>   .IR /proc/sys/kernel/perf_event_paranoid .
>> +.PP
>> +.B CAP_PERFMON
>> +capability (since Linux X.Y) provides secure approach to
> 
> What's the version?

It's since Linux 5.8 .

> 
>> +performance monitoring and observability operations in a system
>> +according to the principal of least privilege (POSIX IEEE 1003.1e).
>> +Accessing system performance monitoring and observability operations
>> +using
>> +.B CAP_PERFMON
>> +capability singly, without the rest of
>> +.B CAP_SYS_ADMIN
>> +credentials, excludes chances to misuse the credentials and makes
> 
> I think that wording like "using CAP_PERFMON rather than the much
> more powerful CAP_SYS_ADMIN..."

Sounds good to me like this, or similar:

"Accessing system performance monitoring and observability operations
 using CAP_PERFMON rather than the much more powerful CAP_SYS_ADMIN
 excludes chances to misuse credentials and makes operations more
 secure."

> 
>> +the operations more secure.
>> +.B CAP_SYS_ADMIN
>> +usage for secure system performance monitoring and observability
>> +is discouraged with respect to
>> +.B CAP_PERFMON
>> +capability.
>>   .SH BUGS
>>   The
>>   .B F_SETOWN_EX
> 
> Thanks,
> 
> Michael
> 

Thanks,
Alexei

P.S.
I am on vacations till 08/31.
Please expect delay in response.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] perf_event_open.2: update the man page with CAP_PERFMON related information
  2020-08-24 20:17   ` Alexey Budankov
@ 2020-10-27  9:25     ` Michael Kerrisk (man-pages)
  2020-10-27 10:34       ` Alexey Budankov
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-10-27  9:25 UTC (permalink / raw)
  To: Alexey Budankov
  Cc: linux-man, James Morris, Serge Hallyn, Stephen Smalley,
	Peter Zijlstra, Arnaldo Carvalho de Melo, Ingo Molnar,
	Thomas Gleixner, Andi Kleen, linux-kernel, Michael Kerrisk

Hi Alexei,

Would you be able to refresh this patch and resend please?

Thnks,

Michael

On Mon, 24 Aug 2020 at 22:17, Alexey Budankov
<alexey.budankov@linux.intel.com> wrote:
>
> Hi Michael,
>
> On 23.08.2020 20:28, Michael Kerrisk (man-pages) wrote:
> > Hello Alexey,
> >
> > Could you look at the question below and update the patch.
> >
> > On 2/17/20 9:18 AM, Alexey Budankov wrote:
> >>
> >> Extend perf_event_open 2 man page with the information about
> >> CAP_PERFMON capability designed to secure performance monitoring
> >> and observability operation in a system according to the principle
> >> of least privilege [1] (POSIX IEEE 1003.1e, 2.2.2.39).
> >>
> >> [1] https://sites.google.com/site/fullycapable/, posix_1003.1e-990310.pdf
> >>
> >> Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
> >> ---
> >>   man2/perf_event_open.2 | 27 +++++++++++++++++++++++++++
> >>   1 file changed, 27 insertions(+)
> >>
> >> diff --git a/man2/perf_event_open.2 b/man2/perf_event_open.2
> >> index 89d267c02..e9aab2ca1 100644
> >> --- a/man2/perf_event_open.2
> >> +++ b/man2/perf_event_open.2
> >> @@ -98,6 +98,8 @@ when running on the specified CPU.
> >>   .BR "pid == \-1" " and " "cpu >= 0"
> >>   This measures all processes/threads on the specified CPU.
> >>   This requires
> >> +.B CAP_PERFMON
> >> +or
> >>   .B CAP_SYS_ADMIN
> >>   capability or a
> >>   .I /proc/sys/kernel/perf_event_paranoid
> >> @@ -2920,6 +2922,8 @@ to hold the result.
> >>   This allows attaching a Berkeley Packet Filter (BPF)
> >>   program to an existing kprobe tracepoint event.
> >>   You need
> >> +.B CAP_PERFMON
> >> +or
> >>   .B CAP_SYS_ADMIN
> >>   privileges to use this ioctl.
> >>   .IP
> >> @@ -2962,6 +2966,8 @@ have multiple events attached to a tracepoint.
> >>   Querying this value on one tracepoint event returns the id
> >>   of all BPF programs in all events attached to the tracepoint.
> >>   You need
> >> +.B CAP_PERFMON
> >> +or
> >>   .B CAP_SYS_ADMIN
> >>   privileges to use this ioctl.
> >>   .IP
> >> @@ -3170,6 +3176,8 @@ it was expecting.
> >>   .TP
> >>   .B EACCES
> >>   Returned when the requested event requires
> >> +.B CAP_PERFMON
> >> +or
> >>   .B CAP_SYS_ADMIN
> >>   permissions (or a more permissive perf_event paranoid setting).
> >>   Some common cases where an unprivileged process
> >> @@ -3291,6 +3299,8 @@ setting is specified.
> >>   It can also happen, as with
> >>   .BR EACCES ,
> >>   when the requested event requires
> >> +.B CAP_PERFMON
> >> +or
> >>   .B CAP_SYS_ADMIN
> >>   permissions (or a more permissive perf_event paranoid setting).
> >>   This includes setting a breakpoint on a kernel address,
> >> @@ -3321,6 +3331,23 @@ The official way of knowing if
> >>   support is enabled is checking
> >>   for the existence of the file
> >>   .IR /proc/sys/kernel/perf_event_paranoid .
> >> +.PP
> >> +.B CAP_PERFMON
> >> +capability (since Linux X.Y) provides secure approach to
> >
> > What's the version?
>
> It's since Linux 5.8 .
>
> >
> >> +performance monitoring and observability operations in a system
> >> +according to the principal of least privilege (POSIX IEEE 1003.1e).
> >> +Accessing system performance monitoring and observability operations
> >> +using
> >> +.B CAP_PERFMON
> >> +capability singly, without the rest of
> >> +.B CAP_SYS_ADMIN
> >> +credentials, excludes chances to misuse the credentials and makes
> >
> > I think that wording like "using CAP_PERFMON rather than the much
> > more powerful CAP_SYS_ADMIN..."
>
> Sounds good to me like this, or similar:
>
> "Accessing system performance monitoring and observability operations
>  using CAP_PERFMON rather than the much more powerful CAP_SYS_ADMIN
>  excludes chances to misuse credentials and makes operations more
>  secure."
>
> >
> >> +the operations more secure.
> >> +.B CAP_SYS_ADMIN
> >> +usage for secure system performance monitoring and observability
> >> +is discouraged with respect to
> >> +.B CAP_PERFMON
> >> +capability.
> >>   .SH BUGS
> >>   The
> >>   .B F_SETOWN_EX
> >
> > Thanks,
> >
> > Michael
> >
>
> Thanks,
> Alexei
>
> P.S.
> I am on vacations till 08/31.
> Please expect delay in response.
>


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] perf_event_open.2: update the man page with CAP_PERFMON related information
  2020-10-27  9:25     ` Michael Kerrisk (man-pages)
@ 2020-10-27 10:34       ` Alexey Budankov
  0 siblings, 0 replies; 5+ messages in thread
From: Alexey Budankov @ 2020-10-27 10:34 UTC (permalink / raw)
  To: mtk.manpages
  Cc: linux-man, James Morris, Serge Hallyn, Stephen Smalley,
	Peter Zijlstra, Arnaldo Carvalho de Melo, Ingo Molnar,
	Thomas Gleixner, Andi Kleen, linux-kernel


On 27.10.2020 12:25, Michael Kerrisk (man-pages) wrote:
> Hi Alexei,
> 
> Would you be able to refresh this patch and resend please?

Sure. Will do.

Regards,
Alexei

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-10-27 10:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-17  8:18 [PATCH v1] perf_event_open.2: update the man page with CAP_PERFMON related information Alexey Budankov
2020-08-23 17:28 ` Michael Kerrisk (man-pages)
2020-08-24 20:17   ` Alexey Budankov
2020-10-27  9:25     ` Michael Kerrisk (man-pages)
2020-10-27 10:34       ` Alexey Budankov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).