aboutsummaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/interrupts.py
diff options
context:
space:
mode:
authorIan Rogers <[email protected]>2023-06-09 15:40:04 -0700
committerArnaldo Carvalho de Melo <[email protected]>2023-06-13 23:40:32 -0300
commit97d5f2e9ee12cdc7214d5835d35c59404cfafee6 (patch)
tree7379a1e33488012d200401032a6858ad3a3f0fc6 /scripts/gdb/linux/interrupts.py
parent8dc26b6f718a81188519b77033eea764c9b6f732 (diff)
tools api fs: More thread safety for global filesystem variables
Multiple threads, such as with "perf top", may race to initialize a file system path like hugetlbfs. The racy initialization of the path leads to at least memory leaks. To avoid this initialize each fs for reading the mount point path with pthread_once. Mounting the file system may also be racy, so introduce a mutex over the function. This does mean that the path is being accessed with and without a mutex, which is inherently racy but hopefully benign, especially as there are fewer callers to fs__mount. Remove the fs__entries by directly using global variables, this was done as no argument like the index can be passed to the init once routine. Issue found and tested with "perf top" and address sanitizer. Signed-off-by: Ian Rogers <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/interrupts.py')
0 files changed, 0 insertions, 0 deletions