aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorWilliam Breathitt Gray <[email protected]>2022-10-20 14:11:21 +0000
committerWilliam Breathitt Gray <[email protected]>2022-10-24 00:39:26 +0000
commitd501d37841d3b7f18402d71a9ef057eb9dde127e (patch)
tree7614710f955f636f75c0b75e021de8af08f1fac9 /tools/perf/scripts/python
parentcounter: microchip-tcb-capture: Handle Signal1 read and Synapse (diff)
downloadkernel-d501d37841d3b7f18402d71a9ef057eb9dde127e.tar.gz
kernel-d501d37841d3b7f18402d71a9ef057eb9dde127e.zip
counter: 104-quad-8: Fix race getting function mode and direction
The quad8_action_read() function checks the Count function mode and Count direction without first acquiring a lock. This is a race condition because the function mode could change by the time the direction is checked. Because the quad8_function_read() already acquires a lock internally, the quad8_function_read() is refactored to spin out the no-lock code to a new quad8_function_get() function. To resolve the race condition in quad8_action_read(), a lock is acquired before calling quad8_function_get() and quad8_direction_read() in order to get both function mode and direction atomically. Fixes: f1d8a071d45b ("counter: 104-quad-8: Add Generic Counter interface support") Cc: [email protected] Link: https://lore.kernel.org/r/[email protected]/ Signed-off-by: William Breathitt Gray <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions