Skip to contentSkip to conversation

Introduce CAP_PERFMON to secure system performance monitoring and observability

PATCH Superseded Alexey Budankov 6 participants 35 messages Jan 20, 2020 – Feb 20, 2020

Subsystems (13)
DRM drivers PowerPC Intel i915 BPF +9 more subsystems

v5 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

v5 cover Introduce CAP_PERFMON to secure system performance monitoring and observability

Currently access to perf_events, i915_perf and other performance monitoring and observability subsystems of the kernel is open for a privileged process [1] with CAP_SYS_ADMIN capability enabled in the process effective set [2].

This patch set introduces CAP_PERFMON capability designed to secure system performance monitoring and observability operations so that CAP_PERFMON would assist CAP_SYS_ADMIN capability in its governing role for perf_events, i915_perf and other performance monitoring and observability subsystems of the kernel.

CAP_PERFMON intends to take over CAP_SYS_ADMIN credentials related to system performance monitoring and observability operations and balance amount of CAP_SYS_ADMIN credentials following the recommendations in the capabilities man page [2] for CAP_SYS_ADMIN: "Note: this capability is overloaded; see Notes to kernel developers, below."

CAP_PERFMON intends to harden system security and integrity during system performance monitoring and observability operations by decreasing attack surface that is available to a CAP_SYS_ADMIN privileged process [2]. Providing the access to system performance monitoring and observability operations under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes the operation more secure.

For backward compatibility reasons access to system performance monitoring and observability subsystems of the kernel remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN capability usage for secure system performance monitoring and observability operations is discouraged with respect to the designed CAP_PERFMON capability.

CAP_PERFMON intends to meet the demand to secure system performance monitoring and observability operations in security sensitive, restricted, multiuser production environments (e.g. HPC clusters, cloud and virtual compute environments) where root or CAP_SYS_ADMIN credentials are not available to mass users of a system because of security considerations.

Possible alternative solution to this capabilities balancing, system security hardening task could be to use the existing CAP_SYS_PTRACE capability to govern system performance monitoring and observability operations. However CAP_SYS_PTRACE capability still provides users with more credentials than are required for secure performance monitoring and observability operations and this excess is avoided by the designed CAP_PERFMON capability.

Although the software running under CAP_PERFMON can not ensure avoidance of related hardware issues, the software can still mitigate those issues following the official embargoed hardware issues mitigation procedure [3]. The bugs in the software itself could be fixed following the standard kernel development process [4] to maintain and harden security of system performance monitoring and observability operations. After all, the patch set is shaped in the way that simplifies procedure for backtracking of possible issues and bugs [5] as much as possible.

The patch set is for tip perf/core repository:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip perf/core
sha1: 5738891229a25e9e678122a843cbf0466a456d0c

---
Changes in v5:
- renamed CAP_SYS_PERFMON to CAP_PERFMON
- extended perfmon_capable() with noaudit checks
Changes in v4:
- converted perfmon_capable() into an inline function
- made perf_events kprobes, uprobes, hw breakpoints and namespaces data available to CAP_SYS_PERFMON privileged processes
- applied perfmon_capable() to drivers/perf and drivers/oprofile
- extended __cmd_ftrace() with support of CAP_SYS_PERFMON
Changes in v3:
- implemented perfmon_capable() macros aggregating required capabilities checks Changes in v2:
- made perf_events trace points available to CAP_SYS_PERFMON privileged processes
- made perf_event_paranoid_check() treat CAP_SYS_PERFMON equally to CAP_SYS_ADMIN
- applied CAP_SYS_PERFMON to i915_perf, bpf_trace, powerpc and parisc system performance monitoring and observability related subsystems

---
Alexey Budankov (10):
capabilities: introduce CAP_PERFMON to kernel and user space perf/core: open access to the core for CAP_PERFMON privileged process perf/core: open access to anon probes for CAP_PERFMON privileged process perf tool: extend Perf tool with CAP_PERFMON capability support drm/i915/perf: open access for CAP_PERFMON privileged process trace/bpf_trace: open access for CAP_PERFMON privileged process powerpc/perf: open access for CAP_PERFMON privileged process parisc/perf: open access for CAP_PERFMON privileged process drivers/perf: open access for CAP_PERFMON privileged process drivers/oprofile: open access for CAP_PERFMON privileged process

 arch/parisc/kernel/perf.c           |  2 +-
 arch/powerpc/perf/imc-pmu.c         |  4 ++--
 drivers/gpu/drm/i915/i915_perf.c    | 13 ++++++-------
 drivers/oprofile/event_buffer.c     |  2 +-
 drivers/perf/arm_spe_pmu.c          |  4 ++--
 include/linux/capability.h          | 12 ++++++++++++
 include/linux/perf_event.h          |  6 +++---
 include/uapi/linux/capability.h     |  8 +++++++-
 kernel/events/core.c                |  6 +++---
 kernel/trace/bpf_trace.c            |  2 +-
 security/selinux/include/classmap.h |  4 ++--
 tools/perf/builtin-ftrace.c         |  5 +++--
 tools/perf/design.txt               |  3 ++-
 tools/perf/util/cap.h               |  4 ++++
 tools/perf/util/evsel.c             | 10 +++++-----
 tools/perf/util/util.c              |  1 +
 16 files changed, 55 insertions(+), 31 deletions(-)

---
Testing and validation (Intel Skylake, 8 cores, Fedora 29, 5.5.0-rc3+, x86_64):

libcap library [4], [5], [6] and Perf tool can be used to apply CAP_PERFMON capability for secure system performance monitoring and observability beyond the scope permitted by the system wide perf_event_paranoid kernel setting [7] and below are the steps for evaluation:

- patch, build and boot the kernel
- patch, build Perf tool e.g. to /home/user/perf
...

  # git clone git://git.kernel.org/pub/scm/libs/libcap/libcap.git libcap
  # pushd libcap
  # patch libcap/include/uapi/linux/capabilities.h with [PATCH 1]
  # make
  # pushd progs
  # ./setcap "cap_perfmon,cap_sys_ptrace,cap_syslog=ep" /home/user/perf
  # ./setcap -v "cap_perfmon,cap_sys_ptrace,cap_syslog=ep" /home/user/perf
  /home/user/perf: OK
  # ./getcap /home/user/perf
  /home/user/perf = cap_sys_ptrace,cap_syslog,cap_perfmon+ep
  # echo 2 > /proc/sys/kernel/perf_event_paranoid
  # cat /proc/sys/kernel/perf_event_paranoid 
  2
  ...
  $ /home/user/perf top
    ... works as expected ...
  $ cat /proc/`pidof perf`/status
  Name:	perf
  Umask:	0002
  State:	S (sleeping)
  Tgid:	2958
  Ngid:	0
  Pid:	2958
  PPid:	9847
  TracerPid:	0
  Uid:	500	500	500	500
  Gid:	500	500	500	500
  FDSize:	256
  ...
  CapInh:	0000000000000000
  CapPrm:	0000004400080000
  CapEff:	0000004400080000 => 01000100 00000000 00001000 00000000 00000000
                                     cap_perfmon,cap_sys_ptrace,cap_syslog
  CapBnd:	0000007fffffffff
  CapAmb:	0000000000000000
  NoNewPrivs:	0
  Seccomp:	0
  Speculation_Store_Bypass:	thread vulnerable
  Cpus_allowed:	ff
  Cpus_allowed_list:	0-7
  ...

Usage of cap_perfmon effectively avoids unused credentials excess:

- with cap_sys_admin:
CapEff: 0000007fffffffff => 01111111 11111111 11111111 11111111 11111111

- with cap_perfmon:
CapEff: 0000004400080000 => 01000100 00000000 00001000 00000000 00000000

                                    38   34               19
                               perfmon   syslog           sys_ptrace

---
[1] https://www.kernel.org/doc/html/latest/admin-guide/perf-security.html
[2] http://man7.org/linux/man-pages/man7/capabilities.7.html
[3] https://www.kernel.org/doc/html/latest/process/embargoed-hardware-issues.html
[4] https://www.kernel.org/doc/html/latest/admin-guide/security-bugs.html
[5] https://www.kernel.org/doc/html/latest/process/management-style.html#decisions
[6] http://man7.org/linux/man-pages/man8/setcap.8.html
[7] https://git.kernel.org/pub/scm/libs/libcap/libcap.git
[8] https://sites.google.com/site/fullycapable/, posix_1003.1e-990310.pdf
[9] http://man7.org/linux/man-pages/man2/perf_event_open.2.html

Signature · 1 line
2.20.1
#1 lore raw

PATCH v5 1/10 capabilities: introduce CAP_PERFMON to kernel and user space

Introduce CAP_PERFMON capability designed to secure system performance monitoring and observability operations so that CAP_PERFMON would assist CAP_SYS_ADMIN capability in its governing role for perf_events, i915_perf and other performance monitoring and observability subsystems.

CAP_PERFMON intends to harden system security and integrity during system performance monitoring and observability operations by decreasing attack surface that is available to a CAP_SYS_ADMIN privileged process [1]. Providing access to system performance monitoring and observability operations under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure.

CAP_PERFMON intends to take over CAP_SYS_ADMIN credentials related to system performance monitoring and observability operations and balance amount of CAP_SYS_ADMIN credentials following the recommendations in the capabilities man page [1] for CAP_SYS_ADMIN: "Note: this capability is overloaded; see Notes to kernel developers, below."

Although the software running under CAP_PERFMON can not ensure avoidance of related hardware issues, the software can still mitigate these issues following the official embargoed hardware issues mitigation procedure [2]. The bugs in the software itself could be fixed following the standard kernel development process [3] to maintain and harden security of system performance monitoring and observability operations.

[1] http://man7.org/linux/man-pages/man7/capabilities.7.html
[2] https://www.kernel.org/doc/html/latest/process/embargoed-hardware-issues.html
[3] https://www.kernel.org/doc/html/latest/admin-guide/security-bugs.html

---
 include/linux/capability.h          | 12 ++++++++++++
 include/uapi/linux/capability.h     |  8 +++++++-
 security/selinux/include/classmap.h |  4 ++--
 3 files changed, 21 insertions(+), 3 deletions(-)
include/linux/capability.h +12 -0
index ecce0f43c73a..8784969d91e1 100644
@@ -251,6 +251,18 @@ extern bool privileged_wrt_inode_uidgid(struct user_namespace *ns, const struct
 extern bool capable_wrt_inode_uidgid(const struct inode *inode, int cap);
 extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap);
 extern bool ptracer_capable(struct task_struct *tsk, struct user_namespace *ns);
+static inline bool perfmon_capable(void)
+{
+	struct user_namespace *ns = &init_user_ns;
+
+	if (ns_capable_noaudit(ns, CAP_PERFMON))
+		return ns_capable(ns, CAP_PERFMON);
+
+	if (ns_capable_noaudit(ns, CAP_SYS_ADMIN))
+		return ns_capable(ns, CAP_SYS_ADMIN);
+
+	return false;
+}
 
 /* audit system wants to get cap info from files as well */
 extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps);
include/uapi/linux/capability.h +7 -1
index 240fdb9a60f6..8b416e5f3afa 100644
@@ -366,8 +366,14 @@ struct vfs_ns_cap_data {
 
 #define CAP_AUDIT_READ		37
 
+/*
+ * Allow system performance and observability privileged operations
+ * using perf_events, i915_perf and other kernel subsystems
+ */
+
+#define CAP_PERFMON		38
 
-#define CAP_LAST_CAP         CAP_AUDIT_READ
+#define CAP_LAST_CAP         CAP_PERFMON
 
 #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
 
security/selinux/include/classmap.h +2 -2
index 7db24855e12d..c599b0c2b0e7 100644
@@ -27,9 +27,9 @@
 	    "audit_control", "setfcap"
 
 #define COMMON_CAP2_PERMS  "mac_override", "mac_admin", "syslog", \
-		"wake_alarm", "block_suspend", "audit_read"
+		"wake_alarm", "block_suspend", "audit_read", "perfmon"
 
-#if CAP_LAST_CAP > CAP_AUDIT_READ
+#if CAP_LAST_CAP > CAP_PERFMON
 #error New capability defined, please update COMMON_CAP2_PERMS.
 #endif
 
Signature · 1 line
2.20.1
#2 lore raw

Re: [PATCH v5 01/10] capabilities: introduce CAP_PERFMON to kernel and user space

Quoted 48 lines · Alexey Budankov

Introduce CAP_PERFMON capability designed to secure system performance monitoring and observability operations so that CAP_PERFMON would assist CAP_SYS_ADMIN capability in its governing role for perf_events, i915_perf and other performance monitoring and observability subsystems.

CAP_PERFMON intends to harden system security and integrity during system performance monitoring and observability operations by decreasing attack surface that is available to a CAP_SYS_ADMIN privileged process [1]. Providing access to system performance monitoring and observability operations under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure.

CAP_PERFMON intends to take over CAP_SYS_ADMIN credentials related to system performance monitoring and observability operations and balance amount of CAP_SYS_ADMIN credentials following the recommendations in the capabilities man page [1] for CAP_SYS_ADMIN: "Note: this capability is overloaded; see Notes to kernel developers, below."

Although the software running under CAP_PERFMON can not ensure avoidance of related hardware issues, the software can still mitigate these issues following the official embargoed hardware issues mitigation procedure [2]. The bugs in the software itself could be fixed following the standard kernel development process [3] to maintain and harden security of system performance monitoring and observability operations.

[1] http://man7.org/linux/man-pages/man7/capabilities.7.html
[2] https://www.kernel.org/doc/html/latest/process/embargoed-hardware-issues.html
[3] https://www.kernel.org/doc/html/latest/admin-guide/security-bugs.html

---
  include/linux/capability.h          | 12 ++++++++++++
  include/uapi/linux/capability.h     |  8 +++++++-
  security/selinux/include/classmap.h |  4 ++--
  3 files changed, 21 insertions(+), 3 deletions(-)
include/linux/capability.h +2 -0
index ecce0f43c73a..8784969d91e1 100644
@@ -251,6 +251,18 @@ extern bool privileged_wrt_inode_uidgid(struct user_namespace *ns, const struct
  extern bool capable_wrt_inode_uidgid(const struct inode *inode, int cap);
  extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap);
  extern bool ptracer_capable(struct task_struct *tsk, struct user_namespace *ns);
+static inline bool perfmon_capable(void)
+{

include/linux/capability.h extern bool privileged_wrt_inode_uidgid(struct user_namespace *ns, const struct · line 265

Quoted 10 lines
include/linux/capability.h +10 -0
+	struct user_namespace *ns = &init_user_ns;
+
+	if (ns_capable_noaudit(ns, CAP_PERFMON))
+		return ns_capable(ns, CAP_PERFMON);
+
+	if (ns_capable_noaudit(ns, CAP_SYS_ADMIN))
+		return ns_capable(ns, CAP_SYS_ADMIN);
+
+	return false;
+}

Why _noaudit()? Normally only used when a permission failure is non-fatal to the operation. Otherwise, we want the audit message.

#3 lore raw

Re: [PATCH v5 01/10] capabilities: introduce CAP_PERFMON to kernel and user space

Quoted 53 lines · Stephen Smalley
Quoted 52 lines · Alexey Budankov

Introduce CAP_PERFMON capability designed to secure system performance monitoring and observability operations so that CAP_PERFMON would assist CAP_SYS_ADMIN capability in its governing role for perf_events, i915_perf and other performance monitoring and observability subsystems.

CAP_PERFMON intends to harden system security and integrity during system performance monitoring and observability operations by decreasing attack surface that is available to a CAP_SYS_ADMIN privileged process [1]. Providing access to system performance monitoring and observability operations under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure.

CAP_PERFMON intends to take over CAP_SYS_ADMIN credentials related to system performance monitoring and observability operations and balance amount of CAP_SYS_ADMIN credentials following the recommendations in the capabilities man page [1] for CAP_SYS_ADMIN: "Note: this capability is overloaded; see Notes to kernel developers, below."

Although the software running under CAP_PERFMON can not ensure avoidance of related hardware issues, the software can still mitigate these issues following the official embargoed hardware issues mitigation procedure [2]. The bugs in the software itself could be fixed following the standard kernel development process [3] to maintain and harden security of system performance monitoring and observability operations.

[1] http://man7.org/linux/man-pages/man7/capabilities.7.html
[2] https://www.kernel.org/doc/html/latest/process/embargoed-hardware-issues.html
[3] https://www.kernel.org/doc/html/latest/admin-guide/security-bugs.html

---
  include/linux/capability.h          | 12 ++++++++++++ include/uapi/linux/capability.h     |  8 +++++++- security/selinux/include/classmap.h |  4 ++--

  3 files changed, 21 insertions(+), 3 deletions(-)
include/linux/capability.h +6 -0
index ecce0f43c73a..8784969d91e1 100644
@@ -251,6 +251,18 @@ extern bool privileged_wrt_inode_uidgid(struct user_namespace *ns, const struct
   extern bool capable_wrt_inode_uidgid(const struct inode *inode, int cap);
   extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap);
   extern bool ptracer_capable(struct task_struct *tsk, struct user_namespace *ns);
+static inline bool perfmon_capable(void)
+{
+    struct user_namespace *ns = &init_user_ns;
+
+    if (ns_capable_noaudit(ns, CAP_PERFMON))
+        return ns_capable(ns, CAP_PERFMON);
Quoted 8 lines

include/linux/capability.h extern bool privileged_wrt_inode_uidgid(struct user_namespace *ns, const struct · line 265

Quoted 6 lines
include/linux/capability.h +6 -0
+
+    if (ns_capable_noaudit(ns, CAP_SYS_ADMIN))
+        return ns_capable(ns, CAP_SYS_ADMIN);
+
+    return false;
+}

Why _noaudit()?  Normally only used when a permission failure is non-fatal to the operation.  Otherwise, we want the audit message.

Some of ideas from v4 review.
Well, on the second sight, it defenitly should be logged for CAP_SYS_ADMIN. Probably it is not so fatal for CAP_PERFMON, but personally
I would unconditionally log it for CAP_PERFMON as well.
Good catch, thank you.

~Alexey

#4 lore raw

Re: [PATCH v5 01/10] capabilities: introduce CAP_PERFMON to kernel and user space

Quoted 65 lines · Alexey Budankov
Quoted 53 lines · Stephen Smalley
Quoted 52 lines · Alexey Budankov

Introduce CAP_PERFMON capability designed to secure system performance monitoring and observability operations so that CAP_PERFMON would assist CAP_SYS_ADMIN capability in its governing role for perf_events, i915_perf and other performance monitoring and observability subsystems.

CAP_PERFMON intends to harden system security and integrity during system performance monitoring and observability operations by decreasing attack surface that is available to a CAP_SYS_ADMIN privileged process [1]. Providing access to system performance monitoring and observability operations under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure.

CAP_PERFMON intends to take over CAP_SYS_ADMIN credentials related to system performance monitoring and observability operations and balance amount of CAP_SYS_ADMIN credentials following the recommendations in the capabilities man page [1] for CAP_SYS_ADMIN: "Note: this capability is overloaded; see Notes to kernel developers, below."

Although the software running under CAP_PERFMON can not ensure avoidance of related hardware issues, the software can still mitigate these issues following the official embargoed hardware issues mitigation procedure [2]. The bugs in the software itself could be fixed following the standard kernel development process [3] to maintain and harden security of system performance monitoring and observability operations.

[1] http://man7.org/linux/man-pages/man7/capabilities.7.html
[2] https://www.kernel.org/doc/html/latest/process/embargoed-hardware-issues.html
[3] https://www.kernel.org/doc/html/latest/admin-guide/security-bugs.html

---
  include/linux/capability.h          | 12 ++++++++++++
  include/uapi/linux/capability.h     |  8 +++++++-
  security/selinux/include/classmap.h |  4 ++--
  3 files changed, 21 insertions(+), 3 deletions(-)
include/linux/capability.h +6 -0
index ecce0f43c73a..8784969d91e1 100644
@@ -251,6 +251,18 @@ extern bool privileged_wrt_inode_uidgid(struct user_namespace *ns, const struct
  extern bool capable_wrt_inode_uidgid(const struct inode *inode, int cap);
  extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap);
  extern bool ptracer_capable(struct task_struct *tsk, struct user_namespace *ns);
+static inline bool perfmon_capable(void)
+{
+    struct user_namespace *ns = &init_user_ns;
+
+    if (ns_capable_noaudit(ns, CAP_PERFMON))
+        return ns_capable(ns, CAP_PERFMON);
Quoted 8 lines

include/linux/capability.h extern bool privileged_wrt_inode_uidgid(struct user_namespace *ns, const struct · line 265

Quoted 6 lines
include/linux/capability.h +6 -0
+
+    if (ns_capable_noaudit(ns, CAP_SYS_ADMIN))
+        return ns_capable(ns, CAP_SYS_ADMIN);
+
+    return false;
+}

Why _noaudit()? Normally only used when a permission failure is non-fatal to the operation. Otherwise, we want the audit message.

Quoted 1 line

Some of ideas from v4 review.

well, in the requested changes form v4 I wrote:
return capable(CAP_PERFMON);
instead of
return false;

That's what Andy suggested earlier for CAP_BPF.
I think that should resolve Stephen's concern.

#5 lore raw

Re: [PATCH v5 01/10] capabilities: introduce CAP_PERFMON to kernel and user space

Quoted 67 lines · Alexei Starovoitov
Quoted 65 lines · Alexey Budankov
Quoted 61 lines · Stephen Smalley
Quoted 48 lines · Alexey Budankov

Introduce CAP_PERFMON capability designed to secure system performance monitoring and observability operations so that CAP_PERFMON would assist CAP_SYS_ADMIN capability in its governing role for perf_events, i915_perf and other performance monitoring and observability subsystems.

CAP_PERFMON intends to harden system security and integrity during system performance monitoring and observability operations by decreasing attack surface that is available to a CAP_SYS_ADMIN privileged process [1]. Providing access to system performance monitoring and observability operations under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure.

CAP_PERFMON intends to take over CAP_SYS_ADMIN credentials related to system performance monitoring and observability operations and balance amount of CAP_SYS_ADMIN credentials following the recommendations in the capabilities man page [1] for CAP_SYS_ADMIN: "Note: this capability is overloaded; see Notes to kernel developers, below."

Although the software running under CAP_PERFMON can not ensure avoidance of related hardware issues, the software can still mitigate these issues following the official embargoed hardware issues mitigation procedure [2]. The bugs in the software itself could be fixed following the standard kernel development process [3] to maintain and harden security of system performance monitoring and observability operations.

[1] http://man7.org/linux/man-pages/man7/capabilities.7.html
[2] https://www.kernel.org/doc/html/latest/process/embargoed-hardware-issues.html
[3] https://www.kernel.org/doc/html/latest/admin-guide/security-bugs.html

---
  include/linux/capability.h          | 12 ++++++++++++
  include/uapi/linux/capability.h     |  8 +++++++-
  security/selinux/include/classmap.h |  4 ++--
  3 files changed, 21 insertions(+), 3 deletions(-)
include/linux/capability.h +2 -0
index ecce0f43c73a..8784969d91e1 100644
@@ -251,6 +251,18 @@ extern bool privileged_wrt_inode_uidgid(struct user_namespace *ns, const struct
  extern bool capable_wrt_inode_uidgid(const struct inode *inode, int cap);
  extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap);
  extern bool ptracer_capable(struct task_struct *tsk, struct user_namespace *ns);
+static inline bool perfmon_capable(void)
+{

include/linux/capability.h extern bool privileged_wrt_inode_uidgid(struct user_namespace *ns, const struct · line 265

Quoted 10 lines
include/linux/capability.h +10 -0
+    struct user_namespace *ns = &init_user_ns;
+
+    if (ns_capable_noaudit(ns, CAP_PERFMON))
+        return ns_capable(ns, CAP_PERFMON);
+
+    if (ns_capable_noaudit(ns, CAP_SYS_ADMIN))
+        return ns_capable(ns, CAP_SYS_ADMIN);
+
+    return false;
+}

Why _noaudit()? Normally only used when a permission failure is non-fatal to the operation. Otherwise, we want the audit message.

Quoted 6 lines
Quoted 1 line

Some of ideas from v4 review.

well, in the requested changes form v4 I wrote:
return capable(CAP_PERFMON);
instead of
return false;

Aww, indeed. I was concerning exactly about it when updating the patch and simply put false, missing the fact that capable() also logs.

I suppose the idea is originally from here [1].
BTW, Has it already seen any _more optimal_ implementation? Anyway, original or optimized version could be reused for CAP_PERFMON.

~Alexey

[1] https://patchwork.ozlabs.org/patch/1159243/

Quoted 4 lines

That's what Andy suggested earlier for CAP_BPF.
I think that should resolve Stephen's concern.

#6 lore raw

Re: [PATCH v5 01/10] capabilities: introduce CAP_PERFMON to kernel and user space

Quoted 60 lines · Alexey Budankov
Quoted 58 lines · Alexei Starovoitov
Quoted 56 lines · Alexey Budankov
Quoted 53 lines · Stephen Smalley
Quoted 52 lines · Alexey Budankov

Introduce CAP_PERFMON capability designed to secure system performance monitoring and observability operations so that CAP_PERFMON would assist CAP_SYS_ADMIN capability in its governing role for perf_events, i915_perf and other performance monitoring and observability subsystems.

CAP_PERFMON intends to harden system security and integrity during system performance monitoring and observability operations by decreasing attack surface that is available to a CAP_SYS_ADMIN privileged process [1]. Providing access to system performance monitoring and observability operations under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure.

CAP_PERFMON intends to take over CAP_SYS_ADMIN credentials related to system performance monitoring and observability operations and balance amount of CAP_SYS_ADMIN credentials following the recommendations in the capabilities man page [1] for CAP_SYS_ADMIN: "Note: this capability is overloaded; see Notes to kernel developers, below."

Although the software running under CAP_PERFMON can not ensure avoidance of related hardware issues, the software can still mitigate these issues following the official embargoed hardware issues mitigation procedure [2]. The bugs in the software itself could be fixed following the standard kernel development process [3] to maintain and harden security of system performance monitoring and observability operations.

[1] http://man7.org/linux/man-pages/man7/capabilities.7.html
[2] https://www.kernel.org/doc/html/latest/process/embargoed-hardware-issues.html
[3] https://www.kernel.org/doc/html/latest/admin-guide/security-bugs.html

---
  include/linux/capability.h          | 12 ++++++++++++
  include/uapi/linux/capability.h     |  8 +++++++-
  security/selinux/include/classmap.h |  4 ++--
  3 files changed, 21 insertions(+), 3 deletions(-)
include/linux/capability.h +6 -0
index ecce0f43c73a..8784969d91e1 100644
@@ -251,6 +251,18 @@ extern bool privileged_wrt_inode_uidgid(struct user_namespace *ns, const struct
  extern bool capable_wrt_inode_uidgid(const struct inode *inode, int cap);
  extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap);
  extern bool ptracer_capable(struct task_struct *tsk, struct user_namespace *ns);
+static inline bool perfmon_capable(void)
+{
+    struct user_namespace *ns = &init_user_ns;
+
+    if (ns_capable_noaudit(ns, CAP_PERFMON))
+        return ns_capable(ns, CAP_PERFMON);
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

include/linux/capability.h extern bool privileged_wrt_inode_uidgid(struct user_namespace *ns, const struct · line 265

Quoted 6 lines
include/linux/capability.h +6 -0
+
+    if (ns_capable_noaudit(ns, CAP_SYS_ADMIN))
+        return ns_capable(ns, CAP_SYS_ADMIN);
+
+    return false;
+}

Why _noaudit()? Normally only used when a permission failure is non-fatal to the operation. Otherwise, we want the audit message.

So far so good, I suggest using the simplest version for v6:

static inline bool perfmon_capable(void)

{
	return capable(CAP_PERFMON) || capable(CAP_SYS_ADMIN);
}

It keeps the implementation simple and readable. The implementation is more performant in the sense of calling the API - one capable() call for CAP_PERFMON privileged process.

Yes, it bloats audit log for CAP_SYS_ADMIN privileged and unprivileged processes, but this bloating also advertises and leverages using more secure CAP_PERFMON based approach to use perf_event_open system call.

~Alexey

Quoted 23 lines
Quoted 7 lines
Quoted 2 lines

Some of ideas from v4 review.

well, in the requested changes form v4 I wrote:
return capable(CAP_PERFMON);
instead of
return false;

Aww, indeed. I was concerning exactly about it when updating the patch and simply put false, missing the fact that capable() also logs.

I suppose the idea is originally from here [1].
BTW, Has it already seen any _more optimal_ implementation? Anyway, original or optimized version could be reused for CAP_PERFMON.

~Alexey

[1] https://patchwork.ozlabs.org/patch/1159243/

Quoted 4 lines

That's what Andy suggested earlier for CAP_BPF.
I think that should resolve Stephen's concern.

#7 lore raw

Re: [PATCH v5 01/10] capabilities: introduce CAP_PERFMON to kernel and user space

Quoted 78 lines · Alexey Budankov
Quoted 60 lines · Alexey Budankov
Quoted 58 lines · Alexei Starovoitov
Quoted 56 lines · Alexey Budankov
Quoted 53 lines · Stephen Smalley
Quoted 52 lines · Alexey Budankov

Introduce CAP_PERFMON capability designed to secure system performance monitoring and observability operations so that CAP_PERFMON would assist CAP_SYS_ADMIN capability in its governing role for perf_events, i915_perf and other performance monitoring and observability subsystems.

CAP_PERFMON intends to harden system security and integrity during system performance monitoring and observability operations by decreasing attack surface that is available to a CAP_SYS_ADMIN privileged process [1]. Providing access to system performance monitoring and observability operations under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure.

CAP_PERFMON intends to take over CAP_SYS_ADMIN credentials related to system performance monitoring and observability operations and balance amount of CAP_SYS_ADMIN credentials following the recommendations in the capabilities man page [1] for CAP_SYS_ADMIN: "Note: this capability is overloaded; see Notes to kernel developers, below."

Although the software running under CAP_PERFMON can not ensure avoidance of related hardware issues, the software can still mitigate these issues following the official embargoed hardware issues mitigation procedure [2]. The bugs in the software itself could be fixed following the standard kernel development process [3] to maintain and harden security of system performance monitoring and observability operations.

[1] http://man7.org/linux/man-pages/man7/capabilities.7.html
[2] https://www.kernel.org/doc/html/latest/process/embargoed-hardware-issues.html
[3] https://www.kernel.org/doc/html/latest/admin-guide/security-bugs.html

---
   include/linux/capability.h          | 12 ++++++++++++
   include/uapi/linux/capability.h     |  8 +++++++-
   security/selinux/include/classmap.h |  4 ++--
   3 files changed, 21 insertions(+), 3 deletions(-)
include/linux/capability.h +6 -0
index ecce0f43c73a..8784969d91e1 100644
@@ -251,6 +251,18 @@ extern bool privileged_wrt_inode_uidgid(struct user_namespace *ns, const struct
   extern bool capable_wrt_inode_uidgid(const struct inode *inode, int cap);
   extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap);
   extern bool ptracer_capable(struct task_struct *tsk, struct user_namespace *ns);
+static inline bool perfmon_capable(void)
+{
+    struct user_namespace *ns = &init_user_ns;
+
+    if (ns_capable_noaudit(ns, CAP_PERFMON))
+        return ns_capable(ns, CAP_PERFMON);
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

include/linux/capability.h extern bool privileged_wrt_inode_uidgid(struct user_namespace *ns, const struct · line 265

Quoted 6 lines
include/linux/capability.h +6 -0
+
+    if (ns_capable_noaudit(ns, CAP_SYS_ADMIN))
+        return ns_capable(ns, CAP_SYS_ADMIN);
+
+    return false;
+}

Why _noaudit()? Normally only used when a permission failure is non-fatal to the operation. Otherwise, we want the audit message.

So far so good, I suggest using the simplest version for v6:

static inline bool perfmon_capable(void)

{
	return capable(CAP_PERFMON) || capable(CAP_SYS_ADMIN);
}
Quoted 7 lines

It keeps the implementation simple and readable. The implementation is more performant in the sense of calling the API - one capable() call for CAP_PERFMON privileged process.

Yes, it bloats audit log for CAP_SYS_ADMIN privileged and unprivileged processes, but this bloating also advertises and leverages using more secure CAP_PERFMON based approach to use perf_event_open system call.

I can live with that. We just need to document that when you see both a CAP_PERFMON and a CAP_SYS_ADMIN audit message for a process, try only allowing CAP_PERFMON first and see if that resolves the issue. We have a similar issue with CAP_DAC_READ_SEARCH versus CAP_DAC_OVERRIDE.

#8 lore raw

Re: [PATCH v5 01/10] capabilities: introduce CAP_PERFMON to kernel and user space

Quoted 83 lines · Stephen Smalley
Quoted 82 lines · Alexey Budankov
Quoted 60 lines · Alexey Budankov
Quoted 58 lines · Alexei Starovoitov
Quoted 56 lines · Alexey Budankov
Quoted 53 lines · Stephen Smalley
Quoted 52 lines · Alexey Budankov

Introduce CAP_PERFMON capability designed to secure system performance monitoring and observability operations so that CAP_PERFMON would assist CAP_SYS_ADMIN capability in its governing role for perf_events, i915_perf and other performance monitoring and observability subsystems.

CAP_PERFMON intends to harden system security and integrity during system performance monitoring and observability operations by decreasing attack surface that is available to a CAP_SYS_ADMIN privileged process [1]. Providing access to system performance monitoring and observability operations under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure.

CAP_PERFMON intends to take over CAP_SYS_ADMIN credentials related to system performance monitoring and observability operations and balance amount of CAP_SYS_ADMIN credentials following the recommendations in the capabilities man page [1] for CAP_SYS_ADMIN: "Note: this capability is overloaded; see Notes to kernel developers, below."

Although the software running under CAP_PERFMON can not ensure avoidance of related hardware issues, the software can still mitigate these issues following the official embargoed hardware issues mitigation procedure [2]. The bugs in the software itself could be fixed following the standard kernel development process [3] to maintain and harden security of system performance monitoring and observability operations.

[1] http://man7.org/linux/man-pages/man7/capabilities.7.html
[2] https://www.kernel.org/doc/html/latest/process/embargoed-hardware-issues.html
[3] https://www.kernel.org/doc/html/latest/admin-guide/security-bugs.html

---
   include/linux/capability.h          | 12 ++++++++++++ include/uapi/linux/capability.h     |  8 +++++++- security/selinux/include/classmap.h |  4 ++--

   3 files changed, 21 insertions(+), 3 deletions(-)
include/linux/capability.h +6 -0
index ecce0f43c73a..8784969d91e1 100644
@@ -251,6 +251,18 @@ extern bool privileged_wrt_inode_uidgid(struct user_namespace *ns, const struct
    extern bool capable_wrt_inode_uidgid(const struct inode *inode, int cap);
    extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap);
    extern bool ptracer_capable(struct task_struct *tsk, struct user_namespace *ns);
+static inline bool perfmon_capable(void)
+{
+    struct user_namespace *ns = &init_user_ns;
+
+    if (ns_capable_noaudit(ns, CAP_PERFMON))
+        return ns_capable(ns, CAP_PERFMON);
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

include/linux/capability.h extern bool privileged_wrt_inode_uidgid(struct user_namespace *ns, const struct · line 265

Quoted 6 lines
include/linux/capability.h +6 -0
+
+    if (ns_capable_noaudit(ns, CAP_SYS_ADMIN))
+        return ns_capable(ns, CAP_SYS_ADMIN);
+
+    return false;
+}

Why _noaudit()?  Normally only used when a permission failure is non-fatal to the operation.  Otherwise, we want the audit message.

So far so good, I suggest using the simplest version for v6:

static inline bool perfmon_capable(void)
{
    return capable(CAP_PERFMON) || capable(CAP_SYS_ADMIN); }

It keeps the implementation simple and readable. The implementation is more performant in the sense of calling the API - one capable() call for CAP_PERFMON privileged process.

Quoted 5 lines
Quoted 3 lines

Yes, it bloats audit log for CAP_SYS_ADMIN privileged and unprivileged processes, but this bloating also advertises and leverages using more secure CAP_PERFMON based approach to use perf_event_open system call.

I can live with that.  We just need to document that when you see both a CAP_PERFMON and a CAP_SYS_ADMIN audit message for a process, try only allowing CAP_PERFMON first and see if that resolves the issue.  We have a similar issue with CAP_DAC_READ_SEARCH versus CAP_DAC_OVERRIDE.

perf security [1] document can be updated, at least, to align and document this audit logging specifics.

~Alexey

[1] https://www.kernel.org/doc/html/latest/admin-guide/perf-security.html

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#9 lore raw

Re: [PATCH v5 01/10] capabilities: introduce CAP_PERFMON to kernel and user space

Quoted 43 lines · Alexey Budankov
Quoted 41 lines · Stephen Smalley
Quoted 40 lines · Alexey Budankov
Quoted 38 lines · Alexey Budankov
Quoted 36 lines · Alexei Starovoitov
Quoted 34 lines · Alexey Budankov
Quoted 31 lines · Stephen Smalley
Quoted 30 lines · Alexey Budankov

Introduce CAP_PERFMON capability designed to secure system performance monitoring and observability operations so that CAP_PERFMON would assist CAP_SYS_ADMIN capability in its governing role for perf_events, i915_perf and other performance monitoring and observability subsystems.

CAP_PERFMON intends to harden system security and integrity during system performance monitoring and observability operations by decreasing attack surface that is available to a CAP_SYS_ADMIN privileged process [1]. Providing access to system performance monitoring and observability operations under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure.

CAP_PERFMON intends to take over CAP_SYS_ADMIN credentials related to system performance monitoring and observability operations and balance amount of CAP_SYS_ADMIN credentials following the recommendations in the capabilities man page [1] for CAP_SYS_ADMIN: "Note: this capability is overloaded; see Notes to kernel developers, below."

Although the software running under CAP_PERFMON can not ensure avoidance of related hardware issues, the software can still mitigate these issues following the official embargoed hardware issues mitigation procedure [2]. The bugs in the software itself could be fixed following the standard kernel development process [3] to maintain and harden security of system performance monitoring and observability operations.

[1] http://man7.org/linux/man-pages/man7/capabilities.7.html
[2] https://www.kernel.org/doc/html/latest/process/embargoed-hardware-issues.html
[3] https://www.kernel.org/doc/html/latest/admin-guide/security-bugs.html

<SNIP>

Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

Why _noaudit()?  Normally only used when a permission failure is non-fatal to the operation.  Otherwise, we want the audit message.

So far so good, I suggest using the simplest version for v6:

static inline bool perfmon_capable(void)
{
    return capable(CAP_PERFMON) || capable(CAP_SYS_ADMIN); }

It keeps the implementation simple and readable. The implementation is more performant in the sense of calling the API - one capable() call for CAP_PERFMON privileged process.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Yes, it bloats audit log for CAP_SYS_ADMIN privileged and unprivileged processes, but this bloating also advertises and leverages using more secure CAP_PERFMON based approach to use perf_event_open system call.

I can live with that.  We just need to document that when you see both a CAP_PERFMON and a CAP_SYS_ADMIN audit message for a process, try only allowing CAP_PERFMON first and see if that resolves the issue.  We have a similar issue with CAP_DAC_READ_SEARCH versus CAP_DAC_OVERRIDE.

perf security [1] document can be updated, at least, to align and document this audit logging specifics.

And I plan to update the document right after this patch set is accepted. Feel free to let me know of the places in the kernel docs that also require update w.r.t CAP_PERFMON extension.

~Alexey

Quoted 5 lines

~Alexey

[1] https://www.kernel.org/doc/html/latest/admin-guide/perf-security.html

#10 lore raw

Re: [PATCH v5 01/10] capabilities: introduce CAP_PERFMON to kernel and user space

Quoted 16 lines · Alexey Budankov
Quoted 15 lines · Alexey Budankov
Quoted 13 lines · Stephen Smalley
Quoted 7 lines

It keeps the implementation simple and readable. The implementation is more performant in the sense of calling the API - one capable() call for CAP_PERFMON privileged process.

Yes, it bloats audit log for CAP_SYS_ADMIN privileged and unprivileged processes, but this bloating also advertises and leverages using more secure CAP_PERFMON based approach to use perf_event_open system call.

I can live with that.  We just need to document that when you see both a CAP_PERFMON and a CAP_SYS_ADMIN audit message for a process, try only allowing CAP_PERFMON first and see if that resolves the issue.  We have a similar issue with CAP_DAC_READ_SEARCH versus CAP_DAC_OVERRIDE.

Quoted 6 lines
Quoted 2 lines

perf security [1] document can be updated, at least, to align and document this audit logging specifics.

And I plan to update the document right after this patch set is accepted. Feel free to let me know of the places in the kernel docs that also require update w.r.t CAP_PERFMON extension.

The documentation update wants be part of the patch set and not planned to be done _after_ the patch set is merged.

Thanks,

tglx

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#11 lore raw

Re: [PATCH v5 01/10] capabilities: introduce CAP_PERFMON to kernel and user space

Quoted 20 lines · Thomas Gleixner
Quoted 19 lines · Alexey Budankov
Quoted 17 lines · Alexey Budankov
Quoted 8 lines · Stephen Smalley
Quoted 7 lines

It keeps the implementation simple and readable. The implementation is more performant in the sense of calling the API - one capable() call for CAP_PERFMON privileged process.

Yes, it bloats audit log for CAP_SYS_ADMIN privileged and unprivileged processes, but this bloating also advertises and leverages using more secure CAP_PERFMON based approach to use perf_event_open system call.

Quoted 5 lines

I can live with that.  We just need to document that when you see both a CAP_PERFMON and a CAP_SYS_ADMIN audit message for a process, try only allowing CAP_PERFMON first and see if that resolves the issue.  We have a similar issue with CAP_DAC_READ_SEARCH versus CAP_DAC_OVERRIDE.

perf security [1] document can be updated, at least, to align and document this audit logging specifics.

Quoted 6 lines
Quoted 3 lines

And I plan to update the document right after this patch set is accepted. Feel free to let me know of the places in the kernel docs that also require update w.r.t CAP_PERFMON extension.

The documentation update wants be part of the patch set and not planned to be done _after_ the patch set is merged.

Well, accepted. It is going to make patches #11 and beyond.

Thanks,
Alexey

Quoted 5 lines

Thanks,

tglx

#12 lore raw

Re: [PATCH v5 01/10] capabilities: introduce CAP_PERFMON to kernel and user space

Quoted 22 lines · Alexey Budankov
Quoted 20 lines · Thomas Gleixner
Quoted 19 lines · Alexey Budankov
Quoted 17 lines · Alexey Budankov
Quoted 8 lines · Stephen Smalley
Quoted 7 lines

It keeps the implementation simple and readable. The implementation is more performant in the sense of calling the API - one capable() call for CAP_PERFMON privileged process.

Yes, it bloats audit log for CAP_SYS_ADMIN privileged and unprivileged processes, but this bloating also advertises and leverages using more secure CAP_PERFMON based approach to use perf_event_open system call.

Quoted 5 lines

I can live with that.  We just need to document that when you see both a CAP_PERFMON and a CAP_SYS_ADMIN audit message for a process, try only allowing CAP_PERFMON first and see if that resolves the issue.  We have a similar issue with CAP_DAC_READ_SEARCH versus CAP_DAC_OVERRIDE.

perf security [1] document can be updated, at least, to align and document this audit logging specifics.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

And I plan to update the document right after this patch set is accepted. Feel free to let me know of the places in the kernel docs that also require update w.r.t CAP_PERFMON extension.

The documentation update wants be part of the patch set and not planned to be done _after_ the patch set is merged.

Well, accepted. It is going to make patches #11 and beyond.

Patches #11 and #12 of v7 [1] contain information on CAP_PERFMON intention and usage. Patch for man-pages [2] extends perf_event_open.2 documentation.

Thanks,
Alexey

---
[1] https://lore.kernel.org/lkml/[email protected]/
[2] https://lore.kernel.org/lkml/[email protected]/

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#13 lore raw

Re: [PATCH v5 01/10] capabilities: introduce CAP_PERFMON to kernel and user space

In reply to Stephen Smalley

Hi Stephen,

Quoted 12 lines · Stephen Smalley
Quoted 11 lines · Alexey Budankov
Quoted 9 lines · Alexey Budankov
Quoted 7 lines · Alexei Starovoitov
Quoted 5 lines · Alexey Budankov
Quoted 2 lines · Stephen Smalley
Quoted 1 line · Alexey Budankov

<SNIP>

Quoted 15 lines
Quoted 15 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

Introduce CAP_PERFMON capability designed to secure system performance

Why _noaudit()?  Normally only used when a permission failure is non-fatal to the operation.  Otherwise, we want the audit message.

So far so good, I suggest using the simplest version for v6:

static inline bool perfmon_capable(void)
{
    return capable(CAP_PERFMON) || capable(CAP_SYS_ADMIN); }

It keeps the implementation simple and readable. The implementation is more performant in the sense of calling the API - one capable() call for CAP_PERFMON privileged process.

Quoted 5 lines
Quoted 3 lines

Yes, it bloats audit log for CAP_SYS_ADMIN privileged and unprivileged processes, but this bloating also advertises and leverages using more secure CAP_PERFMON based approach to use perf_event_open system call.

I can live with that.  We just need to document that when you see both a CAP_PERFMON and a CAP_SYS_ADMIN audit message for a process, try only allowing CAP_PERFMON first and see if that resolves the issue.  We have a similar issue with CAP_DAC_READ_SEARCH versus CAP_DAC_OVERRIDE.

I am trying to reproduce this double logging with CAP_PERFMON.
I am using the refpolicy version with enabled perf_event tclass [1], in permissive mode. When running perf stat -a I am observing this AVC audit messages:

type=AVC msg=audit(1581496695.666:8691): avc:  denied  { open } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1
type=AVC msg=audit(1581496695.666:8691): avc:  denied  { kernel } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1
type=AVC msg=audit(1581496695.666:8691): avc:  denied  { cpu } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1
type=AVC msg=audit(1581496695.666:8692): avc:  denied  { write } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1

However there is no capability related messages around. I suppose my refpolicy should be modified somehow to observe capability related AVCs.

Could you please comment or clarify on how to enable caps related AVCs in order to test the concerned logging.

Thanks,
Alexey

---
[1] https://github.com/SELinuxProject/refpolicy.git

#14 lore raw

Re: [PATCH v5 01/10] capabilities: introduce CAP_PERFMON to kernel and user space

Quoted 46 lines · Alexey Budankov

Hi Stephen,

Quoted 12 lines · Stephen Smalley
Quoted 11 lines · Alexey Budankov
Quoted 9 lines · Alexey Budankov
Quoted 7 lines · Alexei Starovoitov
Quoted 5 lines · Alexey Budankov
Quoted 2 lines · Stephen Smalley
Quoted 1 line · Alexey Budankov

<SNIP>

Quoted 15 lines
Quoted 15 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

Introduce CAP_PERFMON capability designed to secure system performance

Why _noaudit()?  Normally only used when a permission failure is non-fatal to the operation.  Otherwise, we want the audit message.

So far so good, I suggest using the simplest version for v6:

static inline bool perfmon_capable(void)
{
    return capable(CAP_PERFMON) || capable(CAP_SYS_ADMIN);
}

It keeps the implementation simple and readable. The implementation is more performant in the sense of calling the API - one capable() call for CAP_PERFMON privileged process.

Quoted 5 lines
Quoted 3 lines

Yes, it bloats audit log for CAP_SYS_ADMIN privileged and unprivileged processes, but this bloating also advertises and leverages using more secure CAP_PERFMON based approach to use perf_event_open system call.

I can live with that.  We just need to document that when you see both a CAP_PERFMON and a CAP_SYS_ADMIN audit message for a process, try only allowing CAP_PERFMON first and see if that resolves the issue.  We have a similar issue with CAP_DAC_READ_SEARCH versus CAP_DAC_OVERRIDE.

I am trying to reproduce this double logging with CAP_PERFMON.
I am using the refpolicy version with enabled perf_event tclass [1], in permissive mode. When running perf stat -a I am observing this AVC audit messages:

type=AVC msg=audit(1581496695.666:8691): avc:  denied  { open } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1
type=AVC msg=audit(1581496695.666:8691): avc:  denied  { kernel } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1
type=AVC msg=audit(1581496695.666:8691): avc:  denied  { cpu } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1
type=AVC msg=audit(1581496695.666:8692): avc:  denied  { write } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1
Quoted 5 lines

However there is no capability related messages around. I suppose my refpolicy should be modified somehow to observe capability related AVCs.

Could you please comment or clarify on how to enable caps related AVCs in order to test the concerned logging.

The new perfmon permission has to be defined in your policy; you'll have a message in dmesg about "Permission perfmon in class capability2 not defined in policy.". You can either add it to the common cap2 definition in refpolicy/policy/flask/access_vectors and rebuild your policy or extract your base module as CIL, add it there, and insert the updated module.

#15 lore raw

Re: [PATCH v5 01/10] capabilities: introduce CAP_PERFMON to kernel and user space

Quoted 47 lines · Stephen Smalley
Quoted 46 lines · Alexey Budankov

Hi Stephen,

Quoted 12 lines · Stephen Smalley
Quoted 11 lines · Alexey Budankov
Quoted 9 lines · Alexey Budankov
Quoted 7 lines · Alexei Starovoitov
Quoted 5 lines · Alexey Budankov
Quoted 2 lines · Stephen Smalley
Quoted 1 line · Alexey Budankov

<SNIP>

Quoted 15 lines
Quoted 15 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

Introduce CAP_PERFMON capability designed to secure system performance

Why _noaudit()?  Normally only used when a permission failure is non-fatal to the operation.  Otherwise, we want the audit message.

So far so good, I suggest using the simplest version for v6:

static inline bool perfmon_capable(void)
{
     return capable(CAP_PERFMON) || capable(CAP_SYS_ADMIN); }

It keeps the implementation simple and readable. The implementation is more performant in the sense of calling the API - one capable() call for CAP_PERFMON privileged process.

Quoted 5 lines
Quoted 3 lines

Yes, it bloats audit log for CAP_SYS_ADMIN privileged and unprivileged processes, but this bloating also advertises and leverages using more secure CAP_PERFMON based approach to use perf_event_open system call.

I can live with that.  We just need to document that when you see both a CAP_PERFMON and a CAP_SYS_ADMIN audit message for a process, try only allowing CAP_PERFMON first and see if that resolves the issue.  We have a similar issue with CAP_DAC_READ_SEARCH versus CAP_DAC_OVERRIDE.

I am trying to reproduce this double logging with CAP_PERFMON.
I am using the refpolicy version with enabled perf_event tclass [1], in permissive mode. When running perf stat -a I am observing this AVC audit messages:

type=AVC msg=audit(1581496695.666:8691): avc:  denied  { open } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1 type=AVC msg=audit(1581496695.666:8691): avc:  denied  { kernel } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1 type=AVC msg=audit(1581496695.666:8691): avc:  denied  { cpu } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1 type=AVC msg=audit(1581496695.666:8692): avc:  denied  { write } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1

Quoted 7 lines
Quoted 5 lines

However there is no capability related messages around. I suppose my refpolicy should be modified somehow to observe capability related AVCs.

Could you please comment or clarify on how to enable caps related AVCs in order to test the concerned logging.

The new perfmon permission has to be defined in your policy; you'll have a message in dmesg about "Permission perfmon in class capability2 not defined in policy.".  You can either add it to the common cap2 definition in refpolicy/policy/flask/access_vectors and rebuild your policy or extract your base module as CIL, add it there, and insert the updated module.

Yes, I already have it like this:
common cap2
{
<------>mac_override<--># unused by SELinux
<------>mac_admin
<------>syslog
<------>wake_alarm
<------>block_suspend
<------>audit_read
<------>perfmon
}

dmesg stopped reporting perfmon as not defined but audit.log still doesn't report CAP_PERFMON denials. BTW, audit even doesn't report CAP_SYS_ADMIN denials, however perfmon_capable() does check for it.

~Alexey

Quoted 2 lines
#16 lore raw

Re: [PATCH v5 01/10] capabilities: introduce CAP_PERFMON to kernel and user space

Quoted 68 lines · Alexey Budankov
Quoted 47 lines · Stephen Smalley
Quoted 46 lines · Alexey Budankov

Hi Stephen,

Quoted 12 lines · Stephen Smalley
Quoted 11 lines · Alexey Budankov
Quoted 9 lines · Alexey Budankov
Quoted 7 lines · Alexei Starovoitov
Quoted 5 lines · Alexey Budankov
Quoted 2 lines · Stephen Smalley
Quoted 1 line · Alexey Budankov

<SNIP>

Quoted 15 lines
Quoted 15 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

Introduce CAP_PERFMON capability designed to secure system performance

Why _noaudit()?  Normally only used when a permission failure is non-fatal to the operation.  Otherwise, we want the audit message.

So far so good, I suggest using the simplest version for v6:

static inline bool perfmon_capable(void)
{
     return capable(CAP_PERFMON) || capable(CAP_SYS_ADMIN);
}

It keeps the implementation simple and readable. The implementation is more performant in the sense of calling the API - one capable() call for CAP_PERFMON privileged process.

Quoted 5 lines
Quoted 3 lines

Yes, it bloats audit log for CAP_SYS_ADMIN privileged and unprivileged processes, but this bloating also advertises and leverages using more secure CAP_PERFMON based approach to use perf_event_open system call.

I can live with that.  We just need to document that when you see both a CAP_PERFMON and a CAP_SYS_ADMIN audit message for a process, try only allowing CAP_PERFMON first and see if that resolves the issue.  We have a similar issue with CAP_DAC_READ_SEARCH versus CAP_DAC_OVERRIDE.

I am trying to reproduce this double logging with CAP_PERFMON.
I am using the refpolicy version with enabled perf_event tclass [1], in permissive mode. When running perf stat -a I am observing this AVC audit messages:

type=AVC msg=audit(1581496695.666:8691): avc:  denied  { open } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1 type=AVC msg=audit(1581496695.666:8691): avc:  denied  { kernel } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1 type=AVC msg=audit(1581496695.666:8691): avc:  denied  { cpu } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1 type=AVC msg=audit(1581496695.666:8692): avc:  denied  { write } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1

Quoted 7 lines
Quoted 5 lines

However there is no capability related messages around. I suppose my refpolicy should be modified somehow to observe capability related AVCs.

Could you please comment or clarify on how to enable caps related AVCs in order to test the concerned logging.

The new perfmon permission has to be defined in your policy; you'll have a message in dmesg about "Permission perfmon in class capability2 not defined in policy.".  You can either add it to the common cap2 definition in refpolicy/policy/flask/access_vectors and rebuild your policy or extract your base module as CIL, add it there, and insert the updated module.

Yes, I already have it like this:
common cap2
{
<------>mac_override<--># unused by SELinux
<------>mac_admin
<------>syslog
<------>wake_alarm
<------>block_suspend
<------>audit_read
<------>perfmon
}

Quoted 2 lines

dmesg stopped reporting perfmon as not defined but audit.log still doesn't report CAP_PERFMON denials. BTW, audit even doesn't report CAP_SYS_ADMIN denials, however perfmon_capable() does check for it.

Some denials may be silenced by dontaudit rules; semodule -DB will strip those and semodule -B will restore them. Other possibility is that the process doesn't have CAP_PERFMON in its effective set and therefore never reaches SELinux at all; denied first by the capability module.

#17 lore raw

Re: [PATCH v5 01/10] capabilities: introduce CAP_PERFMON to kernel and user space

Quoted 69 lines · Stephen Smalley
Quoted 68 lines · Alexey Budankov
Quoted 47 lines · Stephen Smalley
Quoted 46 lines · Alexey Budankov

Hi Stephen,

Quoted 12 lines · Stephen Smalley
Quoted 11 lines · Alexey Budankov
Quoted 9 lines · Alexey Budankov
Quoted 7 lines · Alexei Starovoitov
Quoted 5 lines · Alexey Budankov
Quoted 2 lines · Stephen Smalley
Quoted 1 line · Alexey Budankov

<SNIP>

Quoted 15 lines
Quoted 15 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

Introduce CAP_PERFMON capability designed to secure system performance

Why _noaudit()?  Normally only used when a permission failure is non-fatal to the operation.  Otherwise, we want the audit message.

So far so good, I suggest using the simplest version for v6:

static inline bool perfmon_capable(void)
{
      return capable(CAP_PERFMON) || capable(CAP_SYS_ADMIN); }

It keeps the implementation simple and readable. The implementation is more performant in the sense of calling the API - one capable() call for CAP_PERFMON privileged process.

Quoted 5 lines
Quoted 3 lines

Yes, it bloats audit log for CAP_SYS_ADMIN privileged and unprivileged processes, but this bloating also advertises and leverages using more secure CAP_PERFMON based approach to use perf_event_open system call.

I can live with that.  We just need to document that when you see both a CAP_PERFMON and a CAP_SYS_ADMIN audit message for a process, try only allowing CAP_PERFMON first and see if that resolves the issue.  We have a similar issue with CAP_DAC_READ_SEARCH versus CAP_DAC_OVERRIDE.

I am trying to reproduce this double logging with CAP_PERFMON.
I am using the refpolicy version with enabled perf_event tclass [1], in permissive mode. When running perf stat -a I am observing this AVC audit messages:

type=AVC msg=audit(1581496695.666:8691): avc:  denied  { open } for pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1 type=AVC msg=audit(1581496695.666:8691): avc:  denied  { kernel } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1 type=AVC msg=audit(1581496695.666:8691): avc:  denied  { cpu } for pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1 type=AVC msg=audit(1581496695.666:8692): avc:  denied  { write } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1

Quoted 7 lines
Quoted 5 lines

However there is no capability related messages around. I suppose my refpolicy should be modified somehow to observe capability related AVCs.

Could you please comment or clarify on how to enable caps related AVCs in order to test the concerned logging.

The new perfmon permission has to be defined in your policy; you'll have a message in dmesg about "Permission perfmon in class capability2 not defined in policy.".  You can either add it to the common cap2 definition in refpolicy/policy/flask/access_vectors and rebuild your policy or extract your base module as CIL, add it there, and insert the updated module.

Yes, I already have it like this:
common cap2
{
<------>mac_override<--># unused by SELinux
<------>mac_admin
<------>syslog
<------>wake_alarm
<------>block_suspend
<------>audit_read
<------>perfmon
}

Quoted 4 lines
Quoted 2 lines

dmesg stopped reporting perfmon as not defined but audit.log still doesn't report CAP_PERFMON denials. BTW, audit even doesn't report CAP_SYS_ADMIN denials, however perfmon_capable() does check for it.

Some denials may be silenced by dontaudit rules; semodule -DB will strip those and semodule -B will restore them.  Other possibility is that the process doesn't have CAP_PERFMON in its effective set and therefore never reaches SELinux at all; denied first by the capability module.

Also, the fact that your denials are showing up in user_systemd_t suggests that something is off in your policy or userspace/distro; I assume that is a domain type for the systemd --user instance, but your shell and commands shouldn't be running in that domain (user_t would be more appropriate for that).

#18 lore raw

Re: [PATCH v5 01/10] capabilities: introduce CAP_PERFMON to kernel and user space

Quoted 70 lines · Stephen Smalley
Quoted 69 lines · Stephen Smalley
Quoted 68 lines · Alexey Budankov
Quoted 47 lines · Stephen Smalley
Quoted 46 lines · Alexey Budankov

Hi Stephen,

Quoted 12 lines · Stephen Smalley
Quoted 11 lines · Alexey Budankov
Quoted 9 lines · Alexey Budankov
Quoted 7 lines · Alexei Starovoitov
Quoted 5 lines · Alexey Budankov
Quoted 2 lines · Stephen Smalley
Quoted 1 line · Alexey Budankov

<SNIP>

Quoted 15 lines
Quoted 15 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

Introduce CAP_PERFMON capability designed to secure system performance

Why _noaudit()?  Normally only used when a permission failure is non-fatal to the operation.  Otherwise, we want the audit message.

So far so good, I suggest using the simplest version for v6:

static inline bool perfmon_capable(void)
{
      return capable(CAP_PERFMON) || capable(CAP_SYS_ADMIN); }

It keeps the implementation simple and readable. The implementation is more performant in the sense of calling the API - one capable() call for CAP_PERFMON privileged process.

Quoted 5 lines
Quoted 3 lines

Yes, it bloats audit log for CAP_SYS_ADMIN privileged and unprivileged processes, but this bloating also advertises and leverages using more secure CAP_PERFMON based approach to use perf_event_open system call.

I can live with that.  We just need to document that when you see both a CAP_PERFMON and a CAP_SYS_ADMIN audit message for a process, try only allowing CAP_PERFMON first and see if that resolves the issue.  We have a similar issue with CAP_DAC_READ_SEARCH versus CAP_DAC_OVERRIDE.

I am trying to reproduce this double logging with CAP_PERFMON.
I am using the refpolicy version with enabled perf_event tclass [1], in permissive mode. When running perf stat -a I am observing this AVC audit messages:

type=AVC msg=audit(1581496695.666:8691): avc:  denied  { open } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1 type=AVC msg=audit(1581496695.666:8691): avc:  denied  { kernel } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1 type=AVC msg=audit(1581496695.666:8691): avc:  denied  { cpu } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1 type=AVC msg=audit(1581496695.666:8692): avc:  denied  { write } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1

Quoted 7 lines
Quoted 5 lines

However there is no capability related messages around. I suppose my refpolicy should be modified somehow to observe capability related AVCs.

Could you please comment or clarify on how to enable caps related AVCs in order to test the concerned logging.

The new perfmon permission has to be defined in your policy; you'll have a message in dmesg about "Permission perfmon in class capability2 not defined in policy.".  You can either add it to the common cap2 definition in refpolicy/policy/flask/access_vectors and rebuild your policy or extract your base module as CIL, add it there, and insert the updated module.

Yes, I already have it like this:
common cap2
{
<------>mac_override<--># unused by SELinux
<------>mac_admin
<------>syslog
<------>wake_alarm
<------>block_suspend
<------>audit_read
<------>perfmon
}

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

dmesg stopped reporting perfmon as not defined but audit.log still doesn't report CAP_PERFMON denials. BTW, audit even doesn't report CAP_SYS_ADMIN denials, however perfmon_capable() does check for it.

Some denials may be silenced by dontaudit rules; semodule -DB will strip those and semodule -B will restore them.  Other possibility is that the process doesn't have CAP_PERFMON in its effective set and therefore never reaches SELinux at all; denied first by the capability module.

Also, the fact that your denials are showing up in user_systemd_t suggests that something is off in your policy or userspace/distro; I assume that is a domain type for the systemd --user instance, but your shell and commands shouldn't be running in that domain (user_t would be more appropriate for that).

It is user_t for local terminal session:
ps -Z
LABEL PID TTY TIME CMD

user_u:user_r:user_t            11317 pts/9    00:00:00 bash
user_u:user_r:user_t            11796 pts/9    00:00:00 ps

For local terminal root session:
ps -Z
LABEL PID TTY TIME CMD
user_u:user_r:user_su_t 2926 pts/3 00:00:00 bash
user_u:user_r:user_su_t 10995 pts/3 00:00:00 ps

For remote ssh session:
ps -Z
LABEL PID TTY TIME CMD

user_u:user_r:user_t             7540 pts/8    00:00:00 ps
user_u:user_r:user_systemd_t     8875 pts/8    00:00:00 bash

~Alexey

#19 lore raw

Re: [PATCH v5 01/10] capabilities: introduce CAP_PERFMON to kernel and user space

Quoted 92 lines · Alexey Budankov
Quoted 70 lines · Stephen Smalley
Quoted 69 lines · Stephen Smalley
Quoted 68 lines · Alexey Budankov
Quoted 47 lines · Stephen Smalley
Quoted 46 lines · Alexey Budankov

Hi Stephen,

Quoted 12 lines · Stephen Smalley
Quoted 11 lines · Alexey Budankov
Quoted 9 lines · Alexey Budankov
Quoted 7 lines · Alexei Starovoitov
Quoted 5 lines · Alexey Budankov
Quoted 2 lines · Stephen Smalley
Quoted 1 line · Alexey Budankov

<SNIP>

Quoted 15 lines
Quoted 15 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

Introduce CAP_PERFMON capability designed to secure system performance

Why _noaudit()?  Normally only used when a permission failure is non-fatal to the operation.  Otherwise, we want the audit message.

So far so good, I suggest using the simplest version for v6:

static inline bool perfmon_capable(void)
{
      return capable(CAP_PERFMON) || capable(CAP_SYS_ADMIN);
}

It keeps the implementation simple and readable. The implementation is more performant in the sense of calling the API - one capable() call for CAP_PERFMON privileged process.

Quoted 5 lines
Quoted 3 lines

Yes, it bloats audit log for CAP_SYS_ADMIN privileged and unprivileged processes, but this bloating also advertises and leverages using more secure CAP_PERFMON based approach to use perf_event_open system call.

I can live with that.  We just need to document that when you see both a CAP_PERFMON and a CAP_SYS_ADMIN audit message for a process, try only allowing CAP_PERFMON first and see if that resolves the issue.  We have a similar issue with CAP_DAC_READ_SEARCH versus CAP_DAC_OVERRIDE.

I am trying to reproduce this double logging with CAP_PERFMON.
I am using the refpolicy version with enabled perf_event tclass [1], in permissive mode. When running perf stat -a I am observing this AVC audit messages:

type=AVC msg=audit(1581496695.666:8691): avc:  denied  { open } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1 type=AVC msg=audit(1581496695.666:8691): avc:  denied  { kernel } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1 type=AVC msg=audit(1581496695.666:8691): avc:  denied  { cpu } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1 type=AVC msg=audit(1581496695.666:8692): avc:  denied  { write } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1

Quoted 7 lines
Quoted 5 lines

However there is no capability related messages around. I suppose my refpolicy should be modified somehow to observe capability related AVCs.

Could you please comment or clarify on how to enable caps related AVCs in order to test the concerned logging.

The new perfmon permission has to be defined in your policy; you'll have a message in dmesg about "Permission perfmon in class capability2 not defined in policy.".  You can either add it to the common cap2 definition in refpolicy/policy/flask/access_vectors and rebuild your policy or extract your base module as CIL, add it there, and insert the updated module.

Yes, I already have it like this:
common cap2
{
<------>mac_override<--># unused by SELinux
<------>mac_admin
<------>syslog
<------>wake_alarm
<------>block_suspend
<------>audit_read
<------>perfmon
}

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

dmesg stopped reporting perfmon as not defined but audit.log still doesn't report CAP_PERFMON denials. BTW, audit even doesn't report CAP_SYS_ADMIN denials, however perfmon_capable() does check for it.

Some denials may be silenced by dontaudit rules; semodule -DB will strip those and semodule -B will restore them.  Other possibility is that the process doesn't have CAP_PERFMON in its effective set and therefore never reaches SELinux at all; denied first by the capability module.

Also, the fact that your denials are showing up in user_systemd_t suggests that something is off in your policy or userspace/distro; I assume that is a domain type for the systemd --user instance, but your shell and commands shouldn't be running in that domain (user_t would be more appropriate for that).

It is user_t for local terminal session:
ps -Z
LABEL PID TTY TIME CMD

user_u:user_r:user_t            11317 pts/9    00:00:00 bash
user_u:user_r:user_t            11796 pts/9    00:00:00 ps

For local terminal root session:
ps -Z
LABEL PID TTY TIME CMD
user_u:user_r:user_su_t 2926 pts/3 00:00:00 bash
user_u:user_r:user_su_t 10995 pts/3 00:00:00 ps

Quoted 5 lines

For remote ssh session:
ps -Z
LABEL PID TTY TIME CMD

user_u:user_r:user_t             7540 pts/8    00:00:00 ps
user_u:user_r:user_systemd_t     8875 pts/8    00:00:00 bash

That's a bug in either your policy or your userspace/distro integration.
In any event, unless user_systemd_t is allowed all capability2
permissions by your policy, you should see the denials if CAP_PERFMON is set in the effective capability set of the process.

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#20 lore raw

Re: [PATCH v5 01/10] capabilities: introduce CAP_PERFMON to kernel and user space

Quoted 93 lines · Stephen Smalley
Quoted 92 lines · Alexey Budankov
Quoted 70 lines · Stephen Smalley
Quoted 69 lines · Stephen Smalley
Quoted 68 lines · Alexey Budankov
Quoted 47 lines · Stephen Smalley
Quoted 46 lines · Alexey Budankov

Hi Stephen,

Quoted 12 lines · Stephen Smalley
Quoted 11 lines · Alexey Budankov
Quoted 9 lines · Alexey Budankov
Quoted 7 lines · Alexei Starovoitov
Quoted 5 lines · Alexey Budankov
Quoted 2 lines · Stephen Smalley

On 1/20/20 6:23 AM, Alexey Budankov wrote:

<SNIP>

Quoted 15 lines
Quoted 15 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Introduce CAP_PERFMON capability designed to secure system performance

Why _noaudit()?  Normally only used when a permission failure is non-fatal to the operation.  Otherwise, we want the audit message.

So far so good, I suggest using the simplest version for v6:

static inline bool perfmon_capable(void)
{
       return capable(CAP_PERFMON) || capable(CAP_SYS_ADMIN); }

It keeps the implementation simple and readable. The implementation is more performant in the sense of calling the API - one capable() call for CAP_PERFMON privileged process.

Quoted 5 lines
Quoted 3 lines

Yes, it bloats audit log for CAP_SYS_ADMIN privileged and unprivileged processes, but this bloating also advertises and leverages using more secure CAP_PERFMON based approach to use perf_event_open system call.

I can live with that.  We just need to document that when you see both a CAP_PERFMON and a CAP_SYS_ADMIN audit message for a process, try only allowing CAP_PERFMON first and see if that resolves the issue.  We have a similar issue with CAP_DAC_READ_SEARCH versus CAP_DAC_OVERRIDE.

I am trying to reproduce this double logging with CAP_PERFMON.
I am using the refpolicy version with enabled perf_event tclass [1], in permissive mode. When running perf stat -a I am observing this AVC audit messages:

type=AVC msg=audit(1581496695.666:8691): avc:  denied  { open } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1 type=AVC msg=audit(1581496695.666:8691): avc:  denied  { kernel } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1 type=AVC msg=audit(1581496695.666:8691): avc:  denied  { cpu } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1 type=AVC msg=audit(1581496695.666:8692): avc:  denied  { write } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1

Quoted 7 lines
Quoted 5 lines

However there is no capability related messages around. I suppose my refpolicy should be modified somehow to observe capability related AVCs.

Could you please comment or clarify on how to enable caps related AVCs in order to test the concerned logging.

The new perfmon permission has to be defined in your policy; you'll have a message in dmesg about "Permission perfmon in class capability2 not defined in policy.".  You can either add it to the common cap2 definition in refpolicy/policy/flask/access_vectors and rebuild your policy or extract your base module as CIL, add it there, and insert the updated module.

Yes, I already have it like this:
common cap2
{
<------>mac_override<--># unused by SELinux
<------>mac_admin
<------>syslog
<------>wake_alarm
<------>block_suspend
<------>audit_read
<------>perfmon
}

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

dmesg stopped reporting perfmon as not defined but audit.log still doesn't report CAP_PERFMON denials. BTW, audit even doesn't report CAP_SYS_ADMIN denials, however perfmon_capable() does check for it.

Some denials may be silenced by dontaudit rules; semodule -DB will strip those and semodule -B will restore them.  Other possibility is that the process doesn't have CAP_PERFMON in its effective set and therefore never reaches SELinux at all; denied first by the capability module.

Also, the fact that your denials are showing up in user_systemd_t suggests that something is off in your policy or userspace/distro; I assume that is a domain type for the systemd --user instance, but your shell and commands shouldn't be running in that domain (user_t would be more appropriate for that).

It is user_t for local terminal session:
ps -Z
LABEL                             PID TTY          TIME CMD user_u:user_r:user_t            11317 pts/9    00:00:00 bash user_u:user_r:user_t            11796 pts/9    00:00:00 ps

For local terminal root session:
ps -Z
LABEL                             PID TTY          TIME CMD user_u:user_r:user_su_t          2926 pts/3    00:00:00 bash user_u:user_r:user_su_t         10995 pts/3    00:00:00 ps

Quoted 8 lines
Quoted 5 lines

For remote ssh session:
ps -Z
LABEL                             PID TTY          TIME CMD user_u:user_r:user_t             7540 pts/8    00:00:00 ps user_u:user_r:user_systemd_t     8875 pts/8    00:00:00 bash

That's a bug in either your policy or your userspace/distro integration.  In any event, unless user_systemd_t is allowed all capability2 permissions by your policy, you should see the denials if CAP_PERFMON is set in the effective capability set of the process.

That all seems to be true. After instrumentation, rebuilding and rebooting, in CAP_PERFMON case:

$ getcap perf
perf = cap_sys_ptrace,cap_syslog,cap_perfmon+ep
$ perf stat -a
type=AVC msg=audit(1581580399.165:784): avc:  denied  { open } for  pid=8859 comm="perf" scontext=user_u:user_r:user_t tcontext=user_u:user_r:user_t tclass=perf_event permissive=1
type=AVC msg=audit(1581580399.165:785): avc:  denied  { perfmon } for  pid=8859 comm="perf" capability=38  scontext=user_u:user_r:user_t tcontext=user_u:user_r:user_t tclass=capability2 permissive=1
type=AVC msg=audit(1581580399.165:786): avc:  denied  { kernel } for  pid=8859 comm="perf" scontext=user_u:user_r:user_t tcontext=user_u:user_r:user_t tclass=perf_event permissive=1
type=AVC msg=audit(1581580399.165:787): avc:  denied  { cpu } for  pid=8859 comm="perf" scontext=user_u:user_r:user_t tcontext=user_u:user_r:user_t tclass=perf_event permissive=1
type=AVC msg=audit(1581580399.165:788): avc:  denied  { write } for  pid=8859 comm="perf" scontext=user_u:user_r:user_t tcontext=user_u:user_r:user_t tclass=perf_event permissive=1
type=AVC msg=audit(1581580408.078:791): avc:  denied  { read } for  pid=8859 comm="perf" scontext=user_u:user_r:user_t tcontext=user_u:user_r:user_t tclass=perf_event permissive=1

dmesg:

[  137.877713] security_capable(0000000071f7ee6e, 000000009dd7a5fc, CAP_PERFMON, 0) = ?
[  137.877774] cread_has_capability(CAP_PERFMON) = 0
[  137.877775] prior avc_audit(CAP_PERFMON)
[  137.877779] security_capable(0000000071f7ee6e, 000000009dd7a5fc, CAP_PERFMON, 0) = 0
[  137.877784] security_capable(0000000071f7ee6e, 000000009dd7a5fc, CAP_PERFMON, 0) = ?
[  137.877785] cread_has_capability(CAP_PERFMON) = 0
[  137.877786] security_capable(0000000071f7ee6e, 000000009dd7a5fc, CAP_PERFMON, 0) = 0
[  137.877794] security_capable(0000000071f7ee6e, 000000009dd7a5fc, CAP_PERFMON, 0) = ?
[  137.877795] cread_has_capability(CAP_PERFMON) = 0
[  137.877796] security_capable(0000000071f7ee6e, 000000009dd7a5fc, CAP_PERFMON, 0) = 0

...

in CAP_SYS_ADMIN case:

$ getcap perf
perf = cap_sys_ptrace,cap_sys_admin,cap_syslog+ep
$ perf stat -a
type=AVC msg=audit(1581580747.928:835): avc:  denied  { open } for  pid=8927 comm="perf" scontext=user_u:user_r:user_t tcontext=user_u:user_r:user_t tclass=perf_event permissive=1
type=AVC msg=audit(1581580747.928:836): avc:  denied  { cpu } for  pid=8927 comm="perf" scontext=user_u:user_r:user_t tcontext=user_u:user_r:user_t tclass=perf_event permissive=1
type=AVC msg=audit(1581580747.928:837): avc:  denied  { kernel } for  pid=8927 comm="perf" scontext=user_u:user_r:user_t tcontext=user_u:user_r:user_t tclass=perf_event permissive=1
type=AVC msg=audit(1581580747.928:838): avc:  denied  { read } for  pid=8927 comm="perf" scontext=user_u:user_r:user_t tcontext=user_u:user_r:user_t tclass=perf_event permissive=1
type=AVC msg=audit(1581580747.928:839): avc:  denied  { write } for  pid=8927 comm="perf" scontext=user_u:user_r:user_t tcontext=user_u:user_r:user_t tclass=perf_event permissive=1

...

$ perf record -- ls
...
type=AVC msg=audit(1581580747.930:843): avc:  denied  { sys_ptrace } for  pid=8927 comm="perf" capability=19  scontext=user_u:user_r:user_t tcontext=user_u:user_r:user_t tclass=capability permissive=1
...

dmesg:

[  276.714266] security_capable(000000006b09ad8a, 000000009dd7a5fc, CAP_PERFMON, 0) = ?
[  276.714268] security_capable(000000006b09ad8a, 000000009dd7a5fc, CAP_PERFMON, 0) = -1
[  276.714269] security_capable(000000006b09ad8a, 000000009dd7a5fc, CAP_SYS_ADMIN, 0) = ?
[  276.714270] cread_has_capability(CAP_SYS_ADMIN) = 0
[  276.714270] security_capable(000000006b09ad8a, 000000009dd7a5fc, CAP_SYS_ADMIN, 0) = 0
[  276.714287] security_capable(000000006b09ad8a, 000000009dd7a5fc, CAP_PERFMON, 0) = ?
[  276.714287] security_capable(000000006b09ad8a, 000000009dd7a5fc, CAP_PERFMON, 0) = -1
[  276.714288] security_capable(000000006b09ad8a, 000000009dd7a5fc, CAP_SYS_ADMIN, 0) = ?
[  276.714288] cread_has_capability(CAP_SYS_ADMIN) = 0
[  276.714289] security_capable(000000006b09ad8a, 000000009dd7a5fc, CAP_SYS_ADMIN, 0) = 0
[  276.714294] security_capable(000000006b09ad8a, 000000009dd7a5fc, CAP_PERFMON, 0) = ?
[  276.714295] security_capable(000000006b09ad8a, 000000009dd7a5fc, CAP_PERFMON, 0) = -1
[  276.714295] security_capable(000000006b09ad8a, 000000009dd7a5fc, CAP_SYS_ADMIN, 0) = ?
[  276.714296] cread_has_capability(CAP_SYS_ADMIN) = 0
[  276.714296] security_capable(000000006b09ad8a, 000000009dd7a5fc, CAP_SYS_ADMIN, 0) = 0

...

in unprivileged case:

$ getcap perf
perf =
$ perf stat -a; perf record -a

...

dmesg:

[  947.275611] security_capable(00000000d3a75377, 000000009dd7a5fc, CAP_PERFMON, 0) = ?
[  947.275613] security_capable(00000000d3a75377, 000000009dd7a5fc, CAP_PERFMON, 0) = -1
[  947.275614] security_capable(00000000d3a75377, 000000009dd7a5fc, CAP_SYS_ADMIN, 0) = ?
[  947.275615] security_capable(00000000d3a75377, 000000009dd7a5fc, CAP_SYS_ADMIN, 0) = -1
[  947.275636] security_capable(00000000d3a75377, 000000009dd7a5fc, CAP_PERFMON, 0) = ?
[  947.275637] security_capable(00000000d3a75377, 000000009dd7a5fc, CAP_PERFMON, 0) = -1
[  947.275638] security_capable(00000000d3a75377, 000000009dd7a5fc, CAP_SYS_ADMIN, 0) = ?
[  947.275638] security_capable(00000000d3a75377, 000000009dd7a5fc, CAP_SYS_ADMIN, 0) = -1

...

So it looks like CAP_PERFMON and CAP_SYS_ADMIN are not ever logged by AVC simultaneously, in the current LSM and perfmon_capable() implementations.

If perfmon is granted:
perfmon is not logged by capabilities, perfmon is logged by AVC, no check for sys_admin by perfmon_capable().

If perfmon is not granted but sys_admin is granted:
perfmon is not logged by capabilities, AVC logging is not called for perfmon, sys_admin is not logged by capabilities, sys_admin is not logged by AVC, for some intended reason?

No caps are granted:
AVC logging is not called either for perfmon or for sys_admin.

BTW, is there a way to may be drop some AV cache so denials would appear in audit in the next AV access?

Well, I guess you have initially mentioned some case similar to this (note that ids are not the same but pids= are):

type=AVC msg=audit(1581580399.165:784): avc:  denied  { open } for  pid=8859 comm="perf" scontext=user_u:user_r:user_t tcontext=user_u:user_r:user_t tclass=perf_event permissive=1
type=AVC msg=audit(1581580399.165:785): avc:  denied  { perfmon } for  pid=8859 comm="perf" capability=38  scontext=user_u:user_r:user_t tcontext=user_u:user_r:user_t tclass=capability2 permissive=1
type=AVC msg=audit(          .   :   ): avc:  denied  { sys_admin } for  pid=8859 comm="perf" capability=21  scontext=user_u:user_r:user_t tcontext=user_u:user_r:user_t tclass=capability2 permissive=1
type=AVC msg=audit(1581580399.165:786): avc:  denied  { kernel } for  pid=8859 comm="perf" scontext=user_u:user_r:user_t tcontext=user_u:user_r:user_t tclass=perf_event permissive=1
type=AVC msg=audit(1581580399.165:787): avc:  denied  { cpu } for  pid=8859 comm="perf" scontext=user_u:user_r:user_t tcontext=user_u:user_r:user_t tclass=perf_event permissive=1
type=AVC msg=audit(1581580399.165:788): avc:  denied  { write } for  pid=8859 comm="perf" scontext=user_u:user_r:user_t tcontext=user_u:user_r:user_t tclass=perf_event permissive=1
type=AVC msg=audit(1581580408.078:791): avc:  denied  { read } for  pid=8859 comm="perf" scontext=user_u:user_r:user_t tcontext=user_u:user_r:user_t tclass=perf_event permissive=1

So the message could be like this:

"If audit logs for a process using perf_events related syscalls i.e. perf_event_open(), read(), write(),
ioctl(), mmap() contain denials both for CAP_PERFMON and CAP_SYS_ADMIN capabilities then providing the process with CAP_PERFMON capability singly is the secure preferred approach to resolve access denials to performance monitoring and observability operations."

~Alexey

#21 lore raw

Re: [PATCH v5 01/10] capabilities: introduce CAP_PERFMON to kernel and user space

In reply to Stephen Smalley
Quoted 69 lines · Stephen Smalley
Quoted 68 lines · Alexey Budankov
Quoted 47 lines · Stephen Smalley
Quoted 46 lines · Alexey Budankov

Hi Stephen,

Quoted 12 lines · Stephen Smalley
Quoted 11 lines · Alexey Budankov
Quoted 9 lines · Alexey Budankov
Quoted 7 lines · Alexei Starovoitov
Quoted 5 lines · Alexey Budankov
Quoted 2 lines · Stephen Smalley
Quoted 1 line · Alexey Budankov

<SNIP>

Quoted 15 lines
Quoted 15 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

Introduce CAP_PERFMON capability designed to secure system performance

Why _noaudit()?  Normally only used when a permission failure is non-fatal to the operation.  Otherwise, we want the audit message.

So far so good, I suggest using the simplest version for v6:

static inline bool perfmon_capable(void)
{
      return capable(CAP_PERFMON) || capable(CAP_SYS_ADMIN); }

It keeps the implementation simple and readable. The implementation is more performant in the sense of calling the API - one capable() call for CAP_PERFMON privileged process.

Quoted 5 lines
Quoted 3 lines

Yes, it bloats audit log for CAP_SYS_ADMIN privileged and unprivileged processes, but this bloating also advertises and leverages using more secure CAP_PERFMON based approach to use perf_event_open system call.

I can live with that.  We just need to document that when you see both a CAP_PERFMON and a CAP_SYS_ADMIN audit message for a process, try only allowing CAP_PERFMON first and see if that resolves the issue.  We have a similar issue with CAP_DAC_READ_SEARCH versus CAP_DAC_OVERRIDE.

I am trying to reproduce this double logging with CAP_PERFMON.
I am using the refpolicy version with enabled perf_event tclass [1], in permissive mode. When running perf stat -a I am observing this AVC audit messages:

type=AVC msg=audit(1581496695.666:8691): avc:  denied  { open } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1 type=AVC msg=audit(1581496695.666:8691): avc:  denied  { kernel } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1 type=AVC msg=audit(1581496695.666:8691): avc:  denied  { cpu } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1 type=AVC msg=audit(1581496695.666:8692): avc:  denied  { write } for  pid=2779 comm="perf" scontext=user_u:user_r:user_systemd_t tcontext=user_u:user_r:user_systemd_t tclass=perf_event permissive=1

Quoted 7 lines
Quoted 5 lines

However there is no capability related messages around. I suppose my refpolicy should be modified somehow to observe capability related AVCs.

Could you please comment or clarify on how to enable caps related AVCs in order to test the concerned logging.

The new perfmon permission has to be defined in your policy; you'll have a message in dmesg about "Permission perfmon in class capability2 not defined in policy.".  You can either add it to the common cap2 definition in refpolicy/policy/flask/access_vectors and rebuild your policy or extract your base module as CIL, add it there, and insert the updated module.

Yes, I already have it like this:
common cap2
{
<------>mac_override<--># unused by SELinux
<------>mac_admin
<------>syslog
<------>wake_alarm
<------>block_suspend
<------>audit_read
<------>perfmon
}

Quoted 4 lines
Quoted 2 lines

dmesg stopped reporting perfmon as not defined but audit.log still doesn't report CAP_PERFMON denials. BTW, audit even doesn't report CAP_SYS_ADMIN denials, however perfmon_capable() does check for it.

Some denials may be silenced by dontaudit rules; semodule -DB will strip those and semodule -B will restore them.  Other possibility is that the process doesn't have CAP_PERFMON in its effective set and therefore never reaches SELinux at all; denied first by the capability module.

Yes, that all makes sense.
selinux_capable() calls avc_audit() logging but cap_capable() doesn't, so proper order matters. I am doing debug tracing of the kernel code to reveal the exact reasons.

~Alexey

#22 lore raw

PATCH v5 2/10 perf/core: open access to the core for CAP_PERFMON privileged process

In reply to Alexey Budankov

Open access to monitoring of kernel code, system, tracepoints and namespaces data for a CAP_PERFMON privileged process. For backward compatibility reasons access to perf_events subsystem remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure perf_events monitoring is discouraged with respect to CAP_PERFMON capability. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure.

---
 include/linux/perf_event.h | 6 +++---
 kernel/events/core.c       | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
include/linux/perf_event.h +3 -3
index 6d4c22aee384..730469babcc2 100644
@@ -1285,7 +1285,7 @@ static inline int perf_is_paranoid(void)
 
 static inline int perf_allow_kernel(struct perf_event_attr *attr)
 {
-	if (sysctl_perf_event_paranoid > 1 && !capable(CAP_SYS_ADMIN))
+	if (sysctl_perf_event_paranoid > 1 && !perfmon_capable())
 		return -EACCES;
 
 	return security_perf_event_open(attr, PERF_SECURITY_KERNEL);
@@ -1293,7 +1293,7 @@ static inline int perf_allow_kernel(struct perf_event_attr *attr)
 
 static inline int perf_allow_cpu(struct perf_event_attr *attr)
 {
-	if (sysctl_perf_event_paranoid > 0 && !capable(CAP_SYS_ADMIN))
+	if (sysctl_perf_event_paranoid > 0 && !perfmon_capable())
 		return -EACCES;
 
 	return security_perf_event_open(attr, PERF_SECURITY_CPU);
@@ -1301,7 +1301,7 @@ static inline int perf_allow_cpu(struct perf_event_attr *attr)
 
 static inline int perf_allow_tracepoint(struct perf_event_attr *attr)
 {
-	if (sysctl_perf_event_paranoid > -1 && !capable(CAP_SYS_ADMIN))
+	if (sysctl_perf_event_paranoid > -1 && !perfmon_capable())
 		return -EPERM;
 
 	return security_perf_event_open(attr, PERF_SECURITY_TRACEPOINT);
kernel/events/core.c +1 -1
index a1f8bde19b56..b1fcbbe24849 100644
@@ -11186,7 +11186,7 @@ SYSCALL_DEFINE5(perf_event_open,
 	}
 
 	if (attr.namespaces) {
-		if (!capable(CAP_SYS_ADMIN))
+		if (!perfmon_capable())
 			return -EACCES;
 	}
 
Signature · 1 line
2.20.1
#23 lore raw

PATCH v5 3/10 perf/core: open access to anon probes for CAP_PERFMON privileged process

In reply to Alexey Budankov

Open access to anon kprobes, uprobes and eBPF tracing for CAP_PERFMON privileged processes. For backward compatibility reasons access remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure monitoring is discouraged with respect to CAP_PERFMON capability. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operations more secure.

Anon kprobes and uprobes are used by ftrace and eBPF. perf probe uses ftrace to define new kprobe events, and those events are treated as tracepoint events. eBPF defines new probes via perf_event_open syscall and then the probes are used in eBPF tracing.

---
 kernel/events/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/events/core.c +2 -2
index b1fcbbe24849..8a6c0b08451d 100644
@@ -9088,7 +9088,7 @@ static int perf_kprobe_event_init(struct perf_event *event)
 	if (event->attr.type != perf_kprobe.type)
 		return -ENOENT;
 
-	if (!capable(CAP_SYS_ADMIN))
+	if (!perfmon_capable())
 		return -EACCES;
 
 	/*
@@ -9148,7 +9148,7 @@ static int perf_uprobe_event_init(struct perf_event *event)
 	if (event->attr.type != perf_uprobe.type)
 		return -ENOENT;
 
-	if (!capable(CAP_SYS_ADMIN))
+	if (!perfmon_capable())
 		return -EACCES;
 
 	/*
Signature · 1 line
2.20.1
#24 lore raw

PATCH v5 4/10 perf tool: extend Perf tool with CAP_PERFMON capability support

In reply to Alexey Budankov

Extend error messages to mention CAP_PERFMON capability as an option to substitute CAP_SYS_ADMIN capability for secure system performance monitoring and observability operations. Make perf_event_paranoid_check() and __cmd_ftrace() to be aware of CAP_PERFMON capability.

---
 tools/perf/builtin-ftrace.c |  5 +++--
 tools/perf/design.txt       |  3 ++-
 tools/perf/util/cap.h       |  4 ++++
 tools/perf/util/evsel.c     | 10 +++++-----
 tools/perf/util/util.c      |  1 +
 5 files changed, 15 insertions(+), 8 deletions(-)
tools/perf/builtin-ftrace.c +3 -2
index d5adc417a4ca..55eda54240fb 100644
@@ -284,10 +284,11 @@ static int __cmd_ftrace(struct perf_ftrace *ftrace, int argc, const char **argv)
 		.events = POLLIN,
 	};
 
-	if (!perf_cap__capable(CAP_SYS_ADMIN)) {
+	if (!(perf_cap__capable(CAP_PERFMON) ||
+	      perf_cap__capable(CAP_SYS_ADMIN))) {
 		pr_err("ftrace only works for %s!\n",
 #ifdef HAVE_LIBCAP_SUPPORT
-		"users with the SYS_ADMIN capability"
+		"users with the CAP_PERFMON or CAP_SYS_ADMIN capability"
 #else
 		"root"
 #endif
tools/perf/design.txt +2 -1
index 0453ba26cdbd..a42fab308ff6 100644
@@ -258,7 +258,8 @@ gets schedule to. Per task counters can be created by any user, for
 their own tasks.
 
 A 'pid == -1' and 'cpu == x' counter is a per CPU counter that counts
-all events on CPU-x. Per CPU counters need CAP_SYS_ADMIN privilege.
+all events on CPU-x. Per CPU counters need CAP_PERFMON or CAP_SYS_ADMIN
+privilege.
 
 The 'flags' parameter is currently unused and must be zero.
 
tools/perf/util/cap.h +4 -0
index 051dc590ceee..ae52878c0b2e 100644
@@ -29,4 +29,8 @@ static inline bool perf_cap__capable(int cap __maybe_unused)
 #define CAP_SYSLOG	34
 #endif
 
+#ifndef CAP_PERFMON
+#define CAP_PERFMON	38
+#endif
+
 #endif /* __PERF_CAP_H */
tools/perf/util/evsel.c +5 -5
index a69e64236120..a35f17723dd3 100644
@@ -2491,14 +2491,14 @@ int perf_evsel__open_strerror(struct evsel *evsel, struct target *target,
 		 "You may not have permission to collect %sstats.\n\n"
 		 "Consider tweaking /proc/sys/kernel/perf_event_paranoid,\n"
 		 "which controls use of the performance events system by\n"
-		 "unprivileged users (without CAP_SYS_ADMIN).\n\n"
+		 "unprivileged users (without CAP_PERFMON or CAP_SYS_ADMIN).\n\n"
 		 "The current value is %d:\n\n"
 		 "  -1: Allow use of (almost) all events by all users\n"
 		 "      Ignore mlock limit after perf_event_mlock_kb without CAP_IPC_LOCK\n"
-		 ">= 0: Disallow ftrace function tracepoint by users without CAP_SYS_ADMIN\n"
-		 "      Disallow raw tracepoint access by users without CAP_SYS_ADMIN\n"
-		 ">= 1: Disallow CPU event access by users without CAP_SYS_ADMIN\n"
-		 ">= 2: Disallow kernel profiling by users without CAP_SYS_ADMIN\n\n"
+		 ">= 0: Disallow ftrace function tracepoint by users without CAP_PERFMON or CAP_SYS_ADMIN\n"
+		 "      Disallow raw tracepoint access by users without CAP_SYS_PERFMON or CAP_SYS_ADMIN\n"
+		 ">= 1: Disallow CPU event access by users without CAP_PERFMON or CAP_SYS_ADMIN\n"
+		 ">= 2: Disallow kernel profiling by users without CAP_PERFMON or CAP_SYS_ADMIN\n\n"
 		 "To make this setting permanent, edit /etc/sysctl.conf too, e.g.:\n\n"
 		 "	kernel.perf_event_paranoid = -1\n" ,
 				 target->system_wide ? "system-wide " : "",
tools/perf/util/util.c +1 -0
index 969ae560dad9..51cf3071db74 100644
@@ -272,6 +272,7 @@ int perf_event_paranoid(void)
 bool perf_event_paranoid_check(int max_level)
 {
 	return perf_cap__capable(CAP_SYS_ADMIN) ||
+			perf_cap__capable(CAP_PERFMON) ||
 			perf_event_paranoid() <= max_level;
 }
 
Signature · 1 line
2.20.1
#25 lore raw

PATCH v5 5/10 drm/i915/perf: open access for CAP_PERFMON privileged process

In reply to Alexey Budankov

Open access to i915_perf monitoring for CAP_PERFMON privileged processes. For backward compatibility reasons access to i915_perf subsystem remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure i915_perf monitoring is discouraged with respect to CAP_PERFMON capability. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operations more secure.

---
 drivers/gpu/drm/i915/i915_perf.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/i915_perf.c +6 -7
index 2ae14bc14931..d89347861b7d 100644
@@ -3375,10 +3375,10 @@ i915_perf_open_ioctl_locked(struct i915_perf *perf,
 	/* Similar to perf's kernel.perf_paranoid_cpu sysctl option
 	 * we check a dev.i915.perf_stream_paranoid sysctl option
 	 * to determine if it's ok to access system wide OA counters
-	 * without CAP_SYS_ADMIN privileges.
+	 * without CAP_PERFMON or CAP_SYS_ADMIN privileges.
 	 */
 	if (privileged_op &&
-	    i915_perf_stream_paranoid && !capable(CAP_SYS_ADMIN)) {
+	    i915_perf_stream_paranoid && !perfmon_capable()) {
 		DRM_DEBUG("Insufficient privileges to open i915 perf stream\n");
 		ret = -EACCES;
 		goto err_ctx;
@@ -3571,9 +3571,8 @@ static int read_properties_unlocked(struct i915_perf *perf,
 			} else
 				oa_freq_hz = 0;
 
-			if (oa_freq_hz > i915_oa_max_sample_rate &&
-			    !capable(CAP_SYS_ADMIN)) {
-				DRM_DEBUG("OA exponent would exceed the max sampling frequency (sysctl dev.i915.oa_max_sample_rate) %uHz without root privileges\n",
+			if (oa_freq_hz > i915_oa_max_sample_rate && !perfmon_capable()) {
+				DRM_DEBUG("OA exponent would exceed the max sampling frequency (sysctl dev.i915.oa_max_sample_rate) %uHz without CAP_PERFMON or CAP_SYS_ADMIN privileges\n",
 					  i915_oa_max_sample_rate);
 				return -EACCES;
 			}
@@ -3994,7 +3993,7 @@ int i915_perf_add_config_ioctl(struct drm_device *dev, void *data,
 		return -EINVAL;
 	}
 
-	if (i915_perf_stream_paranoid && !capable(CAP_SYS_ADMIN)) {
+	if (i915_perf_stream_paranoid && !perfmon_capable()) {
 		DRM_DEBUG("Insufficient privileges to add i915 OA config\n");
 		return -EACCES;
 	}
@@ -4141,7 +4140,7 @@ int i915_perf_remove_config_ioctl(struct drm_device *dev, void *data,
 		return -ENOTSUPP;
 	}
 
-	if (i915_perf_stream_paranoid && !capable(CAP_SYS_ADMIN)) {
+	if (i915_perf_stream_paranoid && !perfmon_capable()) {
 		DRM_DEBUG("Insufficient privileges to remove i915 OA config\n");
 		return -EACCES;
 	}
Signature · 1 line
2.20.1
#26 lore raw

PATCH v5 6/10 trace/bpf_trace: open access for CAP_PERFMON privileged process

In reply to Alexey Budankov

Open access to bpf_trace monitoring for CAP_PERFMON privileged processes. For backward compatibility reasons access to bpf_trace monitoring remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure bpf_trace monitoring is discouraged with respect to CAP_PERFMON capability. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operations more secure.

---
 kernel/trace/bpf_trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/bpf_trace.c +1 -1
index e5ef4ae9edb5..334f1d71ebb1 100644
@@ -1395,7 +1395,7 @@ int perf_event_query_prog_array(struct perf_event *event, void __user *info)
 	u32 *ids, prog_cnt, ids_len;
 	int ret;
 
-	if (!capable(CAP_SYS_ADMIN))
+	if (!perfmon_capable())
 		return -EPERM;
 	if (event->attr.type != PERF_TYPE_TRACEPOINT)
 		return -EINVAL;
Signature · 1 line
2.20.1
#27 lore raw

PATCH v5 7/10 powerpc/perf: open access for CAP_PERFMON privileged process

In reply to Alexey Budankov

Open access to monitoring for CAP_PERFMON privileged processes. For backward compatibility reasons access to the monitoring remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure monitoring is discouraged with respect to CAP_PERFMON capability. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes the operations more secure.

---
 arch/powerpc/perf/imc-pmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/perf/imc-pmu.c +2 -2
index cb50a9e1fd2d..e837717492e4 100644
@@ -898,7 +898,7 @@ static int thread_imc_event_init(struct perf_event *event)
 	if (event->attr.type != event->pmu->type)
 		return -ENOENT;
 
-	if (!capable(CAP_SYS_ADMIN))
+	if (!perfmon_capable())
 		return -EACCES;
 
 	/* Sampling not supported */
@@ -1307,7 +1307,7 @@ static int trace_imc_event_init(struct perf_event *event)
 	if (event->attr.type != event->pmu->type)
 		return -ENOENT;
 
-	if (!capable(CAP_SYS_ADMIN))
+	if (!perfmon_capable())
 		return -EACCES;
 
 	/* Return if this is a couting event */
Signature · 1 line
2.20.1
Acked-by on v5 7/10
#28 lore raw

Re: [PATCH v5 07/10] powerpc/perf: open access for CAP_PERFMON privileged process

Quoted 10 lines · Alexey Budankov

Open access to monitoring for CAP_PERFMON privileged processes. For backward compatibility reasons access to the monitoring remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure monitoring is discouraged with respect to CAP_PERFMON capability. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes the operations more secure.

---

#29 lore raw

PATCH v5 8/10 parisc/perf: open access for CAP_PERFMON privileged process

In reply to Alexey Budankov

Open access to monitoring for CAP_PERFMON privileged processes. For backward compatibility reasons access to the monitoring remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure monitoring is discouraged with respect to CAP_PERFMON capability. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes the operations more secure.

---
 arch/parisc/kernel/perf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/parisc/kernel/perf.c +1 -1
index 676683641d00..c4208d027794 100644
@@ -300,7 +300,7 @@ static ssize_t perf_write(struct file *file, const char __user *buf,
 	else
 		return -EFAULT;
 
-	if (!capable(CAP_SYS_ADMIN))
+	if (!perfmon_capable())
 		return -EACCES;
 
 	if (count != sizeof(uint32_t))
Signature · 1 line
2.20.1
#30 lore raw

PATCH v5 9/10 drivers/perf: open access for CAP_PERFMON privileged process

In reply to Alexey Budankov

Open access to monitoring for CAP_PERFMON privileged processes. For backward compatibility reasons access to the monitoring remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure monitoring is discouraged with respect to CAP_PERFMON capability. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes the operations more secure.

---
 drivers/perf/arm_spe_pmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/perf/arm_spe_pmu.c +2 -2
index 4e4984a55cd1..5dff81bc3324 100644
@@ -274,7 +274,7 @@ static u64 arm_spe_event_to_pmscr(struct perf_event *event)
 	if (!attr->exclude_kernel)
 		reg |= BIT(SYS_PMSCR_EL1_E1SPE_SHIFT);
 
-	if (IS_ENABLED(CONFIG_PID_IN_CONTEXTIDR) && capable(CAP_SYS_ADMIN))
+	if (IS_ENABLED(CONFIG_PID_IN_CONTEXTIDR) && perfmon_capable())
 		reg |= BIT(SYS_PMSCR_EL1_CX_SHIFT);
 
 	return reg;
@@ -700,7 +700,7 @@ static int arm_spe_pmu_event_init(struct perf_event *event)
 		return -EOPNOTSUPP;
 
 	reg = arm_spe_event_to_pmscr(event);
-	if (!capable(CAP_SYS_ADMIN) &&
+	if (!perfmon_capable() &&
 	    (reg & (BIT(SYS_PMSCR_EL1_PA_SHIFT) |
 		    BIT(SYS_PMSCR_EL1_CX_SHIFT) |
 		    BIT(SYS_PMSCR_EL1_PCT_SHIFT))))
Signature · 1 line
2.20.1
#31 lore raw

PATCH v5 10/10 drivers/oprofile: open access for CAP_PERFMON privileged process

In reply to Alexey Budankov

Open access to monitoring for CAP_PERFMON privileged processes. For backward compatibility reasons access to the monitoring remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure monitoring is discouraged with respect to CAP_PERFMON capability. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes the operations more secure.

---
 drivers/oprofile/event_buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/oprofile/event_buffer.c +1 -1
index 12ea4a4ad607..6c9edc8bbc95 100644
@@ -113,7 +113,7 @@ static int event_buffer_open(struct inode *inode, struct file *file)
 {
 	int err = -EPERM;
 
-	if (!capable(CAP_SYS_ADMIN))
+	if (!perfmon_capable())
 		return -EPERM;
 
 	if (test_and_set_bit_lock(0, &buffer_opened))
Signature · 1 line
2.20.1
#32 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Introduce CAP_PERFMON to secure system performance monitoring and observability

In reply to Alexey Budankov
== Series Details ==

== Series Details ==

Series: Introduce CAP_PERFMON to secure system performance monitoring and observability
URL : https://patchwork.freedesktop.org/series/72273/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
08ee25620fef capabilities: introduce CAP_PERFMON to kernel and user space
-:33: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#33: 
[2] https://www.kernel.org/doc/html/latest/process/embargoed-hardware-issues.html

total: 0 errors, 1 warnings, 0 checks, 44 lines checked
b04501d7d623 perf/core: open access to the core for CAP_PERFMON privileged process
-:7: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #7:
Open access to monitoring of kernel code, system, tracepoints and namespaces

total: 0 errors, 1 warnings, 0 checks, 32 lines checked
c74fee681ffe perf/core: open access to anon probes for CAP_PERFMON privileged process eca88405d138 perf tool: extend Perf tool with CAP_PERFMON capability support 0df0e7d3bc27 drm/i915/perf: open access for CAP_PERFMON privileged process dc5f0cb73803 trace/bpf_trace: open access for CAP_PERFMON privileged process d3168511835d powerpc/perf: open access for CAP_PERFMON privileged process 035c1d9fc22b parisc/perf: open access for CAP_PERFMON privileged process 0515549093ae drivers/perf: open access for CAP_PERFMON privileged process c7304fe7a410 drivers/oprofile: open access for CAP_PERFMON privileged process

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#33 lore raw

[Intel-gfx] ✓ Fi.CI.BAT: success for Introduce CAP_PERFMON to secure system performance monitoring and observability

In reply to Alexey Budankov
== Series Details ==

== Series Details ==

Series: Introduce CAP_PERFMON to secure system performance monitoring and observability
URL : https://patchwork.freedesktop.org/series/72273/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_7781 -> Patchwork_16173
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/index.html

Known issues
------------

Here are the changes found in Patchwork_16173 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@i915_selftest@live_blt:
- fi-ivb-3770: [PASS][1] -> [DMESG-FAIL][2] ([i915#725])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/fi-ivb-3770/igt@i915_selftest@live_blt.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/fi-ivb-3770/igt@i915_selftest@live_blt.html

* igt@kms_addfb_basic@too-high:
- fi-icl-dsi: [PASS][3] -> [DMESG-WARN][4] ([i915#109])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/fi-icl-dsi/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/fi-icl-dsi/igt@[email protected]

#### Possible fixes ####

* igt@i915_selftest@live_blt:
- fi-hsw-4770r: [DMESG-FAIL][5] ([i915#553] / [i915#725]) -> [PASS][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/fi-hsw-4770r/igt@i915_selftest@live_blt.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/fi-hsw-4770r/igt@i915_selftest@live_blt.html
- fi-hsw-4770: [DMESG-FAIL][7] ([i915#725]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/fi-hsw-4770/igt@i915_selftest@live_blt.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/fi-hsw-4770/igt@i915_selftest@live_blt.html

* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: [FAIL][9] ([fdo#111407]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/fi-kbl-7500u/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/fi-kbl-7500u/igt@[email protected]

#### Warnings ####

* igt@gem_exec_parallel@contexts:
- fi-byt-n2820: [TIMEOUT][11] ([fdo#112271]) -> [INCOMPLETE][12] ([i915#45])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/fi-byt-n2820/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/fi-byt-n2820/igt@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#111407]: https://bugs.freedesktop.org/show_bug.cgi?id=111407
[fdo#112271]: https://bugs.freedesktop.org/show_bug.cgi?id=112271
[i915#109]: https://gitlab.freedesktop.org/drm/intel/issues/109
[i915#45]: https://gitlab.freedesktop.org/drm/intel/issues/45
[i915#553]: https://gitlab.freedesktop.org/drm/intel/issues/553
[i915#725]: https://gitlab.freedesktop.org/drm/intel/issues/725
[i915#937]: https://gitlab.freedesktop.org/drm/intel/issues/937

Participating hosts (50 -> 44)
------------------------------

Additional (1): fi-kbl-7560u
Missing (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-bwr-2160 fi-ctg-p8600 fi-byt-clapper

Build changes
-------------

* CI: CI-20190529 -> None
* Linux: CI_DRM_7781 -> Patchwork_16173

CI-20190529: 20190529
CI_DRM_7781: 3f2b341ae1fde67f823aeb715c6f489affdef8b1 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5374: 83c32e859202e43ff6a8cca162c76fcd90ad6e3b @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_16173: c7304fe7a4108ae62e23c1b6786a813e0cfb66db @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

c7304fe7a410 drivers/oprofile: open access for CAP_PERFMON privileged process 0515549093ae drivers/perf: open access for CAP_PERFMON privileged process 035c1d9fc22b parisc/perf: open access for CAP_PERFMON privileged process d3168511835d powerpc/perf: open access for CAP_PERFMON privileged process dc5f0cb73803 trace/bpf_trace: open access for CAP_PERFMON privileged process 0df0e7d3bc27 drm/i915/perf: open access for CAP_PERFMON privileged process eca88405d138 perf tool: extend Perf tool with CAP_PERFMON capability support c74fee681ffe perf/core: open access to anon probes for CAP_PERFMON privileged process b04501d7d623 perf/core: open access to the core for CAP_PERFMON privileged process 08ee25620fef capabilities: introduce CAP_PERFMON to kernel and user space

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#34 lore raw

[Intel-gfx] ✓ Fi.CI.IGT: success for Introduce CAP_PERFMON to secure system performance monitoring and observability

In reply to Alexey Budankov
== Series Details ==

== Series Details ==

Series: Introduce CAP_PERFMON to secure system performance monitoring and observability
URL : https://patchwork.freedesktop.org/series/72273/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_7781_full -> Patchwork_16173_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

Known issues
------------

Here are the changes found in Patchwork_16173_full that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_ctx_isolation@vcs1-dirty-create:
- shard-iclb: [PASS][1] -> [SKIP][2] ([fdo#109276] / [fdo#112080])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-iclb4/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-iclb7/igt@[email protected]

* igt@gem_ctx_persistence@vecs0-mixed-process:
- shard-apl: [PASS][3] -> [FAIL][4] ([i915#679])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-apl4/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-apl3/igt@[email protected]

* igt@gem_ctx_shared@q-smoketest-all:
- shard-tglb: [PASS][5] -> [INCOMPLETE][6] ([fdo#111735] / [i915#472])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-tglb8/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-tglb4/igt@[email protected]

* igt@gem_ctx_shared@q-smoketest-bsd2:
- shard-tglb: [PASS][7] -> [INCOMPLETE][8] ([i915#461] / [i915#472])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-tglb7/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-tglb6/igt@[email protected]

* igt@gem_exec_create@forked:
- shard-tglb: [PASS][9] -> [INCOMPLETE][10] ([fdo#108838] / [i915#472])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-tglb2/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-tglb7/igt@[email protected]

* igt@gem_exec_schedule@preempt-other-bsd:
- shard-iclb: [PASS][11] -> [SKIP][12] ([fdo#112146])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-iclb3/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-iclb1/igt@[email protected]

* igt@gem_exec_schedule@smoketest-all:
- shard-tglb: [PASS][13] -> [INCOMPLETE][14] ([i915#463] / [i915#472])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-tglb4/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-tglb3/igt@[email protected]

* igt@gem_persistent_relocs@forked-interruptible-faulting-reloc-thrash-inactive:
- shard-tglb: [PASS][15] -> [TIMEOUT][16] ([fdo#112126] / [fdo#112271] / [i915#530])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-tglb3/igt@gem_persistent_relocs@forked-interruptible-faulting-reloc-thrash-inactive.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-tglb5/igt@gem_persistent_relocs@forked-interruptible-faulting-reloc-thrash-inactive.html
- shard-skl: [PASS][17] -> [TIMEOUT][18] ([fdo#112271] / [i915#530])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-skl8/igt@gem_persistent_relocs@forked-interruptible-faulting-reloc-thrash-inactive.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-skl4/igt@gem_persistent_relocs@forked-interruptible-faulting-reloc-thrash-inactive.html

* igt@gem_persistent_relocs@forked-interruptible-faulting-reloc-thrashing:
- shard-apl: [PASS][19] -> [TIMEOUT][20] ([fdo#112271] / [i915#530])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-apl6/igt@gem_persistent_relocs@forked-interruptible-faulting-reloc-thrashing.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-apl8/igt@gem_persistent_relocs@forked-interruptible-faulting-reloc-thrashing.html

* igt@gem_persistent_relocs@forked-interruptible-thrash-inactive:
- shard-kbl: [PASS][21] -> [TIMEOUT][22] ([fdo#112271] / [i915#530])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-kbl6/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-kbl4/igt@[email protected]

* igt@gem_ppgtt@flink-and-close-vma-leak:
- shard-kbl: [PASS][23] -> [FAIL][24] ([i915#644])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-kbl2/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-kbl1/igt@[email protected]

* igt@gem_sync@basic-all:
- shard-tglb: [PASS][25] -> [INCOMPLETE][26] ([i915#470] / [i915#472])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-tglb1/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-tglb6/igt@[email protected]

* igt@gem_sync@basic-store-all:
- shard-tglb: [PASS][27] -> [INCOMPLETE][28] ([i915#472]) +5 similar issues
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-tglb1/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-tglb3/igt@[email protected]

* igt@gem_tiled_blits@normal:
- shard-hsw: [PASS][29] -> [FAIL][30] ([i915#818])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-hsw4/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-hsw7/igt@[email protected]

* igt@i915_hangman@error-state-capture-vcs1:
- shard-iclb: [PASS][31] -> [SKIP][32] ([fdo#112080]) +2 similar issues
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-iclb4/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-iclb7/igt@[email protected]

* igt@i915_pm_backlight@fade_with_suspend:
- shard-skl: [PASS][33] -> [INCOMPLETE][34] ([i915#69])
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-skl5/igt@i915_pm_backlight@fade_with_suspend.html
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-skl8/igt@i915_pm_backlight@fade_with_suspend.html

* igt@i915_selftest@mock_requests:
- shard-snb: [PASS][35] -> [INCOMPLETE][36] ([i915#82])
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-snb6/igt@i915_selftest@mock_requests.html
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-snb2/igt@i915_selftest@mock_requests.html
- shard-skl: [PASS][37] -> [INCOMPLETE][38] ([i915#198])
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-skl4/igt@i915_selftest@mock_requests.html
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-skl2/igt@i915_selftest@mock_requests.html
- shard-apl: [PASS][39] -> [INCOMPLETE][40] ([fdo#103927])
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-apl7/igt@i915_selftest@mock_requests.html
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-apl2/igt@i915_selftest@mock_requests.html

* igt@kms_cursor_crc@pipe-c-cursor-suspend:
- shard-kbl: [PASS][41] -> [DMESG-WARN][42] ([i915#180]) +4 similar issues
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-kbl3/igt@[email protected]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-kbl6/igt@[email protected]
- shard-apl: [PASS][43] -> [DMESG-WARN][44] ([i915#180]) +3 similar issues
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-apl4/igt@[email protected]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-apl1/igt@[email protected]

* igt@kms_flip@basic-flip-vs-wf_vblank:
- shard-apl: [PASS][45] -> [FAIL][46] ([i915#34])
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-apl1/igt@kms_flip@basic-flip-vs-wf_vblank.html
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-apl1/igt@kms_flip@basic-flip-vs-wf_vblank.html

* igt@kms_flip@flip-vs-expired-vblank-interruptible:
- shard-skl: [PASS][47] -> [FAIL][48] ([i915#79])
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-skl2/igt@[email protected]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-skl9/igt@[email protected]

* igt@kms_flip@modeset-vs-vblank-race:
- shard-glk: [PASS][49] -> [FAIL][50] ([i915#407])
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-glk8/igt@[email protected]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-glk5/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-pwrite:
- shard-tglb: [PASS][51] -> [FAIL][52] ([i915#49]) +1 similar issue
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-tglb3/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-pwrite.html
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-tglb4/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-pwrite.html

* igt@kms_plane_alpha_blend@pipe-a-coverage-7efc:
- shard-skl: [PASS][53] -> [FAIL][54] ([fdo#108145])
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-skl2/igt@[email protected]
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-skl10/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
- shard-skl: [PASS][55] -> [FAIL][56] ([fdo#108145] / [i915#265])
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-skl10/igt@[email protected]
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-skl3/igt@[email protected]

* igt@kms_psr@psr2_sprite_blt:
- shard-iclb: [PASS][57] -> [SKIP][58] ([fdo#109441])
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-iclb2/igt@kms_psr@psr2_sprite_blt.html
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-iclb1/igt@kms_psr@psr2_sprite_blt.html

* igt@prime_busy@after-bsd2:
- shard-iclb: [PASS][59] -> [SKIP][60] ([fdo#109276]) +1 similar issue
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-iclb1/igt@[email protected]
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-iclb3/igt@[email protected]

* igt@prime_mmap_coherency@ioctl-errors:
- shard-hsw: [PASS][61] -> [FAIL][62] ([i915#831])
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-hsw4/igt@[email protected]
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-hsw7/igt@[email protected]

#### Possible fixes ####

* igt@gem_ctx_isolation@rcs0-s3:
- shard-kbl: [DMESG-WARN][63] ([i915#180]) -> [PASS][64] +4 similar issues
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-kbl1/igt@[email protected]
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-kbl6/igt@[email protected]
- shard-apl: [DMESG-WARN][65] ([i915#180]) -> [PASS][66] +2 similar issues
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-apl6/igt@[email protected]
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-apl1/igt@[email protected]

* igt@gem_ctx_persistence@rcs0-mixed-process:
- shard-skl: [FAIL][67] ([i915#679]) -> [PASS][68]
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-skl10/igt@[email protected]
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-skl6/igt@[email protected]

* igt@gem_ctx_persistence@vcs1-mixed-process:
- shard-iclb: [SKIP][69] ([fdo#109276] / [fdo#112080]) -> [PASS][70] +1 similar issue
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-iclb3/igt@[email protected]
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-iclb1/igt@[email protected]

* igt@gem_ctx_shared@q-promotion-bsd2:
- shard-iclb: [SKIP][71] ([fdo#109276]) -> [PASS][72] +5 similar issues
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-iclb3/igt@[email protected]
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-iclb1/igt@[email protected]

* igt@gem_exec_balancer@hang:
- shard-iclb: [INCOMPLETE][73] ([i915#140]) -> [PASS][74] +1 similar issue
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-iclb1/igt@[email protected]
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-iclb3/igt@[email protected]

* igt@gem_exec_balancer@smoke:
- shard-tglb: [INCOMPLETE][75] ([fdo#111593] / [i915#472]) -> [PASS][76]
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-tglb4/igt@[email protected]
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-tglb7/igt@[email protected]

* igt@gem_exec_nop@basic-series:
- shard-tglb: [INCOMPLETE][77] ([i915#472]) -> [PASS][78] +1 similar issue
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-tglb6/igt@[email protected]
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-tglb4/igt@[email protected]

* igt@gem_exec_parallel@fds:
- shard-tglb: [INCOMPLETE][79] ([i915#470] / [i915#472]) -> [PASS][80]
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-tglb6/igt@[email protected]
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-tglb1/igt@[email protected]

* igt@gem_exec_schedule@preemptive-hang-bsd:
- shard-iclb: [SKIP][81] ([fdo#112146]) -> [PASS][82]
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-iclb4/igt@[email protected]
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-iclb7/igt@[email protected]

* igt@gem_persistent_relocs@forked-interruptible-faulting-reloc-thrash-inactive:
- shard-kbl: [TIMEOUT][83] ([fdo#112271] / [i915#530]) -> [PASS][84] +1 similar issue
[83]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-kbl3/igt@gem_persistent_relocs@forked-interruptible-faulting-reloc-thrash-inactive.html
[84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-kbl2/igt@gem_persistent_relocs@forked-interruptible-faulting-reloc-thrash-inactive.html

* igt@gen7_exec_parse@basic-allocation:
- shard-hsw: [FAIL][85] ([i915#694]) -> [PASS][86]
[85]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-hsw6/igt@[email protected]
[86]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-hsw7/igt@[email protected]

* igt@i915_selftest@mock_requests:
- shard-hsw: [INCOMPLETE][87] ([i915#61]) -> [PASS][88]
[87]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-hsw1/igt@i915_selftest@mock_requests.html
[88]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-hsw4/igt@i915_selftest@mock_requests.html

* igt@kms_cursor_crc@pipe-b-cursor-128x42-sliding:
- shard-skl: [FAIL][89] ([i915#54]) -> [PASS][90]
[89]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-skl6/igt@[email protected]
[90]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-skl2/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-shrfb-draw-pwrite:
- shard-tglb: [FAIL][91] ([i915#49]) -> [PASS][92] +1 similar issue
[91]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-tglb1/igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-shrfb-draw-pwrite.html
[92]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-tglb5/igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-shrfb-draw-pwrite.html

* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
- shard-skl: [INCOMPLETE][93] ([i915#69]) -> [PASS][94]
[93]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-skl1/igt@[email protected]
[94]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-skl5/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min:
- shard-skl: [FAIL][95] ([fdo#108145]) -> [PASS][96]
[95]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-skl7/igt@[email protected]
[96]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-skl9/igt@[email protected]

* igt@kms_psr2_su@page_flip:
- shard-iclb: [SKIP][97] ([fdo#109642] / [fdo#111068]) -> [PASS][98]
[97]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-iclb1/igt@kms_psr2_su@page_flip.html
[98]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-iclb2/igt@kms_psr2_su@page_flip.html

* igt@kms_setmode@basic:
- shard-apl: [FAIL][99] ([i915#31]) -> [PASS][100]
[99]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-apl2/igt@[email protected]
[100]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-apl2/igt@[email protected]

* igt@perf_pmu@busy-accuracy-98-vcs1:
- shard-iclb: [SKIP][101] ([fdo#112080]) -> [PASS][102] +3 similar issues
[101]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-iclb8/igt@[email protected]
[102]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-iclb1/igt@[email protected]

#### Warnings ####

* igt@gem_eio@kms:
- shard-snb: [INCOMPLETE][103] ([i915#82]) -> [DMESG-WARN][104] ([i915#443] / [i915#444])
[103]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-snb2/igt@[email protected]
[104]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-snb4/igt@[email protected]

* igt@gem_persistent_relocs@forked-interruptible-thrashing:
- shard-apl: [INCOMPLETE][105] ([CI#80] / [fdo#103927] / [i915#530]) -> [TIMEOUT][106] ([fdo#112271] / [i915#530])
[105]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-apl8/igt@[email protected]
[106]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-apl4/igt@[email protected]

* igt@i915_pm_dc@dc6-dpms:
- shard-tglb: [FAIL][107] ([i915#454]) -> [SKIP][108] ([i915#468])
[107]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-tglb4/igt@[email protected]
[108]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-tglb1/igt@[email protected]

* igt@i915_pm_dc@dc6-psr:
- shard-tglb: [SKIP][109] ([i915#468]) -> [FAIL][110] ([i915#454])
[109]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-tglb1/igt@[email protected]
[110]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-tglb5/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbc-1p-pri-indfb-multidraw:
- shard-tglb: [FAIL][111] ([i915#49]) -> [INCOMPLETE][112] ([i915#472] / [i915#474])
[111]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-tglb5/igt@[email protected]
[112]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-tglb2/igt@[email protected]

* igt@runner@aborted:
- shard-apl: ([FAIL][113], [FAIL][114]) ([i915#997]) -> ([FAIL][115], [FAIL][116], [FAIL][117]) ([i915#873] / [i915#997])
[113]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-apl7/igt@[email protected]
[114]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-apl3/igt@[email protected]
[115]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-apl4/igt@[email protected]
[116]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-apl6/igt@[email protected]
[117]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-apl2/igt@[email protected]
- shard-skl: ([FAIL][118], [FAIL][119]) ([i915#69] / [i915#997]) -> ([FAIL][120], [FAIL][121], [FAIL][122]) ([i915#69] / [i915#873] / [i915#997])
[118]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-skl8/igt@[email protected]
[119]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7781/shard-skl3/igt@[email protected]
[120]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-skl2/igt@[email protected]
[121]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-skl8/igt@[email protected]
[122]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/shard-skl4/igt@[email protected]

[CI#80]: https://gitlab.freedesktop.org/gfx-ci/i915-infra/issues/80
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108838]: https://bugs.freedesktop.org/show_bug.cgi?id=108838
[fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
[fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
[fdo#111593]: https://bugs.freedesktop.org/show_bug.cgi?id=111593
[fdo#111735]: https://bugs.freedesktop.org/show_bug.cgi?id=111735
[fdo#112080]: https://bugs.freedesktop.org/show_bug.cgi?id=112080
[fdo#112126]: https://bugs.freedesktop.org/show_bug.cgi?id=112126
[fdo#112146]: https://bugs.freedesktop.org/show_bug.cgi?id=112146
[fdo#112271]: https://bugs.freedesktop.org/show_bug.cgi?id=112271
[i915#140]: https://gitlab.freedesktop.org/drm/intel/issues/140
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#198]: https://gitlab.freedesktop.org/drm/intel/issues/198
[i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
[i915#31]: https://gitlab.freedesktop.org/drm/intel/issues/31
[i915#34]: https://gitlab.freedesktop.org/drm/intel/issues/34
[i915#407]: https://gitlab.freedesktop.org/drm/intel/issues/407
[i915#443]: https://gitlab.freedesktop.org/drm/intel/issues/443
[i915#444]: https://gitlab.freedesktop.org/drm/intel/issues/444
[i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
[i915#461]: https://gitlab.freedesktop.org/drm/intel/issues/461
[i915#463]: https://gitlab.freedesktop.org/drm/intel/issues/463
[i915#468]: https://gitlab.freedesktop.org/drm/intel/issues/468
[i915#470]: https://gitlab.freedesktop.org/drm/intel/issues/470
[i915#472]: https://gitlab.freedesktop.org/drm/intel/issues/472
[i915#474]: https://gitlab.freedesktop.org/drm/intel/issues/474
[i915#49]: https://gitlab.freedesktop.org/drm/intel/issues/49
[i915#530]: https://gitlab.freedesktop.org/drm/intel/issues/530
[i915#54]: https://gitlab.freedesktop.org/drm/intel/issues/54
[i915#61]: https://gitlab.freedesktop.org/drm/intel/issues/61
[i915#644]: https://gitlab.freedesktop.org/drm/intel/issues/644
[i915#679]: https://gitlab.freedesktop.org/drm/intel/issues/679
[i915#69]: https://gitlab.freedesktop.org/drm/intel/issues/69
[i915#694]: https://gitlab.freedesktop.org/drm/intel/issues/694
[i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
[i915#818]: https://gitlab.freedesktop.org/drm/intel/issues/818
[i915#82]: https://gitlab.freedesktop.org/drm/intel/issues/82
[i915#831]: https://gitlab.freedesktop.org/drm/intel/issues/831
[i915#873]: https://gitlab.freedesktop.org/drm/intel/issues/873
[i915#997]: https://gitlab.freedesktop.org/drm/intel/issues/997

Participating hosts (10 -> 10)
------------------------------

No changes in participating hosts

Build changes
-------------

* CI: CI-20190529 -> None
* Linux: CI_DRM_7781 -> Patchwork_16173

CI-20190529: 20190529
CI_DRM_7781: 3f2b341ae1fde67f823aeb715c6f489affdef8b1 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5374: 83c32e859202e43ff6a8cca162c76fcd90ad6e3b @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_16173: c7304fe7a4108ae62e23c1b6786a813e0cfb66db @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16173/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx