linux/fs/smb/client
Linus Torvalds 0a96d0d726 smb client fixes for v7.3-rc3
A batch of bug fixes for the smb client:
 
  - File type corruption fixes in reparse point handling: setting S_IFMT
    bits without clearing the existing type first corrupted the file mode
    (e.g. S_IFREG | S_IFCHR == S_IFLNK). Fixed in the WSL, POSIX and
    native symlink reparse parsers. Also fixes an uninitialized SID
    structure in the POSIX readdir path when parsing fails.
 
  - Ownership mapping fixes: forceuid/forcegid mount options were
    ignored in several code paths (SID-to-id mapping, WSL extended
    attributes, POSIX extensions getattr), allowing an untrusted server
    to dictate local file ownership despite explicit mount overrides.
 
  - Heap overflow and overflow fixes in DACL rewriting: replacing short
    SIDs with long ones could overflow the DACL buffer, and the u16
    accumulator for DACL size could wrap around with enough ACEs.
 
  - Reference count leak fixes in oplock break and deferred close:
    duplicate oplock breaks on a queued work item leaked a
    cifsFileInfo reference, and deferred close had a similar leak when
    requeueing a running work item. Both cause busy-inode oopses on
    unmount.
 
  - DFS superblock use-after-free fix: the iterator callback stored a
    raw superblock pointer without pinning it, racing with automount
    expiry.
 
  - One-byte slab OOB read in the native symlink parser when handling
    share-root relative paths.
 
  - Hardening of legacy SMB1 input: reject userspace-crafted
    cifs.idmap key descriptions that bypass kernel origin checks, and
    validate DataOffset in CIFSSMBRead() to prevent heap info
    disclosure from a malicious server.
 
  - DFS cache fix: defer metadata updates until target copying
    succeeds to prevent partial-state cache entries on allocation
    failure.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQTcqRusfSdYROJQwGkpVtNKoQNdYwUCaqLMxAAKCRApVtNKoQNd
 YwSyAQDUDSxCnDMmJbRr4e22oF/YrGSN/snp8cqrZlZh2pb5/gD/c2G3xMJA85YP
 yL/G8auRWkpwDl0/Parqptjhx1c9YwE=
 =PjPM
 -----END PGP SIGNATURE-----

Merge tag 'cifs-fixes-7.3-rc3' of https://git.manguebit.org/linux

Pull smb client fixes from Paulo Alcantara:

 - File type corruption fixes in reparse point handling: setting S_IFMT
   bits without clearing the existing type first corrupted the file mode
   (e.g. S_IFREG | S_IFCHR == S_IFLNK). Fixed in the WSL, POSIX and
   native symlink reparse parsers. Also fixes an uninitialized SID
   structure in the POSIX readdir path when parsing fails.

 - Ownership mapping fixes: forceuid/forcegid mount options were
   ignored in several code paths (SID-to-id mapping, WSL extended
   attributes, POSIX extensions getattr), allowing an untrusted server
   to dictate local file ownership despite explicit mount overrides.

 - Heap overflow and overflow fixes in DACL rewriting: replacing short
   SIDs with long ones could overflow the DACL buffer, and the u16
   accumulator for DACL size could wrap around with enough ACEs.

 - Reference count leak fixes in oplock break and deferred close:
   duplicate oplock breaks on a queued work item leaked a
   cifsFileInfo reference, and deferred close had a similar leak when
   requeueing a running work item. Both cause busy-inode oopses on
   unmount.

 - DFS superblock use-after-free fix: the iterator callback stored a
   raw superblock pointer without pinning it, racing with automount
   expiry.

 - One-byte slab OOB read in the native symlink parser when handling
   share-root relative paths.

 - Hardening of legacy SMB1 input: reject userspace-crafted
   cifs.idmap key descriptions that bypass kernel origin checks, and
   validate DataOffset in CIFSSMBRead() to prevent heap info
   disclosure from a malicious server.

 - DFS cache fix: defer metadata updates until target copying
   succeeds to prevent partial-state cache entries on allocation
   failure.

* tag 'cifs-fixes-7.3-rc3' of https://git.manguebit.org/linux:
  smb: client: fix one-byte OOB read in smb2_parse_native_symlink()
  smb: client: fail DACL rewrite when the new DACL exceeds 64K
  smb: client: fix heap overflow in DACL owner/group rewrite
  smb: client: fix file type corruption in cifs_reparse_point_to_fattr()
  smb: client: fix file type corruption in posix_reparse_to_fattr()
  smb: client: fix file type corruption in wsl_to_fattr()
  smb: client: avoid using uninitialized SIDs in cifs_posix_to_fattr()
  smb: client: fix WSL reparse point uid/gid override
  smb: client: honor forceuid/forcegid when mapping SIDs to uid/gid
  smb: client: fix uid/gid override in getattr with posix extensions
  smb: client: fix cifsFileInfo reference leak in deferred close
  smb: client: avoid leaking refcount when cifs_sb_tlink() fails
  smb: client: avoid leaking refcount in cifs_queue_oplock_break()
  smb: client: fill cache fields after populating cache in copy_ref_data()
  smb: client: pin DFS superblock in iterator callback
  smb: client: reject userspace cifs.idmap descriptions
  smb: client: reject out-of-bounds DataOffset in CIFSSMBRead()
  smb: client: reject short READ responses in CIFSSMBRead()
2026-09-10 14:03:48 -07:00
..
.gitignore smb/client: autogenerate SMB1 DOS/SRV to POSIX error mapping 2026-04-05 19:58:40 -05:00
asn1.c
cached_dir.c cifs: abort open_cached_dir if we don't request leases 2026-05-03 21:06:02 -05:00
cached_dir.h smb: client: fix (remove) drop_dir_cache module parameter 2026-04-22 09:54:21 -05:00
cifs_debug.c cifs: fix clearing stats for fastest execution of each smb2 command 2026-08-24 17:08:52 -03:00
cifs_debug.h cifs: SMB1 split: cifs_debug.c 2026-02-08 17:07:45 -06:00
cifs_fs_sb.h smb: client: fix busy dentry warning on unmount after DIO 2026-07-08 18:44:42 -05:00
cifs_ioctl.h smb: client: use atomic_t for mnt_cifs_flags 2026-02-26 18:17:08 -06:00
cifs_spnego_negtokeninit.asn1
cifs_spnego.c smb: client: reject userspace cifs.spnego descriptions 2026-05-19 10:43:05 -05:00
cifs_spnego.h cifs: Scripted clean up fs/smb/client/cifs_spnego.h 2026-02-08 17:07:44 -06:00
cifs_swn.c treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
cifs_swn.h cifs: Scripted clean up fs/smb/client/cifs_swn.h 2026-02-08 17:07:44 -06:00
cifs_unicode.c smb: client: Remove obsolete cmac(aes) allocation 2026-04-22 09:56:10 -05:00
cifs_unicode.h smb: client: use atomic_t for mnt_cifs_flags 2026-02-26 18:17:08 -06:00
cifsacl.c smb: client: fail DACL rewrite when the new DACL exceeds 64K 2026-09-09 11:56:47 -03:00
cifsacl.h
cifsencrypt.c smb: client: Clear sensitive stack data in cifsencrypt.c 2026-08-24 17:08:53 -03:00
cifsfs.c cifs: fix loff_t underflow in cifs_remap_file_range() when len == 0 2026-08-24 17:08:53 -03:00
cifsfs.h There are thirty-three client fixes: 2026-08-24 18:11:49 -07:00
cifsglob.h cifs: prevent readdir from changing file size due to stale directory metadata 2026-07-21 20:19:03 -05:00
cifspdu.h cifs: SMB1 split: Move BCC access functions 2026-02-08 17:07:45 -06:00
cifsproto.h cifs: Show reason why autodisabling serverino support 2026-07-09 08:03:19 -05:00
cifsroot.c
cifssmb.c smb: client: reject out-of-bounds DataOffset in CIFSSMBRead() 2026-09-02 20:24:18 -03:00
compress.c smb: move LZ77 compression into common code 2026-06-16 18:57:21 -05:00
compress.h smb: move LZ77 compression into common code 2026-06-16 18:57:21 -05:00
connect.c smb: client: fix multiuser mount with krb5 2026-08-30 14:05:16 -03:00
dfs_cache.c smb client fixes for v7.3-rc3 2026-09-10 14:03:48 -07:00
dfs_cache.h cifs: Scripted clean up fs/smb/client/dfs_cache.h 2026-02-08 17:07:44 -06:00
dfs.c
dfs.h Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dir.c There are thirty-three client fixes: 2026-08-24 18:11:49 -07:00
dns_resolve.c
dns_resolve.h cifs: Scripted clean up fs/smb/client/dns_resolve.h 2026-02-08 17:07:44 -06:00
export.c
file.c smb: client: fix cifsFileInfo reference leak in deferred close 2026-09-05 13:54:24 -03:00
fs_context.c 14 smb3 client fixes 2026-06-18 09:18:00 -07:00
fs_context.h smb: client: allow both 'lease' and 'nolease' mount options 2026-04-13 09:14:54 -05:00
fscache.c smb: client: simplify cifs_fscache_get_super_cookie() 2026-07-27 18:12:16 -05:00
fscache.h cifs: SMB1 split: Separate out SMB1 decls into smb1proto.h 2026-02-08 17:07:45 -06:00
gen_smb1_mapping smb/client: autogenerate SMB1 DOS/SRV to POSIX error mapping 2026-04-05 19:58:40 -05:00
gen_smb2_mapping cifs: Autogenerate SMB2 error mapping table 2026-02-08 21:23:53 -06:00
inode.c smb: client: honor forceuid/forcegid when mapping SIDs to uid/gid 2026-09-08 11:29:31 -03:00
ioctl.c smb: client: remove redundant NULL check before kfree() 2026-08-24 17:08:53 -03:00
Kconfig 18 ksmbd server fixes 2026-04-23 17:04:18 -07:00
link.c smb/client: zero-initialize stack-allocated cifs_open_info_data 2026-07-09 07:55:55 -05:00
Makefile smb: move LZ77 compression into common code 2026-06-16 18:57:21 -05:00
misc.c smb: client: avoid leaking refcount in cifs_queue_oplock_break() 2026-09-05 13:53:39 -03:00
namespace.c cifs: Implement fileattr_get for case sensitivity 2026-05-11 16:50:29 +02:00
netlink.c smb: client: require net admin for CIFS SWN netlink 2026-05-21 11:15:17 -05:00
netlink.h cifs: Scripted clean up fs/smb/client/netlink.h 2026-02-08 17:07:44 -06:00
netmisc.c cifs: SMB1 split: netmisc.c 2026-02-08 17:07:45 -06:00
nterr.h smb/client: replace nt_errs with ntstatus_to_dos_map 2026-04-05 19:58:40 -05:00
ntlmssp.h cifs: Scripted clean up fs/smb/client/ntlmssp.h 2026-02-08 17:07:45 -06:00
readdir.c smb: client: avoid using uninitialized SIDs in cifs_posix_to_fattr() 2026-09-08 11:29:57 -03:00
reparse.c smb: client: fix one-byte OOB read in smb2_parse_native_symlink() 2026-09-09 22:06:05 -03:00
reparse.h smb/client: decode reparse metadata using its payload type 2026-08-24 17:08:53 -03:00
rfc1002pdu.h smb: fix some warnings reported by scripts/checkpatch.pl 2025-11-30 21:11:45 -06:00
sess.c smb: client: Fix use-after-free in cifs_try_adding_channels() 2026-08-02 20:21:22 -05:00
smb1debug.c cifs: SMB1 split: cifs_debug.c 2026-02-08 17:07:45 -06:00
smb1encrypt.c smb: client: Clear sensitive stack data in smb1encrypt.c 2026-08-24 17:08:53 -03:00
smb1maperror_test.c smb/client: Use EXPORT_SYMBOL_IF_KUNIT() to export symbols 2026-07-14 21:48:00 -05:00
smb1maperror.c smb: client: remove conditional return with no effect 2026-07-26 17:40:20 -05:00
smb1misc.c smb: client: restore the data_offset bound in is_valid_oplock_break() 2026-08-24 17:08:53 -03:00
smb1ops.c smb: client: fix copy-paste error in WSL EA length accounting for $LXDEV 2026-08-24 17:08:53 -03:00
smb1pdu.h smb: move compression definitions into common/fscc.h 2026-06-16 18:57:21 -05:00
smb1proto.h smb/client: allow FS_IOC_SETFLAGS to clear compression 2026-06-14 15:12:23 -05:00
smb1session.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
smb1transport.c smb: client: fix UAF and buffer leak in cifs_check_trans2() for malformed secondary T2 2026-08-24 17:08:53 -03:00
smb2file.c smb: client: fix ALIGN() overflow in symlink_data() error context loop 2026-08-24 17:08:53 -03:00
smb2glob.h smb/client: make SMB2 maperror KUnit tests a separate module 2026-03-01 17:59:52 -06:00
smb2inode.c treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
smb2maperror_test.c smb/client: Use EXPORT_SYMBOL_IF_KUNIT() to export symbols in SMB2 2026-07-14 21:51:19 -05:00
smb2maperror.c smb/client: Use EXPORT_SYMBOL_IF_KUNIT() to export symbols in SMB2 2026-07-14 21:51:19 -05:00
smb2misc.c smb: client: reject overlapping data areas in SMB2 responses 2026-07-13 10:37:55 -05:00
smb2ops.c smb/client: invalidate fscache for fallocate range operations 2026-08-30 14:04:21 -03:00
smb2pdu.c smb/client: preserve open info type across compound queries 2026-08-24 17:08:52 -03:00
smb2pdu.h ksmbd: add SMB Direct RDMA encryption transform 2026-08-17 22:38:25 +09:00
smb2proto.h smb/client: refresh allocation after EOF-extending fallocate 2026-07-13 10:37:55 -05:00
smb2transport.c There are thirty-three client fixes: 2026-08-24 18:11:49 -07:00
smbdirect.c smb: smbdirect: introduce and use include/linux/smbdirect.h 2026-05-01 16:24:25 -05:00
smbdirect.h smb: smbdirect: introduce and use include/linux/smbdirect.h 2026-05-01 16:24:25 -05:00
smbencrypt.c cifs: SMB1 split: Adjust #includes 2026-02-08 17:07:45 -06:00
smberr.h smb/client: introduce KUnit tests to check DOS/SRV err mapping search 2026-04-05 19:58:40 -05:00
trace.c smb: client: Add tracepoint for krb5 auth 2025-12-05 17:40:42 -06:00
trace.h smb: client: reject out-of-bounds DataOffset in CIFSSMBRead() 2026-09-02 20:24:18 -03:00
transport.c smb: client: transport: Fix debug printing in __release_mid() 2026-08-30 14:05:05 -03:00
unc.c
winucase.c
xattr.c smb/client: clean up a type issue in cifs_xattr_get() 2026-06-14 15:12:24 -05:00