projects/linux·commit 047b4e78

Merge tag 'v6.19-rc3-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6

047b4e78 · Linus Torvalds <[email protected]> · 2026-01-02 09:14:13 -08:00

Pull smb client fixes from Steve French:

 - Fix array out of bounds error in copy_file_range

 - Add tracepoint to help debug ioctl failures

* tag 'v6.19-rc3-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
  smb: client: fix UBSAN array-index-out-of-bounds in smb2_copychunk_range
  smb3 client: add missing tracepoint for unsupported ioctls
Commit
047b4e783ce2af73b3287dfabfeaa51684932757
Parents
b69053dd · fa2fd0b1

Merge commit. Changes below are compared with the first parent: b69053dd.

Changes

3 files changed · +10 −0

FileStatusAddDelContent
fs/smb/client/ioctl.cmodified+3−0View file
fs/smb/client/smb2ops.cmodified+6−0View file
fs/smb/client/trace.hmodified+1−0View file

fs/smb/client/ioctl.c

View file
diff --git a/fs/smb/client/ioctl.c b/fs/smb/client/ioctl.c
index 0a9935c..d1b1532 100644
--- a/fs/smb/client/ioctl.c
+++ b/fs/smb/client/ioctl.c
@@ -588,6 +588,9 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
break;
default:
cifs_dbg(FYI, "unsupported ioctl\n");
+ trace_smb3_unsupported_ioctl(xid,
+ pSMBFile ? pSMBFile->fid.persistent_fid : 0,
+ command);
break;
}
cifs_ioc_exit:

fs/smb/client/smb2ops.c

View file
diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c
index a16ded4..c1aaf77 100644
--- a/fs/smb/client/smb2ops.c
+++ b/fs/smb/client/smb2ops.c
@@ -1905,6 +1905,12 @@ retry:
src_off_prev = src_off;
dst_off_prev = dst_off;
+ /*
+ * __counted_by_le(ChunkCount): set to allocated chunks before
+ * populating Chunks[]
+ */
+ cc_req->ChunkCount = cpu_to_le32(chunk_count);
+
chunks = 0;
copy_bytes = 0;
copy_bytes_left = umin(total_bytes_left, tcon->max_bytes_copy);

fs/smb/client/trace.h

View file
diff --git a/fs/smb/client/trace.h b/fs/smb/client/trace.h
index b0fbc2d..a584a77 100644
--- a/fs/smb/client/trace.h
+++ b/fs/smb/client/trace.h
@@ -1579,6 +1579,7 @@ DEFINE_EVENT(smb3_ioctl_class, smb3_##name, \
TP_ARGS(xid, fid, command))
DEFINE_SMB3_IOCTL_EVENT(ioctl);
+DEFINE_SMB3_IOCTL_EVENT(unsupported_ioctl);
DECLARE_EVENT_CLASS(smb3_shutdown_class,
TP_PROTO(__u32 flags,