]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
smb: client: ensure open_cached_dir_by_dentry() only returns valid cfid
authorSteve French <stfrench@microsoft.com>
Thu, 2 Oct 2025 02:49:59 +0000 (21:49 -0500)
committerSteve French <stfrench@microsoft.com>
Thu, 2 Oct 2025 02:49:59 +0000 (21:49 -0500)
commita365f2c049b3846640234bc25e4f8c46abea6c98
tree5864c90d8caa6d1cefc1b98b87bf930cb7f502f7
parent63eb8bd6c81d84a23fdc18fffd604e3ea38bb96c
smb: client: ensure open_cached_dir_by_dentry() only returns valid cfid

open_cached_dir_by_dentry() was exposing an invalid cached directory to
callers. The validity check outside the function was exclusively based
on cfid->time.

Add validity check before returning success and introduce
is_valid_cached_dir() helper for consistent checks across the code.

Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
Reviwed-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cached_dir.c
fs/smb/client/cached_dir.h
fs/smb/client/dir.c
fs/smb/client/inode.c