summaryrefslogtreecommitdiff
path: root/scripts/basic
diff options
context:
space:
mode:
authorThomas Richter <tmricht@linux.ibm.com>2024-10-30 12:37:18 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-12-05 14:01:12 +0100
commit4b3bdfa89635db6a53e02955548bd07bebcae233 (patch)
tree560fb318f99903b85229074e6b3cae815fa1daaa /scripts/basic
parent2a375beb4c3824bb984e65860ad7ec0197be91f7 (diff)
downloadlinux-4b3bdfa89635db6a53e02955548bd07bebcae233.tar.gz
linux-4b3bdfa89635db6a53e02955548bd07bebcae233.tar.bz2
linux-4b3bdfa89635db6a53e02955548bd07bebcae233.zip
s390/cpum_sf: Fix and protect memory allocation of SDBs with mutex
[ Upstream commit f55bd479d8663a4a4e403b3d308d3d1aa33d92df ] Reservation of the PMU hardware is done at first event creation and is protected by a pair of mutex_lock() and mutex_unlock(). After reservation of the PMU hardware the memory required for the PMUs the event is to be installed on is allocated by allocate_buffers() and alloc_sampling_buffer(). This done outside of the mutex protection. Without mutex protection two or more concurrent invocations of perf_event_init() may run in parallel. This can lead to allocation of Sample Data Blocks (SDBs) multiple times for the same PMU. Prevent this and protect memory allocation of SDBs by mutex. Fixes: 8a6fe8f21ec4 ("s390/cpum_sf: Use refcount_t instead of atomic_t") Signed-off-by: Thomas Richter <tmricht@linux.ibm.com> Reviewed-by: Sumanth Korikkar <sumanthk@linux.ibm.com> Reviewed-by: Hendrik Brueckner <brueckner@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'scripts/basic')
0 files changed, 0 insertions, 0 deletions