perf: Fix perf_event_validate_size()
stable inclusion from stable-v4.19.302 commit f5d6ab016792c9d6d5280fdb7f8962eb3b8c620e category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I8PT55 CVE: CVE-2023-6931 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f5d6ab016792c9d6d5280fdb7f8962eb3b8c620e --------------------------- [ 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: a723968c ("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> Signed-off-by:
Yang Jihong <yangjihong1@huawei.com>
Loading
Please sign in to comment