]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
smb: client: validate change notify buffer before copy
authorJoshua Rogers <linux@joshua.hu>
Thu, 6 Nov 2025 16:09:37 +0000 (00:09 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:34:40 +0000 (15:34 -0500)
commit3d82cb8465718d0b3df4ad93fd01db34b48ffb3a
tree71c0bd2ebd37588906d376fa1fced927698cb1a5
parenta557649f0038e2aa39758053b5bb7322e42d872a
smb: client: validate change notify buffer before copy

commit 4012abe8a78fbb8869634130024266eaef7081fe upstream.

SMB2_change_notify called smb2_validate_iov() but ignored the return
code, then kmemdup()ed using server provided OutputBufferOffset/Length.

Check the return of smb2_validate_iov() and bail out on error.

Discovered with help from the ZeroPath security tooling.

Signed-off-by: Joshua Rogers <linux@joshua.hu>
Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Cc: stable@vger.kernel.org
Fixes: e3e9463414f61 ("smb3: improve SMB3 change notification support")
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/smb/client/smb2pdu.c