Re: [PATCH 1/2] perf: Add closing sibling events' file descriptors

From: peterz
Date: Thu Aug 06 2020 - 04:35:54 EST


On Wed, Jul 08, 2020 at 06:16:34PM +0300, Alexander Shishkin wrote:
> Currently, perf requires one file descriptor per event. In large groups,
> this may mean running into the limit on open file descriptors. However,
> the sibling events in a group only need file descriptors for the initial
> configuration stage, after which they may not be needed any more.
>
> This adds an opt-in flag to the perf_event_open() syscall to retain
> sibling events after their file descriptors are closed. In this case, the
> actual events will be closed with the group leader.

So having the 1:1 relation with filedesc imposes a resource limit on
userspace.

This patch breaks that and enables a user to basically DoS the system by
creating unbound events.