ANDROID: fuse-bpf: Ensure bpf field can never be nulled
By putting and nulling fuse_inode's bpf field in fuse_evict_inode, we left a race condition - this inode can still be active. Do not put the bpf program until we are doing the final free in fuse_free_inode. This was the root cause of the reported bug. The backing inode cannot be put in fuse_free_inode, since put_inode can sleep and this is called from an RCU handler. But the backing inode cannot be freed until an RCU interval, so move the put_inode to the same location as in overlayfs, which is destroy_inode. Remove a path in fuse_handle_bpf_prog whereby bpf can be nulled out. When we want to be able to null/change the bpf_prog in the future, we will have to use a mutex or maybe RCU to protect existing users. But until this time, ban this path. Bug: 284450048 Bug: 300008893 Bug: 307663509 Test: fuse_test passes, Pixel 6 passes basic tests Change-Id: Ie6844242f279a5b202eb021eac5a2dd3d08bf09d Signed-off-by:Paul Lawrence <paullawrence@google.com> (cherry picked from commit b5f38513) (cherry picked from commit 5e616347)
Loading
Please sign in to comment