All of lore.kernel.org
 help / color / mirror / Atom feed
* perf segfault in docker container
@ 2016-06-09 21:14 Brendan Gregg
  2016-06-10 10:28 ` Aravinda Prasad
  2016-06-10 20:15 ` Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 6+ messages in thread
From: Brendan Gregg @ 2016-06-09 21:14 UTC (permalink / raw)
  To: linux-perf-use.; +Cc: Wang Nan

G'Day,

Default docker container, in Linux 4.7-rc2, with latest perf from perf/core:

docker# ./perf record -F 99 -a
Segmentation fault

The segfault is in perf_event__synthesize_kernel_mmap(). I know
symbol__read_kptr_restrict() has been updated recently to fix similar
segfaults, hence getting perf/core.

I think the problem is this:

docker# id
uid=0(root) gid=0(root) groups=0(root)
docker# cat /proc/sys/kernel/kptr_restrict
1

(I'd previously set "echo -1 > /proc/sys/kernel/perf_event_paranoid")

The current (May 24) code has, symbol__read_kptr_restrict():

                if (fgets(line, sizeof(line), fp) != NULL)
                        value = (geteuid() != 0) ?
                                        (atoi(line) != 0) :
                                        (atoi(line) == 2);

assumes that if euid is 0 && kptr_restrict isn't 2, then we're aren't
restricted. But we are. Maybe the code should check for CAP_SYS_ADMIN,
instead of euid == 0?

Brendan

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

end of thread, other threads:[~2016-06-22 21:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-09 21:14 perf segfault in docker container Brendan Gregg
2016-06-10 10:28 ` Aravinda Prasad
2016-06-21 22:32   ` Brendan Gregg
2016-06-21 22:43     ` Brendan Gregg
2016-06-22 21:35     ` Aravinda Prasad
2016-06-10 20:15 ` Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.