[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <875z9q1u3g.fsf@ashishki-desk.ger.corp.intel.com>
Date: Mon, 10 Aug 2020 16:57:55 +0300
From: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
To: Andi Kleen <ak@...ux.intel.com>, peterz@...radead.org
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>,
Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
Jiri Olsa <jolsa@...nel.org>, alexey.budankov@...ux.intel.com,
adrian.hunter@...el.com, alexander.shishkin@...ux.intel.com
Subject: Re: [PATCH 1/2] perf: Add closing sibling events' file descriptors
Andi Kleen <ak@...ux.intel.com> writes:
>> > 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.
>
> The idea was to account the events in the locked memory allocation too.
> Not sure that made it into the patch though.
It didn't. I can't figure out what to charge on the locked memory, as
all that memory is in kernel-side objects. It also needs to make sense
as iirc the default MLOCK_LIMIT is quite low, you'd hit it sooner than
the file descriptor limit.
> It has a minor issue that it might break some existing setups that rely
> on the mmap fitting exactly into the mmap allocation, but that could
> be solved by allowing a little slack, since the existing setups
> likely don't have that many events.
I don't see how to make this work in a sane way. Besides, if we have to
have a limit anyway, sticking with the existing one is just easier and
1:1 is kind of more logical.
Regards,
--
Alex
Powered by blists - more mailing lists