]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
smb: fix invalid username check in smb3_fs_context_parse_param()
authorYiqi Sun <sunyiqixm@gmail.com>
Tue, 11 Nov 2025 07:05:39 +0000 (15:05 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Dec 2025 17:37:20 +0000 (18:37 +0100)
commitef9b1e6b8f90282b098a29442639b7759be1374b
tree9d4631da2f0bfb89820fe0afd98be430997dddcb
parent4c5b89f3815431a4d9179e0e243fdb6ae37044d6
smb: fix invalid username check in smb3_fs_context_parse_param()

[ Upstream commit ed6612165b74f09db00ef0abaf9831895ab28b7f ]

Since the maximum return value of strnlen(..., CIFS_MAX_USERNAME_LEN)
is CIFS_MAX_USERNAME_LEN, length check in smb3_fs_context_parse_param()
is always FALSE and invalid.

Fix the comparison in if statement.

Signed-off-by: Yiqi Sun <sunyiqixm@gmail.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/smb/client/fs_context.c