aboutsummaryrefslogtreecommitdiff
path: root/scripts/clang-tools/gen_compile_commands.py
diff options
context:
space:
mode:
authorSishuai Gong <[email protected]>2023-08-17 20:00:31 -0400
committerSteven Rostedt (Google) <[email protected]>2023-08-22 05:23:53 -0400
commit086629773ec96216d06c72c801602cc56ebece27 (patch)
tree1265fa48fc3498d5af895092d6d944dac77e8407 /scripts/clang-tools/gen_compile_commands.py
parenta943188dabf78585fc5ddae0803b8b2c94f1c824 (diff)
tracefs: Avoid changing i_mode to a temp value
Right now inode->i_mode is updated twice to reach the desired value in tracefs_apply_options(). Because there is no lock protecting the two writes, other threads might read the intermediate value of inode->i_mode. Thread-1 Thread-2 // tracefs_apply_options() //e.g., acl_permission_check inode->i_mode &= ~S_IALLUGO; unsigned int mode = inode->i_mode; inode->i_mode |= opts->mode; I think there is no need to introduce a lock but it is better to only update inode->i_mode ONCE, so the readers will either see the old or latest value, rather than an intermediate/temporary value. Note, the race is not a security concern as the intermediate value is more locked down than either the start or end version. This is more just to do the conversion cleanly. Link: https://lore.kernel.org/linux-trace-kernel/[email protected] Signed-off-by: Sishuai Gong <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
Diffstat (limited to 'scripts/clang-tools/gen_compile_commands.py')
0 files changed, 0 insertions, 0 deletions