Skip to content

Commit 8697375

Browse files
committed
Merge tag 'v6.19-rc-smb-fixes' of git://git.samba.org/ksmbd
Pull smb client and server updates from Steve French: - server fixes: - IPC use after free locking fix - fix locking bug in delete paths - fix use after free in disconnect - fix underflow in locking check - error mapping improvement - socket listening improvement - return code mapping fixes - crypto improvements (use default libraries) - cleanup patches: - netfs - client checkpatch cleanup - server cleanup - move server/client duplicate code to common code - fix some defines to better match protocol specification - smbdirect (RDMA) fixes - client debugging improvements for leases * tag 'v6.19-rc-smb-fixes' of git://git.samba.org/ksmbd: (44 commits) cifs: Use netfs_alloc/free_folioq_buffer() smb: client: show smb lease key in open_dirs output smb: client: show smb lease key in open_files output ksmbd: ipc: fix use-after-free in ipc_msg_send_request smb: client: relax WARN_ON_ONCE(SMBDIRECT_SOCKET_*) checks in recv_done() and smbd_conn_upcall() smb: server: relax WARN_ON_ONCE(SMBDIRECT_SOCKET_*) checks in recv_done() and smb_direct_cm_handler() smb: smbdirect: introduce SMBDIRECT_CHECK_STATUS_{WARN,DISCONNECT}() smb: smbdirect: introduce SMBDIRECT_DEBUG_ERR_PTR() helper ksmbd: vfs: fix race on m_flags in vfs_cache ksmbd: Replace strcpy + strcat to improve convert_to_nt_pathname smb: move FILE_SYSTEM_ATTRIBUTE_INFO to common/fscc.h ksmbd: implement error handling for STATUS_INFO_LENGTH_MISMATCH in smb server ksmbd: fix use-after-free in ksmbd_tree_connect_put under concurrency ksmbd: server: avoid busy polling in accept loop smb: move create_durable_reconn to common/smb2pdu.h smb: fix some warnings reported by scripts/checkpatch.pl smb: do some cleanups smb: move FILE_SYSTEM_SIZE_INFO to common/fscc.h smb: move some duplicate struct definitions to common/fscc.h smb: move list of FileSystemAttributes to common/fscc.h ...
2 parents 3ed1c68 + e1469f5 commit 8697375

44 files changed

Lines changed: 1194 additions & 1743 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

fs/smb/client/cifs_debug.c

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@ static int cifs_debug_files_proc_show(struct seq_file *m, void *v)
249249
seq_puts(m, "# Format:\n");
250250
seq_puts(m, "# <tree id> <ses id> <persistent fid> <flags> <count> <pid> <uid>");
251251
#ifdef CONFIG_CIFS_DEBUG2
252-
seq_puts(m, " <filename> <lease> <mid>\n");
252+
seq_puts(m, " <filename> <lease> <lease-key> <mid>\n");
253253
#else
254-
seq_puts(m, " <filename> <lease>\n");
254+
seq_puts(m, " <filename> <lease> <lease-key>\n");
255255
#endif /* CIFS_DEBUG2 */
256256
spin_lock(&cifs_tcp_ses_lock);
257257
list_for_each_entry(server, &cifs_tcp_ses_list, tcp_ses_list) {
@@ -274,6 +274,7 @@ static int cifs_debug_files_proc_show(struct seq_file *m, void *v)
274274

275275
/* Append lease/oplock caching state as RHW letters */
276276
inode = d_inode(cfile->dentry);
277+
cinode = NULL;
277278
n = 0;
278279
if (inode) {
279280
cinode = CIFS_I(inode);
@@ -291,6 +292,12 @@ static int cifs_debug_files_proc_show(struct seq_file *m, void *v)
291292
else
292293
seq_puts(m, "NONE");
293294

295+
seq_puts(m, " ");
296+
if (cinode && cinode->lease_granted)
297+
seq_printf(m, "%pUl", cinode->lease_key);
298+
else
299+
seq_puts(m, "-");
300+
294301
#ifdef CONFIG_CIFS_DEBUG2
295302
seq_printf(m, " %llu", cfile->fid.mid);
296303
#endif /* CONFIG_CIFS_DEBUG2 */
@@ -317,7 +324,7 @@ static int cifs_debug_dirs_proc_show(struct seq_file *m, void *v)
317324

318325
seq_puts(m, "# Version:1\n");
319326
seq_puts(m, "# Format:\n");
320-
seq_puts(m, "# <tree id> <sess id> <persistent fid> <path>\n");
327+
seq_puts(m, "# <tree id> <sess id> <persistent fid> <lease-key> <path>\n");
321328

322329
spin_lock(&cifs_tcp_ses_lock);
323330
list_for_each(stmp, &cifs_tcp_ses_list) {
@@ -336,11 +343,15 @@ static int cifs_debug_dirs_proc_show(struct seq_file *m, void *v)
336343
(unsigned long)atomic_long_read(&cfids->total_dirents_entries),
337344
(unsigned long long)atomic64_read(&cfids->total_dirents_bytes));
338345
list_for_each_entry(cfid, &cfids->entries, entry) {
339-
seq_printf(m, "0x%x 0x%llx 0x%llx %s",
346+
seq_printf(m, "0x%x 0x%llx 0x%llx ",
340347
tcon->tid,
341348
ses->Suid,
342-
cfid->fid.persistent_fid,
343-
cfid->path);
349+
cfid->fid.persistent_fid);
350+
if (cfid->has_lease)
351+
seq_printf(m, "%pUl ", cfid->fid.lease_key);
352+
else
353+
seq_puts(m, "- ");
354+
seq_printf(m, "%s", cfid->path);
344355
if (cfid->file_all_info_is_valid)
345356
seq_printf(m, "\tvalid file info");
346357
if (cfid->dirents.is_valid)

fs/smb/client/cifsglob.h

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@
2424
#include "cifsacl.h"
2525
#include <crypto/internal/hash.h>
2626
#include <uapi/linux/cifs/cifs_mount.h>
27-
#include "../common/cifsglob.h"
27+
#include "../common/smbglob.h"
2828
#include "../common/smb2pdu.h"
29+
#include "../common/fscc.h"
2930
#include "smb2pdu.h"
3031
#include <linux/filelock.h>
3132

@@ -633,28 +634,6 @@ struct smb_version_operations {
633634
struct kvec *xattr_iov);
634635
};
635636

636-
struct smb_version_values {
637-
char *version_string;
638-
__u16 protocol_id;
639-
__u32 req_capabilities;
640-
__u32 large_lock_type;
641-
__u32 exclusive_lock_type;
642-
__u32 shared_lock_type;
643-
__u32 unlock_lock_type;
644-
size_t header_preamble_size;
645-
size_t header_size;
646-
size_t max_header_size;
647-
size_t read_rsp_size;
648-
__le16 lock_cmd;
649-
unsigned int cap_unix;
650-
unsigned int cap_nt_find;
651-
unsigned int cap_large_files;
652-
unsigned int cap_unicode;
653-
__u16 signing_enabled;
654-
__u16 signing_required;
655-
size_t create_lease_size;
656-
};
657-
658637
#define HEADER_SIZE(server) (server->vals->header_size)
659638
#define MAX_HEADER_SIZE(server) (server->vals->max_header_size)
660639
#define HEADER_PREAMBLE_SIZE(server) (server->vals->header_preamble_size)
@@ -692,12 +671,6 @@ struct cifs_mnt_data {
692671
int flags;
693672
};
694673

695-
static inline unsigned int
696-
get_rfc1002_length(void *buf)
697-
{
698-
return be32_to_cpu(*((__be32 *)buf)) & 0xffffff;
699-
}
700-
701674
struct TCP_Server_Info {
702675
struct list_head tcp_ses_list;
703676
struct list_head smb_ses_list;

0 commit comments

Comments
 (0)