Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a2d9daad authored by David Disseldorp's avatar David Disseldorp Committed by Steve French
Browse files

SMB: fix validate negotiate info uninitialised memory use

An undersize validate negotiate info server response causes the client
to use uninitialised memory for struct validate_negotiate_info_rsp
comparisons of Dialect, SecurityMode and/or Capabilities members.

Link: https://bugzilla.samba.org/show_bug.cgi?id=13092


Fixes: 7db0a6ef ("SMB3: Work around mount failure when using SMB3 dialect to Macs")
Signed-off-by: default avatarDavid Disseldorp <ddiss@suse.de>
Reviewed-by: default avatarPavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: default avatarSteve French <smfrench@gmail.com>
parent fe83bebc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -727,7 +727,8 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon)
			 rsplen);

		/* relax check since Mac returns max bufsize allowed on ioctl */
		if (rsplen > CIFSMaxBufSize)
		if ((rsplen > CIFSMaxBufSize)
		     || (rsplen < sizeof(struct validate_negotiate_info_rsp)))
			goto err_rsp_free;
	}