ksmbd: SET_INFO modifies frozen filesystems
From: Christian Brauner
Date: Sat Nov 14 2026 - 04:38:43 EST
I'm working on a freeze protection series and this is the part that
affects ksmbd that I don't just want to fix myself.
SMB2 SET_INFO changes timestamps, permissions and ACLs on the shared
filesystem without freeze protection. So a client can modify a frozen
filesystem. On ext4 that trips the WARN_ON() in
ext4_journal_check_start().
Reproduced on v7.4-rc1 with a ksmbd share on ext4 mounted over cifs
with cifsacl from 127.0.0.1:
fsfreeze -f /srv/share
touch -d 2001-01-01 /mnt/cifs/f1
chmod 600 /mnt/cifs/f2
Both complete right away. f1 has an mtime of 2001-01-01 and f2's mode
changed on the frozen filesystem:
WARNING: fs/ext4/ext4_jbd2.c:90 at ext4_journal_check_start+0x1f6/0x2d0, CPU#0: kworker/0:2/40
Workqueue: ksmbd-io handle_ksmbd_work
Call Trace:
__ext4_journal_start_sb+0x7a/0x470
ext4_dirty_inode+0xa1/0x120
__mark_inode_dirty+0x154/0x1110
ext4_setattr+0x2bd/0x24e0
notify_change+0x81c/0xee0
set_file_basic_info+0x74c/0xcc0
smb2_set_info+0x1d73/0x3cd0
handle_ksmbd_work+0x89d/0x1d60
WARNING: fs/ext4/ext4_jbd2.c:90 at ext4_journal_check_start+0x1f6/0x2d0, CPU#0: kworker/0:0/9
Workqueue: ksmbd-io handle_ksmbd_work
Call Trace:
__ext4_journal_start_sb+0x7a/0x470
ext4_set_acl+0x22e/0x4e0
set_info_sec+0x2f1/0x7b0
smb2_set_info+0x606/0x3cd0
handle_ksmbd_work+0x89d/0x1d60
set_file_basic_info() calls notify_change() and set_info_sec() calls
set_posix_acl() and notify_change() without mnt_want_write().
It looks like smb2_open() has the same issue and also the EA, security
descriptor and stream xattrs written on create: smb2_set_ea(),
smb_inherit_dacl(), ksmbd_vfs_set_init_posix_acl(),
smb2_set_stream_name_xattr() and the direct ksmbd_vfs_set_sd_xattr() all
pass get_write=false or call set_posix_acl() directly, but nothing in
smb2_open() holds write access at that point anymore since 4e45cca31d4e
("smb/server: add ksmbd_vfs_kern_path()"). But I haven't looked into
reproducing that.
The SET_INFO ones go back to e2f34481b24d ("cifsd: add server-side
procedures for SMB3").