title: ksmbd: validate session id and tree id in compound request
description: In the Linux kernel, the following vulnerability has been resolved:
ksmbd: validate session id and tree id in compound request
`smb2_get_msg()` in smb2_get_ksmbd_tcon() and smb2_check_user_session()
will always return the first request smb2 header in a compound request.
if `SMB2_TREE_CONNECT_HE` is the first command in compound request, will
return 0, i.e. The tree id check is skipped.
This patch use ksmbd_req_buf_next() to get current command in compound.
affected:
{
product: Linux
vendor: Linux
defaultStatus: unaffected
repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
versions:
version: 1da177e4c3f4, lessThan: 017d85c94f02, status: affected, versionType: git
version: 1da177e4c3f4, lessThan: becb5191d1d5, status: affected, versionType: git
version: 1da177e4c3f4, lessThan: 4c2b350b2e26, status: affected, versionType: git
version: 1da177e4c3f4, lessThan: 3df0411e132e, status: affected, versionType: git
}
{
product: Linux
vendor: Linux
defaultStatus: affected
repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
versions:
version: 5.15.145, lessThanOrEqual: 5.15.*, status: unaffected, versionType: custom
version: 6.1.53, lessThanOrEqual: 6.1.*, status: unaffected, versionType: custom
version: 6.4.16, lessThanOrEqual: 6.4.*, status: unaffected, versionType: custom
version: 6.5, lessThanOrEqual: *, status: unaffected, versionType: original_commit_for_fix
}
