lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-39f4a913d6d439178177cae8aa2e9a232160fd51@git.kernel.org>
Date:   Fri, 15 Feb 2019 01:32:21 -0800
From:   tip-bot for Song Liu <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org, songliubraving@...com, hpa@...or.com,
        jolsa@...nel.org, davidca@...com, acme@...hat.com,
        tglx@...utronix.de, mingo@...nel.org
Subject: [tip:perf/core] perf utils: Silence "Couldn't synthesize bpf
 events" warning for EPERM

Commit-ID:  39f4a913d6d439178177cae8aa2e9a232160fd51
Gitweb:     https://git.kernel.org/tip/39f4a913d6d439178177cae8aa2e9a232160fd51
Author:     Song Liu <songliubraving@...com>
AuthorDate: Mon, 4 Feb 2019 11:31:40 -0800
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Thu, 14 Feb 2019 13:31:11 -0300

perf utils: Silence "Couldn't synthesize bpf events" warning for EPERM

Synthesizing BPF events is only supported for root. Silent warning msg
when non-root user runs perf-record.

Reported-by: David Carrillo-Cisneros <davidca@...com>
Signed-off-by: Song Liu <songliubraving@...com>
Tested-by: David Carrillo-Cisneros <davidca@...com>
Acked-by: Jiri Olsa <jolsa@...nel.org>
Cc: kernel-team@...com
Link: http://lkml.kernel.org/r/20190204193140.719740-1-songliubraving@fb.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/util/bpf-event.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/bpf-event.c b/tools/perf/util/bpf-event.c
index 796ef793f4ce..62dda96b0096 100644
--- a/tools/perf/util/bpf-event.c
+++ b/tools/perf/util/bpf-event.c
@@ -236,8 +236,8 @@ int perf_event__synthesize_bpf_events(struct perf_tool *tool,
 			pr_debug("%s: can't get next program: %s%s",
 				 __func__, strerror(errno),
 				 errno == EINVAL ? " -- kernel too old?" : "");
-			/* don't report error on old kernel */
-			err = (errno == EINVAL) ? 0 : -1;
+			/* don't report error on old kernel or EPERM  */
+			err = (errno == EINVAL || errno == EPERM) ? 0 : -1;
 			break;
 		}
 		fd = bpf_prog_get_fd_by_id(id);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ