diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-07 02:18:07 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-07 02:18:07 +0000 |
commit | 6c080a1a353c6fc2590555ec7dd8982d1143d02d (patch) | |
tree | 5fb60c5cd3d6bb6496650d1605a3c51d09be2bf1 /fs/smb/server | |
parent | Adding debian version 6.1.85-1. (diff) | |
download | linux-6c080a1a353c6fc2590555ec7dd8982d1143d02d.tar.xz linux-6c080a1a353c6fc2590555ec7dd8982d1143d02d.zip |
Merging upstream version 6.1.90.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'fs/smb/server')
-rw-r--r-- | fs/smb/server/server.c | 13 | ||||
-rw-r--r-- | fs/smb/server/smb2pdu.c | 4 | ||||
-rw-r--r-- | fs/smb/server/vfs.c | 5 |
3 files changed, 14 insertions, 8 deletions
diff --git a/fs/smb/server/server.c b/fs/smb/server/server.c index 11b201e6e..63b01f7d9 100644 --- a/fs/smb/server/server.c +++ b/fs/smb/server/server.c @@ -167,20 +167,17 @@ static void __handle_ksmbd_work(struct ksmbd_work *work, int rc; bool is_chained = false; - if (conn->ops->allocate_rsp_buf(work)) - return; - if (conn->ops->is_transform_hdr && conn->ops->is_transform_hdr(work->request_buf)) { rc = conn->ops->decrypt_req(work); - if (rc < 0) { - conn->ops->set_rsp_status(work, STATUS_DATA_ERROR); - goto send; - } - + if (rc < 0) + return; work->encrypted = true; } + if (conn->ops->allocate_rsp_buf(work)) + return; + rc = conn->ops->init_rsp_hdr(work); if (rc) { /* either uid or tid is not correct */ diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index c02b1772c..34d884254 100644 --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -534,6 +534,10 @@ int smb2_allocate_rsp_buf(struct ksmbd_work *work) if (cmd == SMB2_QUERY_INFO_HE) { struct smb2_query_info_req *req; + if (get_rfc1002_len(work->request_buf) < + offsetof(struct smb2_query_info_req, OutputBufferLength)) + return -EINVAL; + req = smb2_get_msg(work->request_buf); if ((req->InfoType == SMB2_O_INFO_FILE && (req->FileInfoClass == FILE_FULL_EA_INFORMATION || diff --git a/fs/smb/server/vfs.c b/fs/smb/server/vfs.c index fe2c80ea2..a4c99ec38 100644 --- a/fs/smb/server/vfs.c +++ b/fs/smb/server/vfs.c @@ -746,10 +746,15 @@ retry: goto out4; } + /* + * explicitly handle file overwrite case, for compatibility with + * filesystems that may not support rename flags (e.g: fuse) + */ if ((flags & RENAME_NOREPLACE) && d_is_positive(new_dentry)) { err = -EEXIST; goto out4; } + flags &= ~(RENAME_NOREPLACE); if (old_child == trap) { err = -EINVAL; |