fix: check get_path_nullok return value in fuse_lib_flush (issue #1188)#2
Open
ShukantPal wants to merge 2 commits intomasterfrom
Open
fix: check get_path_nullok return value in fuse_lib_flush (issue #1188)#2ShukantPal wants to merge 2 commits intomasterfrom
ShukantPal wants to merge 2 commits intomasterfrom
Conversation
…use#1188) fuse_lib_flush called get_path_nullok() but ignored the return value, passing a potentially NULL path to fuse_flush_common(). When a directory is concurrently removed or renamed, get_path_nullok() can fail and return NULL, causing a crash in the flush callback. Now check the return value and only proceed when the path lookup succeeds, matching the pattern used by fuse_lib_read, fuse_lib_write_buf, and fuse_lock_common.
|
|
…e#1188) Add test_flush_null_path to test/test_examples.py that exercises the open-unlink-close code path which triggers FUSE_FLUSH on a file whose path may not be resolvable. The test mounts passthrough_fh, creates files, unlinks them while fds are still open, then closes the fds (triggering flush). Both sequential and concurrent iterations are performed to stress the multi-threaded flush path. This regression test covers the fix in fuse_lib_flush() that checks the return value of get_path_nullok() before calling fuse_flush_common().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fuse_lib_flush called get_path_nullok() but ignored the return value,
passing a potentially NULL path to fuse_flush_common(). When a directory
is concurrently removed or renamed, get_path_nullok() can fail and
return NULL, causing a crash in the flush callback.
Now check the return value and only proceed when the path lookup
succeeds, matching the pattern used by fuse_lib_read, fuse_lib_write_buf,
and fuse_lock_common.