linux-stable/fs
Thorsten Blum de17000b40 smb: server: Fix extension string in ksmbd_extract_shortname()
commit 8e7d178d06 upstream.

In ksmbd_extract_shortname(), strscpy() is incorrectly called with the
length of the source string (excluding the NUL terminator) rather than
the size of the destination buffer. This results in "__" being copied
to 'extension' rather than "___" (two underscores instead of three).

Use the destination buffer size instead to ensure that the string "___"
(three underscores) is copied correctly.

Cc: stable@vger.kernel.org
Fixes: e2f34481b2 ("cifsd: add server-side procedures for SMB3")
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-08-15 12:05:12 +02:00
..
9p
adfs
affs affs: don't write overlarge OFS data block size fields 2025-04-10 14:33:38 +02:00
afs afs: Fix the server_list to unuse a displaced server rather than putting it 2025-03-07 16:56:43 +01:00
autofs
befs
bfs
btrfs btrfs: fix assertion when building free space tree 2025-07-17 18:32:14 +02:00
cachefiles cachefiles: Fix the incorrect return value in __cachefiles_write() 2025-07-24 08:51:51 +02:00
ceph ceph: fix possible integer overflow in ceph_zero_objects() 2025-07-06 10:57:56 +02:00
coda
configfs configfs: Do not override creating attribute file failure in populate_attrs() 2025-06-27 11:07:25 +01:00
cramfs
crypto
debugfs
devpts
dlm dlm: make tcp still work in multi-link env 2025-06-04 14:40:05 +02:00
ecryptfs
efivarfs efivarfs: Fix error on non-existent file 2024-12-27 13:52:55 +01:00
efs
erofs erofs: address D-cache aliasing 2025-08-15 12:04:51 +02:00
exfat exfat: fix the infinite loop in exfat_find_last_cluster() 2025-04-10 14:33:37 +02:00
exportfs
ext2
ext4 ext4: ensure i_size is smaller than maxbytes 2025-06-27 11:07:29 +01:00
f2fs f2fs: fix to calculate dirty data during has_not_enough_free_secs() 2025-08-15 12:05:07 +02:00
fat
freevxfs
fscache
fuse fuse: Return EPERM rather than ENOSYS from link() 2025-06-04 14:40:02 +02:00
gfs2 gfs2: move msleep to sleepable context 2025-06-27 11:07:25 +01:00
hfs hfs/hfsplus: fix slab-out-of-bounds in hfs_bnode_read_key 2025-04-25 10:43:53 +02:00
hfsplus hfsplus: remove mutex_lock check in hfsplus_free_extents 2025-08-15 12:04:52 +02:00
hostfs
hpfs
hugetlbfs
iomap iomap: avoid avoid truncating 64-bit offset to 32 bits 2025-01-23 17:17:12 +01:00
isofs isofs: Verify inode mode when loading from disk 2025-07-24 08:51:49 +02:00
jbd2 jbd2: fix data-race and null-ptr-deref in jbd2_journal_dirty_metadata() 2025-06-27 11:07:26 +01:00
jffs2 jffs2: check jffs2_prealloc_raw_node_refs() result in few other places 2025-06-27 11:07:36 +01:00
jfs jfs: fix metapage reference count leak in dbAllocCtl 2025-08-15 12:05:05 +02:00
kernfs kernfs: Relax constraint in draining guard 2025-06-27 11:07:11 +01:00
lockd
minix
netfs
nfs NFS: Fixup allocation flags for nfsiod's __GFP_NORETRY 2025-08-15 12:05:09 +02:00
nfs_common
nfsd nfsd: Initialize ssc before laundromat_work to prevent NULL dereference 2025-06-27 11:07:26 +01:00
nilfs2 nilfs2: reject invalid file types when reading inodes 2025-08-15 12:04:49 +02:00
nls
notify
ntfs
ntfs3 Revert "fs/ntfs3: Replace inode_trylock with inode_lock" 2025-08-15 12:04:52 +02:00
ocfs2 ocfs2: fix possible memory leak in ocfs2_finish_quota_recovery 2025-06-27 11:07:13 +01:00
omfs fs: omfs: Use flexible-array member in struct omfs_extent 2025-07-06 10:58:03 +02:00
openpromfs
orangefs fs/orangefs: Allow 2 more characters in do_c_string() 2025-08-15 12:05:04 +02:00
overlayfs ovl: Check for NULL d_inode() in ovl_dentry_upper() 2025-07-06 10:57:56 +02:00
proc proc: use the same treatment to check proc_lseek as ones for proc_read_iter et.al 2025-08-15 12:05:03 +02:00
pstore pstore/blk: trivial typo fixes 2025-02-21 13:48:53 +01:00
qnx4
qnx6
quota quota: flush quota_release_work upon quota writeback 2024-12-14 19:54:10 +01:00
ramfs
reiserfs
romfs
smb smb: server: Fix extension string in ksmbd_extract_shortname() 2025-08-15 12:05:12 +02:00
squashfs Squashfs: check return result of sb_min_blocksize 2025-06-27 11:07:13 +01:00
sysfs
sysv
tracefs
ubifs ubifs: skip dumping tnc tree when zroot is null 2025-02-21 13:49:21 +01:00
udf udf: Fix directory iteration for longer tail extents 2024-12-27 13:53:01 +01:00
ufs
unicode Revert "unicode: Don't special case ignorable code points" 2024-12-14 19:54:50 +01:00
vboxsf vboxsf: fix building with GCC 15 2025-03-28 21:58:51 +01:00
verity
xfs xfs: reset rootdir extent size hint after growfsrt 2025-06-27 11:07:20 +01:00
zonefs
aio.c
anon_inodes.c fs: export anon_inode_make_secure_inode() and fix secretmem LSM bypass 2025-07-17 18:32:10 +02:00
attr.c
bad_inode.c
binfmt_elf_fdpic.c binfmt: Fix whitespace issues 2025-05-22 14:09:58 +02:00
binfmt_elf_test.c
binfmt_elf.c binfmt_elf: Move brk for static PIE even if ASLR disabled 2025-05-22 14:09:59 +02:00
binfmt_flat.c binfmt_flat: Fix integer overflow bug on 32 bit systems 2025-02-21 13:49:39 +01:00
binfmt_misc.c
binfmt_script.c
buffer.c
char_dev.c
compat_binfmt_elf.c
coredump.c coredump: hand a pidfd to the usermode coredump helper 2025-06-04 14:40:25 +02:00
d_path.c
dax.c
dcache.c
direct-io.c
drop_caches.c
eventfd.c
eventpoll.c epoll: Add synchronous wakeup support for ep_poll_callback 2024-12-27 13:53:01 +01:00
exec.c binfmt: Fix whitespace issues 2025-05-22 14:09:58 +02:00
fcntl.c
fhandle.c
file_table.c fs: fix proc_handler for sysctl_nr_open 2025-02-21 13:48:53 +01:00
file.c fs: consistently deref the files table with rcu_dereference_raw() 2025-04-25 10:43:27 +02:00
filesystems.c fs/filesystems: Fix potential unsigned integer underflow in fs_name() 2025-06-27 11:07:23 +01:00
fs_context.c
fs_parser.c
fs_pin.c
fs_struct.c
fs_types.c
fs-writeback.c
fsopen.c
init.c
inode.c
internal.h
ioctl.c
Kconfig nfs: add missing selections of CONFIG_CRC32 2025-04-25 10:43:52 +02:00
Kconfig.binfmt
kernel_read_file.c
libfs.c
locks.c
Makefile
mbcache.c
mount.h
mpage.c
namei.c fuse: don't truncate cached, mutated symlink 2025-03-28 21:58:53 +01:00
namespace.c clone_private_mnt(): make sure that caller has CAP_SYS_ADMIN in the right userns 2025-07-24 08:51:54 +02:00
no-block.c
nsfs.c
open.c
pipe.c
pnode.c
pnode.h
posix_acl.c
proc_namespace.c
read_write.c
readdir.c
remap_range.c
select.c hrtimer: Use and report correct timerslack values for realtime tasks 2025-03-28 21:58:48 +01:00
seq_file.c
signalfd.c
splice.c
stack.c
stat.c
statfs.c
super.c
sync.c
sysctls.c
timerfd.c
userfaultfd.c mm/uffd: fix vma operation where start addr cuts part of vma 2025-06-27 11:07:04 +01:00
utimes.c
xattr.c