two smb3 client fixes

-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEE6fsu8pdIjtWE/DpLiiy9cAdyT1EFAmlXPiYACgkQiiy9cAdy
 T1EaiQv+Mx6aS5nVptTxeNbNM95lsTpL5NB5+p21i+VNsG+ZVANl7U4/qYDJdfQb
 I7NfvGYSn0o7PBv3BlaitBxMFoJSVZrIQ3wsGKN9Rv6N+KjyDYfp3J30Na7enP11
 /+5/43TMok/yU936dLEwHh3YWvI120O/cWkjooQyHD9yLOXYBU8VkEfK0y4o8BVs
 JqOXhINus+5Bj2nLk01wF7HgUYDjL0R6GyGyoWcReVa1nYaxcaYEsbWU+KixPnGj
 x9FY5lz4CTtImttWDUEiPNEO8FaWJ866jbtN4FEerWYy7VBwIjAG6pLerZqTgXMp
 oGKdUG3/vSkyyuTeRJspYimKNZrWbMILM6oxk+Y0eDFEM1Z2p+KJaNJqL1bXF98K
 V+3if32md6i2t7h0QnxTXmVrs3acGDXJ9UNMELgtjRUS6w4vnS0Gf8HrPndaZvVO
 x9LUBm884svK4JWb4g3P8fBfnVrTdJw8tXyRibwxtct+iEqDbANacDGomzZPIxtB
 DYiZo0JM
 =3N8R
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2026-01-02 09:14:13 -08:00
commit 047b4e783c
3 changed files with 10 additions and 0 deletions

View file

@ -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:

View file

@ -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);

View file

@ -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,