Skip to content

Commit 047b4e7

Browse files
committed
Merge tag 'v6.19-rc3-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6
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
2 parents b69053d + fa2fd0b commit 047b4e7

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

fs/smb/client/ioctl.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,9 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
588588
break;
589589
default:
590590
cifs_dbg(FYI, "unsupported ioctl\n");
591+
trace_smb3_unsupported_ioctl(xid,
592+
pSMBFile ? pSMBFile->fid.persistent_fid : 0,
593+
command);
591594
break;
592595
}
593596
cifs_ioc_exit:

fs/smb/client/smb2ops.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1905,6 +1905,12 @@ smb2_copychunk_range(const unsigned int xid,
19051905
src_off_prev = src_off;
19061906
dst_off_prev = dst_off;
19071907

1908+
/*
1909+
* __counted_by_le(ChunkCount): set to allocated chunks before
1910+
* populating Chunks[]
1911+
*/
1912+
cc_req->ChunkCount = cpu_to_le32(chunk_count);
1913+
19081914
chunks = 0;
19091915
copy_bytes = 0;
19101916
copy_bytes_left = umin(total_bytes_left, tcon->max_bytes_copy);

fs/smb/client/trace.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,6 +1579,7 @@ DEFINE_EVENT(smb3_ioctl_class, smb3_##name, \
15791579
TP_ARGS(xid, fid, command))
15801580

15811581
DEFINE_SMB3_IOCTL_EVENT(ioctl);
1582+
DEFINE_SMB3_IOCTL_EVENT(unsupported_ioctl);
15821583

15831584
DECLARE_EVENT_CLASS(smb3_shutdown_class,
15841585
TP_PROTO(__u32 flags,

0 commit comments

Comments
 (0)