]> git.ipfire.org Git - thirdparty/linux.git/commit
smb/client: properly disallow delegations on directories
authorJeff Layton <jlayton@kernel.org>
Wed, 7 Jan 2026 14:20:10 +0000 (09:20 -0500)
committerChristian Brauner <brauner@kernel.org>
Mon, 12 Jan 2026 09:54:47 +0000 (10:54 +0100)
commitb9a9be4d3557b97303ac6c8b5e153b7ef569d886
treef33c18fcc2c33f908bc802778cf899cc6a514bd1
parent10dcd5110678c6b241bbcf062f72ea14fb3597f3
smb/client: properly disallow delegations on directories

The check for S_ISREG() in cifs_setlease() is incorrect since that
operation doesn't get called for directories. The correct way to prevent
delegations on directories is to set the ->setlease() method in directory
file_operations to simple_nosetlease().

Fixes: e6d28ebc17eb ("filelock: push the S_ISREG check down to ->setlease handlers")
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20260107-setlease-6-19-v1-2-85f034abcc57@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/smb/client/cifsfs.c