mirror-linux/fs/smb/client
Kees Cook 189f164e57 Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses
Conversion performed via this Coccinelle script:

  // SPDX-License-Identifier: GPL-2.0-only
  // Options: --include-headers-for-types --all-includes --include-headers --keep-comments
  virtual patch

  @gfp depends on patch && !(file in "tools") && !(file in "samples")@
  identifier ALLOC = {kmalloc_obj,kmalloc_objs,kmalloc_flex,
 		    kzalloc_obj,kzalloc_objs,kzalloc_flex,
		    kvmalloc_obj,kvmalloc_objs,kvmalloc_flex,
		    kvzalloc_obj,kvzalloc_objs,kvzalloc_flex};
  @@

  	ALLOC(...
  -		, GFP_KERNEL
  	)

  $ make coccicheck MODE=patch COCCI=gfp.cocci

Build and boot tested x86_64 with Fedora 42's GCC and Clang:

Linux version 6.19.0+ (user@host) (gcc (GCC) 15.2.1 20260123 (Red Hat 15.2.1-7), GNU ld version 2.44-12.fc42) #1 SMP PREEMPT_DYNAMIC 1970-01-01
Linux version 6.19.0+ (user@host) (clang version 20.1.8 (Fedora 20.1.8-4.fc42), LLD 20.1.8) #1 SMP PREEMPT_DYNAMIC 1970-01-01

Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-02-22 08:26:33 -08:00
..
compress
.gitignore smb client: Add generated file to gitignore file 2026-02-10 08:23:13 -08:00
Kconfig smb: client: Remove obsolete crypto_shash allocations 2025-10-15 22:10:28 -05:00
Makefile cifs: Autogenerate SMB2 error mapping table 2026-02-08 21:23:53 -06:00
asn1.c smb3: add support for IAKerb 2025-01-31 12:51:44 -06:00
cached_dir.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cached_dir.h smb: client: Avoid a dozen -Wflex-array-member-not-at-end warnings 2026-02-08 21:24:42 -06:00
cifs_debug.c cifs: SMB1 split: cifs_debug.c 2026-02-08 17:07:45 -06:00
cifs_debug.h cifs: SMB1 split: cifs_debug.c 2026-02-08 17:07:45 -06:00
cifs_fs_sb.h smb:client: smb: client: Add reverse mapping from tcon to superblocks 2025-03-31 21:12:31 -05:00
cifs_ioctl.h smb: minor fix to use SMB2_NTLMV2_SESSKEY_SIZE for auth_key size 2025-06-21 11:03:25 -05:00
cifs_spnego.c smb: client: Add tracepoint for krb5 auth 2025-12-05 17:40:42 -06:00
cifs_spnego.h cifs: Scripted clean up fs/smb/client/cifs_spnego.h 2026-02-08 17:07:44 -06:00
cifs_spnego_negtokeninit.asn1
cifs_swn.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08: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 cifs: SMB1 split: Adjust #includes 2026-02-08 17:07:45 -06:00
cifs_unicode.h cifs: Scripted clean up fs/smb/client/cifs_unicode.h 2026-02-08 17:07:44 -06:00
cifsacl.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cifsacl.h
cifsencrypt.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cifsfs.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cifsfs.h cifs: update internal module version number 2026-02-13 23:03:41 -06:00
cifsglob.h smb: client: fix data corruption due to racy lease checks 2026-02-12 17:49:55 -06:00
cifspdu.h cifs: SMB1 split: Move BCC access functions 2026-02-08 17:07:45 -06:00
cifsproto.h cifs: SMB1 split: connect.c 2026-02-08 17:07:46 -06:00
cifsroot.c
cifssmb.c cifs: SMB1 split: connect.c 2026-02-08 17:07:46 -06:00
compress.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
compress.h cifs: Scripted clean up fs/smb/client/compress.h 2026-02-08 17:07:44 -06:00
connect.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dfs.c smb: client: don't trust DFSREF_STORAGE_SERVER bit 2025-02-05 21:09:00 -06:00
dfs.h Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dfs_cache.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
dfs_cache.h cifs: Scripted clean up fs/smb/client/dfs_cache.h 2026-02-08 17:07:44 -06:00
dir.c cifs: SMB1 split: Split SMB1 protocol defs into smb1pdu.h 2026-02-08 17:07:45 -06:00
dns_resolve.c smb: client: provide dns_resolve_{unc,name} helpers 2025-01-19 19:34:00 -06:00
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 Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
fs_context.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
fs_context.h cifs: Scripted clean up fs/smb/client/fs_context.h 2026-02-08 17:07:44 -06:00
fscache.c
fscache.h cifs: SMB1 split: Separate out SMB1 decls into smb1proto.h 2026-02-08 17:07:45 -06:00
gen_smb2_mapping cifs: Autogenerate SMB2 error mapping table 2026-02-08 21:23:53 -06:00
inode.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ioctl.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
link.c cifs: SMB1 split: Split SMB1 protocol defs into smb1pdu.h 2026-02-08 17:07:45 -06:00
misc.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
namespace.c 13 smb3/cifs client fixes 2025-06-03 16:04:29 -07:00
netlink.c
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.c smb/client: rename to NT_STATUS_SOME_NOT_MAPPED 2026-02-12 14:22:29 -06:00
nterr.h smb/client: move NT_STATUS_MORE_ENTRIES 2026-02-12 14:22:29 -06:00
ntlmssp.h cifs: Scripted clean up fs/smb/client/ntlmssp.h 2026-02-08 17:07:45 -06:00
readdir.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
reparse.c cifs: Add a tracepoint to log EIO errors 2025-12-05 17:11:43 -06:00
reparse.h cifs: SMB1 split: Split SMB1 protocol defs into smb1pdu.h 2026-02-08 17:07:45 -06:00
rfc1002pdu.h smb: fix some warnings reported by scripts/checkpatch.pl 2025-11-30 21:11:45 -06:00
sess.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
smb1debug.c cifs: SMB1 split: cifs_debug.c 2026-02-08 17:07:45 -06:00
smb1encrypt.c cifs: SMB1 split: cifsencrypt.c 2026-02-08 17:07:45 -06:00
smb1maperror.c smb/client: map NT_STATUS_PRIVILEGE_NOT_HELD 2026-02-12 14:22:29 -06:00
smb1misc.c cifs: SMB1 split: netmisc.c 2026-02-08 17:07:45 -06:00
smb1ops.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
smb1pdu.h cifs: SMB1 split: Split SMB1 protocol defs into smb1pdu.h 2026-02-08 17:07:45 -06:00
smb1proto.h cifs: SMB1 split: Make BCC accessors conditional 2026-02-08 17:07:46 -06: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: terminate session upon failed client required signing 2026-02-15 18:35:34 -06:00
smb2file.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
smb2glob.h smb: client: fix data loss due to broken rename(2) 2025-09-09 18:39:58 -05:00
smb2inode.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
smb2maperror.c smb/client: introduce KUnit test to check search result of smb2_error_map_table 2026-02-08 21:24:41 -06:00
smb2maperror_test.c smb/client: introduce KUnit test to check search result of smb2_error_map_table 2026-02-08 21:24:41 -06:00
smb2misc.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
smb2ops.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
smb2pdu.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
smb2pdu.h smb: move some duplicate struct definitions to common/fscc.h 2025-11-30 21:11:45 -06:00
smb2proto.h smb: client: fix data corruption due to racy lease checks 2026-02-12 17:49:55 -06:00
smb2transport.c cifs: Add a tracepoint to log EIO errors 2025-12-05 17:11:43 -06:00
smbdirect.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
smbdirect.h smb: client: change smbd_deregister_mr() to return void 2025-10-13 08:26:22 -05:00
smbencrypt.c cifs: SMB1 split: Adjust #includes 2026-02-08 17:07:45 -06:00
smberr.h smb/client: rename ERRinvlevel to ERRunknownlevel 2026-02-08 21:24:41 -06:00
trace.c smb: client: Add tracepoint for krb5 auth 2025-12-05 17:40:42 -06:00
trace.h cifs: remove unnecessary tracing after put tcon 2026-02-14 19:31:32 -06:00
transport.c cifs: SMB1 split: Adjust #includes 2026-02-08 17:07:45 -06:00
unc.c
winucase.c
xattr.c cifs: SMB1 split: Adjust #includes 2026-02-08 17:07:45 -06:00