From: Volker Lendecke <Volker.Lendecke@sernet.de>
To: linux-cifs@vger.kernel.org
Subject: Fix posix 311 symlink creation mode
Date: Wed, 11 Jan 2023 12:42:52 +0100 [thread overview]
Message-ID: <Y76gvH9ADxSgAxSw@sernet.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 133 bytes --]
Hi!
Attached find a patch that fixes an uninitialized memory read when
creating symlinks using the smb311 posix extensions.
Volker
[-- Attachment #2: posix-symlink.diff --]
[-- Type: text/x-diff, Size: 971 bytes --]
From 482fa85ef97505626b6b146155834e6bc36012fa Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl@samba.org>
Date: Wed, 11 Jan 2023 12:37:58 +0100
Subject: [PATCH] cifs: Fix uninitialized memory read for smb311 posix symlink
create
If smb311 posix is enabled, we send the intended mode for file
creation in the posix create context. Instead of using what's there on
the stack, create the mfsymlink file with 0644.
Signed-off-by: Volker Lendecke <vl@samba.org>
---
fs/cifs/link.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index bd374feeccaa..a5a097a69983 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -428,6 +428,7 @@ smb3_create_mf_symlink(unsigned int xid, struct cifs_tcon *tcon,
oparms.disposition = FILE_CREATE;
oparms.fid = &fid;
oparms.reconnect = false;
+ oparms.mode = 0644;
rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, NULL,
NULL, NULL);
--
2.30.2
next reply other threads:[~2023-01-11 12:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-11 11:42 Volker Lendecke [this message]
2023-01-11 13:57 ` Fix posix 311 symlink creation mode Paulo Alcantara
2023-01-11 16:21 ` Steve French
2023-01-11 16:51 ` Volker Lendecke
2023-01-11 17:04 ` Tom Talpey
2023-01-11 20:18 ` Steve French
2023-01-12 13:25 ` David Disseldorp
2023-01-12 15:59 ` Steve French
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y76gvH9ADxSgAxSw@sernet.de \
--to=volker.lendecke@sernet.de \
--cc=linux-cifs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox