Patch "ksmbd: fix possible null-deref in smb_lazy_parent_lease_break_close" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ksmbd: fix possible null-deref in smb_lazy_parent_lease_break_close

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ksmbd-fix-possible-null-deref-in-smb_lazy_parent_lea.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 07b448a447d2838c0014e19f1957f7f7c98ccc1a
Author: Marios Makassikis <mmakassikis@xxxxxxxxxx>
Date:   Wed Mar 13 15:11:38 2024 +0100

    ksmbd: fix possible null-deref in smb_lazy_parent_lease_break_close
    
    [ Upstream commit 5fb282ba4fef8985a5acf2b32681f2ec07732561 ]
    
    rcu_dereference can return NULL, so make sure we check against that.
    
    Signed-off-by: Marios Makassikis <mmakassikis@xxxxxxxxxx>
    Acked-by: Namjae Jeon <linkinjeon@xxxxxxxxxx>
    Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/smb/server/oplock.c b/fs/smb/server/oplock.c
index 7bdae2adad228..58bafe23ded9a 100644
--- a/fs/smb/server/oplock.c
+++ b/fs/smb/server/oplock.c
@@ -1152,7 +1152,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);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux