]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
perf: Fix perf_event_validate_size()
authorPeter Zijlstra <peterz@infradead.org>
Wed, 29 Nov 2023 14:24:52 +0000 (15:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Dec 2023 17:39:24 +0000 (18:39 +0100)
commit06dec254c59afd01b7a44838cf8bfc382bef019b
treee9c69eb6da3e4a38b63665b07d796252cd2d0dd8
parentb0c195a825d45855adc036cf4cdbc0981cf4efdc
perf: Fix perf_event_validate_size()

[ Upstream commit 382c27f4ed28f803b1f1473ac2d8db0afc795a1b ]

Budimir noted that perf_event_validate_size() only checks the size of
the newly added event, even though the sizes of all existing events
can also change due to not all events having the same read_format.

When we attach the new event, perf_group_attach(), we do re-compute
the size for all events.

Fixes: a723968c0ed3 ("perf: Fix u16 overflows")
Reported-by: Budimir Markovic <markovicbudimir@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/events/core.c