Skip to content

Commit 27b40b7

Browse files
Marios Makassikisgregkh
authored andcommitted
ksmbd: fix possible null-deref in smb_lazy_parent_lease_break_close
[ Upstream commit 5fb282b ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 8b23269 commit 27b40b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/smb/server/oplock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,7 @@ void smb_lazy_parent_lease_break_close(struct ksmbd_file *fp)
11521152
opinfo = rcu_dereference(fp->f_opinfo);
11531153
rcu_read_unlock();
11541154

1155-
if (!opinfo->is_lease || opinfo->o_lease->version != 2)
1155+
if (!opinfo || !opinfo->is_lease || opinfo->o_lease->version != 2)
11561156
return;
11571157

11581158
p_ci = ksmbd_inode_lookup_lock(fp->filp->f_path.dentry->d_parent);

0 commit comments

Comments
 (0)