linux-stable/fs/smb/client
Steve French 4860abb91f smb: Fix regression in writes when non-standard maximum write size negotiated
The conversion to netfs in the 6.3 kernel caused a regression when
maximum write size is set by the server to an unexpected value which is
not a multiple of 4096 (similarly if the user overrides the maximum
write size by setting mount parm "wsize", but sets it to a value that
is not a multiple of 4096).  When negotiated write size is not a
multiple of 4096 the netfs code can skip the end of the final
page when doing large sequential writes, causing data corruption.

This section of code is being rewritten/removed due to a large
netfs change, but until that point (ie for the 6.3 kernel until now)
we can not support non-standard maximum write sizes.

Add a warning if a user specifies a wsize on mount that is not
a multiple of 4096 (and round down), also add a change where we
round down the maximum write size if the server negotiates a value
that is not a multiple of 4096 (we also have to check to make sure that
we do not round it down to zero).

Reported-by: R. Diez" <rdiez-2006@rd10.de>
Fixes: d08089f649 ("cifs: Change the I/O paths to use an iterator rather than a page list")
Suggested-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Acked-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Tested-by: Matthew Ruffell <matthew.ruffell@canonical.com>
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Cc: stable@vger.kernel.org # v6.3+
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2024-02-15 22:19:23 -06:00
..
asn1.c
cached_dir.c cifs: update the same create_guid on replay 2024-02-11 19:07:08 -06:00
cached_dir.h smb: client: make laundromat a delayed worker 2023-10-12 09:41:04 -05:00
cifs_debug.c smb3: show beginning time for per share stats 2024-01-18 12:07:51 -06:00
cifs_debug.h
cifs_fs_sb.h
cifs_ioctl.h smb3: allow dumping session and tcon id to improve stats analysis and debugging 2023-11-10 02:00:30 -06:00
cifs_spnego.c cifs: spnego: add ';' in HOST_KEY_LEN 2023-11-13 16:21:34 -06:00
cifs_spnego.h
cifs_spnego_negtokeninit.asn1
cifs_swn.c
cifs_swn.h
cifs_unicode.c fs/smb/client: Use common code in client 2023-08-30 08:55:52 -05:00
cifs_unicode.h fs/smb/client: Use common code in client 2023-08-30 08:55:52 -05:00
cifsacl.c
cifsacl.h
cifsencrypt.c smb: Work around Clang __bdos() type confusion 2024-01-23 18:56:16 -06:00
cifsfs.c cifs: Share server EOF pos with netfslib 2024-01-23 18:59:05 -06:00
cifsfs.h cifs: update internal module version number for cifs.ko 2024-01-09 23:42:51 -06:00
cifsglob.h cifs: update the same create_guid on replay 2024-02-11 19:07:08 -06:00
cifspdu.h smb: client, common: fix fortify warnings 2023-11-30 11:17:03 -06:00
cifsproto.h cifs: make cifs_chan_update_iface() a void function 2024-01-08 22:36:26 -06:00
cifsroot.c
cifssmb.c cifs: get rid of dup length check in parse_reparse_point() 2024-01-07 21:18:00 -06:00
connect.c smb: Fix regression in writes when non-standard maximum write size negotiated 2024-02-15 22:19:23 -06:00
dfs.c cifs: change tcon status when need_reconnect is set on it 2024-02-09 14:43:23 -06:00
dfs.h smb: client: get rid of dfs code dep in namespace.c 2023-08-20 16:05:50 -05:00
dfs_cache.c smb: client: ensure to try all targets when finding nested links 2023-08-20 16:05:50 -05:00
dfs_cache.h smb: client: ensure to try all targets when finding nested links 2023-08-20 16:05:50 -05:00
dir.c smb: client: allow creating special files via reparse points 2024-01-07 15:46:05 -06:00
dns_resolve.c
dns_resolve.h
export.c exportfs: make ->encode_fh() a mandatory method for NFS export 2023-10-28 16:15:15 +02:00
file.c cifs: change tcon status when need_reconnect is set on it 2024-02-09 14:43:23 -06:00
fs_context.c smb: Fix regression in writes when non-standard maximum write size negotiated 2024-02-15 22:19:23 -06:00
fs_context.h cifs: new mount option called retrans 2024-01-19 10:31:57 -06:00
fscache.c netfs, cachefiles: Pass upper bound length to allow expansion 2023-12-28 09:45:25 +00:00
fscache.h client: convert to new timestamp accessors 2023-10-18 14:08:27 +02:00
inode.c cifs: Share server EOF pos with netfslib 2024-01-23 18:59:05 -06:00
ioctl.c Missing field not being returned in ioctl CIFS_IOC_GET_MNT_INFO 2023-11-10 09:32:04 -06:00
Kconfig fs/smb/client: Use common code in client 2023-08-30 08:55:52 -05:00
link.c smb: client: allow creating symlinks via reparse points 2024-01-07 15:46:06 -06:00
Makefile smb: client: get rid of dfs code dep in namespace.c 2023-08-20 16:05:50 -05:00
misc.c smb3: show beginning time for per share stats 2024-01-18 12:07:51 -06:00
namespace.c smb: client: set correct id, uid and cruid for multiuser automounts 2024-02-12 12:46:49 -06:00
netlink.c
netlink.h
netmisc.c
nterr.c
nterr.h
ntlmssp.h cifs: Add client version details to NTLM authenticate message 2023-10-22 19:03:42 -05:00
readdir.c smb: client: set correct d_type for reparse points under DFS mounts 2024-02-08 10:50:40 -06:00
rfc1002pdu.h
sess.c cifs: handle cases where multiple sessions share connection 2024-02-09 14:43:25 -06:00
smb1ops.c smb: client: introduce cifs_sfu_make_node() 2023-11-23 11:46:05 -06:00
smb2file.c
smb2glob.h smb: client: optimise reparse point querying 2024-01-07 15:46:05 -06:00
smb2inode.c cifs: commands that are retried should have replay flag set 2024-01-23 20:23:29 -06:00
smb2maperror.c cifs: new nt status codes from MS-SMB2 2024-01-18 21:01:04 -06:00
smb2misc.c smb: client: fix potential OOB in smb2_dump_detail() 2023-12-19 10:33:39 -06:00
smb2ops.c smb: client: handle path separator of created SMB symlinks 2024-02-12 12:47:21 -06:00
smb2pdu.c cifs: update the same create_guid on replay 2024-02-11 19:07:08 -06:00
smb2pdu.h smb: client, common: fix fortify warnings 2023-11-30 11:17:03 -06:00
smb2proto.h cifs: commands that are retried should have replay flag set 2024-01-23 20:23:29 -06:00
smb2status.h cifs: new nt status codes from MS-SMB2 2024-01-18 21:01:04 -06:00
smb2transport.c cifs: fix check of rc in function generate_smb3signingkey 2023-11-13 16:22:30 -06:00
smbdirect.c smb3: Improve exception handling in allocate_mr_list() 2024-01-07 15:46:06 -06:00
smbdirect.h
smbencrypt.c smb: client: delete "true", "false" defines 2024-01-23 12:41:02 -06:00
smberr.h
trace.c
trace.h smb: client: optimise reparse point querying 2024-01-07 15:46:05 -06:00
transport.c smb: client: increase number of PDUs allowed in a compound request 2024-02-01 12:15:51 -06:00
unc.c
winucase.c
xattr.c smb3: fix caching of ctime on setxattr 2023-11-09 10:25:58 -06:00