diff options
author | Alexey Budankov <alexey.budankov@linux.intel.com> | 2020-04-30 09:15:57 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2020-05-28 15:03:26 +0200 |
commit | c1034eb069201f3f3c40f34f3d937ecb8049d0cf (patch) | |
tree | f6decf7003381dd2b438863259b54c1171379500 /tools/perf/util/cloexec.c | |
parent | perf docs: Extend CAP_SYS_ADMIN with CAP_PERFMON where needed (diff) | |
download | linux-c1034eb069201f3f3c40f34f3d937ecb8049d0cf.tar.xz linux-c1034eb069201f3f3c40f34f3d937ecb8049d0cf.zip |
perf tool: Make perf tool aware of SELinux access control
Implement selinux sysfs check to see the system is in enforcing mode and
print warning message with pointer to check audit logs.
Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-security-module@vger.kernel.org
Cc: selinux@vger.kernel.org
Link: http://lore.kernel.org/lkml/819338ce-d160-4a2f-f1aa-d756a2e7c6fc@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/cloexec.c')
-rw-r--r-- | tools/perf/util/cloexec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/cloexec.c b/tools/perf/util/cloexec.c index 6b3988a7aba8..fa8248aadb59 100644 --- a/tools/perf/util/cloexec.c +++ b/tools/perf/util/cloexec.c @@ -65,7 +65,7 @@ static int perf_flag_probe(void) return 1; } - WARN_ONCE(err != EINVAL && err != EBUSY, + WARN_ONCE(err != EINVAL && err != EBUSY && err != EACCES, "perf_event_open(..., PERF_FLAG_FD_CLOEXEC) failed with unexpected error %d (%s)\n", err, str_error_r(err, sbuf, sizeof(sbuf))); @@ -83,7 +83,7 @@ static int perf_flag_probe(void) if (fd >= 0) close(fd); - if (WARN_ONCE(fd < 0 && err != EBUSY, + if (WARN_ONCE(fd < 0 && err != EBUSY && err != EACCES, "perf_event_open(..., 0) failed unexpectedly with error %d (%s)\n", err, str_error_r(err, sbuf, sizeof(sbuf)))) return -1; |