perf symbols: Use CAP_SYSLOG with kptr_restrict checks
authorIgor Lubashev <ilubashe@akamai.com>
Tue, 27 Aug 2019 01:39:15 +0000 (21:39 -0400)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 28 Aug 2019 20:19:19 +0000 (17:19 -0300)
commit8859aedefefe7eeea5e67968b7fe39c828d589a0
treee7af29f67f95ff7b9c7dbb71c8007d271beca0b4
parentaa97293ff129f504e7c8589e56007ecfe3e3e835
perf symbols: Use CAP_SYSLOG with kptr_restrict checks

The kernel is using CAP_SYSLOG capability instead of uid==0 and euid==0
when checking kptr_restrict. Make perf do the same.

Also, the kernel is a more restrictive than "no restrictions" in case of
kptr_restrict==0, so add the same logic to perf.

Signed-off-by: Igor Lubashev <ilubashe@akamai.com>
Tested-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: James Morris <jmorris@namei.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1566869956-7154-5-git-send-email-ilubashe@akamai.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/symbol.c