linux/fs/smb/client
Bharath SM e4b61f3b1c cifs: prevent updating file size from server if we have a read/write lease
In cases of large directories, the readdir operation may span multiple
round trips to retrieve contents. This introduces a potential race
condition in case of concurrent write and readdir operations. If the
readdir operation initiates before a write has been processed by the
server, it may update the file size attribute to an older value.
Address this issue by avoiding file size updates from readdir when we
have read/write lease.

Scenario:
1) process1: open dir xyz
2) process1: readdir instance 1 on xyz
3) process2: create file.txt for write
4) process2: write x bytes to file.txt
5) process2: close file.txt
6) process2: open file.txt for read
7) process1: readdir 2 - overwrites file.txt inode size to 0
8) process2: read contents of file.txt - bug, short read with 0 bytes

Cc: stable@vger.kernel.org
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Bharath SM <bharathsm@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2024-03-10 19:33:53 -05: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_negtokeninit.asn1
cifs_spnego.c cifs: spnego: add ';' in HOST_KEY_LEN 2023-11-13 16:21:34 -06:00
cifs_spnego.h
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 We still have some races in filesystem methods when exposed to RCU 2024-02-25 09:29:05 -08: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: prevent updating file size from server if we have a read/write lease 2024-03-10 19:33:53 -05: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_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
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
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: prevent updating file size from server if we have a read/write lease 2024-03-10 19:33:53 -05: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: prevent updating file size from server if we have a read/write lease 2024-03-10 19:33:53 -05: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 cifs: prevent updating file size from server if we have a read/write lease 2024-03-10 19:33:53 -05: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