Patch "ksmbd: fix uninitialized pointer read in smb2_create_link()" has been added to the 6.3-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 uninitialized pointer read in smb2_create_link()

to the 6.3-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-uninitialized-pointer-read-in-smb2_create_link.patch
and it can be found in the queue-6.3 subdirectory.

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


>From df14afeed2e6c1bbadef7d2f9c46887bbd6d8d94 Mon Sep 17 00:00:00 2001
From: Namjae Jeon <linkinjeon@xxxxxxxxxx>
Date: Sun, 14 May 2023 10:02:27 +0900
Subject: ksmbd: fix uninitialized pointer read in smb2_create_link()

From: Namjae Jeon <linkinjeon@xxxxxxxxxx>

commit df14afeed2e6c1bbadef7d2f9c46887bbd6d8d94 upstream.

There is a case that file_present is true and path is uninitialized.
This patch change file_present is set to false by default and set to
true when patch is initialized.

Fixes: 74d7970febf7 ("ksmbd: fix racy issue from using ->d_parent and ->d_name")
Reported-by: Coverity Scan <scan-admin@xxxxxxxxxxxx>
Signed-off-by: Namjae Jeon <linkinjeon@xxxxxxxxxx>
Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 fs/ksmbd/smb2pdu.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/fs/ksmbd/smb2pdu.c
+++ b/fs/ksmbd/smb2pdu.c
@@ -5560,7 +5560,7 @@ static int smb2_create_link(struct ksmbd
 {
 	char *link_name = NULL, *target_name = NULL, *pathname = NULL;
 	struct path path;
-	bool file_present = true;
+	bool file_present = false;
 	int rc;
 
 	if (buf_len < (u64)sizeof(struct smb2_file_link_info) +
@@ -5593,8 +5593,8 @@ static int smb2_create_link(struct ksmbd
 	if (rc) {
 		if (rc != -ENOENT)
 			goto out;
-		file_present = false;
-	}
+	} else
+		file_present = true;
 
 	if (file_info->ReplaceIfExists) {
 		if (file_present) {


Patches currently in stable-queue which might be from linkinjeon@xxxxxxxxxx are

queue-6.3/ksmbd-validate-session-id-and-tree-id-in-the-compound-request.patch
queue-6.3/ksmbd-add-mnt_want_write-to-ksmbd-vfs-functions.patch
queue-6.3/ksmbd-remove-internal.h-include.patch
queue-6.3/ksmbd-validate-command-payload-size.patch
queue-6.3/fs-introduce-lock_rename_child-helper.patch
queue-6.3/ksmbd-call-putname-after-using-the-last-component.patch
queue-6.3/ksmbd-fix-out-of-bound-read-in-smb2_write.patch
queue-6.3/ksmbd-fix-uninitialized-pointer-read-in-ksmbd_vfs_rename.patch
queue-6.3/ksmbd-fix-uninitialized-pointer-read-in-smb2_create_link.patch
queue-6.3/ksmbd-fix-racy-issue-from-using-d_parent-and-d_name.patch



[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