summaryrefslogtreecommitdiff
path: root/fs/smb/server
diff options
context:
space:
mode:
authorMarios Makassikis <mmakassikis@freebox.fr>2024-03-13 15:11:38 +0100
committerSteve French <stfrench@microsoft.com>2024-03-14 18:51:32 -0500
commit5fb282ba4fef8985a5acf2b32681f2ec07732561 (patch)
tree2bbb5f83c75d238835c727f81fd9d50dd1566d83 /fs/smb/server
parentc8efcc786146a951091588e5fa7e3c754850cb3c (diff)
ksmbd: fix possible null-deref in smb_lazy_parent_lease_break_close
rcu_dereference can return NULL, so make sure we check against that. Signed-off-by: Marios Makassikis <mmakassikis@freebox.fr> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb/server')
-rw-r--r--fs/smb/server/oplock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/smb/server/oplock.c b/fs/smb/server/oplock.c
index 9af5fd68bd85..b30ff8b9777d 100644
--- a/fs/smb/server/oplock.c
+++ b/fs/smb/server/oplock.c
@@ -1143,7 +1143,7 @@ void smb_lazy_parent_lease_break_close(struct ksmbd_file *fp)
opinfo = rcu_dereference(fp->f_opinfo);
rcu_read_unlock();
- if (!opinfo->is_lease || opinfo->o_lease->version != 2)
+ if (!opinfo || !opinfo->is_lease || opinfo->o_lease->version != 2)
return;
p_ci = ksmbd_inode_lookup_lock(fp->filp->f_path.dentry->d_parent);