OP-TEE / optee_os

Trusted side of the TEE
Other
1.51k stars 1.03k forks source link

core: REE_FS: fix dirfile handle refcount #6898

Closed jenswi-linaro closed 1 week ago

jenswi-linaro commented 1 week ago

The counter ree_fs_dirh_refcount is used to determine when ree_fs_dirh should be free, not as a guarantee that ree_fs_dirh is still valid. This wasn't the assumption in ree_fs_readdir_rpc(), ree_fs_closedir_rpc(), and ree_fs_opendir_rpc(). So fix that by using get_dirh() in ree_fs_readdir_rpc as needed.

Fixes: ace6039fd434 ("core: REE_FS: refcount dirfile handle")

jenswi-linaro commented 1 week ago

Added a comment for ree_fs_dirh and ree_fs_dirh_refcount.

jenswi-linaro commented 1 week ago

Adding @ZheTing815's Reported-by.

jforissier commented 1 week ago

Maybe use ree_fs: (lowercase) as a prefix since it's how subsystems etc. are usually written.

jenswi-linaro commented 1 week ago

Comment addressed and tag applied.