public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* cifs: out-of-bound write in build_ntlmssp_auth_blob()
@ 2016-02-03 14:48 Jerome Marchand
  0 siblings, 0 replies; only message in thread
From: Jerome Marchand @ 2016-02-03 14:48 UTC (permalink / raw)
  To: Steve French; +Cc: linux-cifs, 'linux-kernel'

[-- Attachment #1: Type: text/plain, Size: 781 bytes --]

Hi,

While running some test, KASan detected several out-of-bound write
accesses to the ntlmssp blob in build_ntlmssp_auth_blob(). In this case,
the ntlmssp blob was allocated in sess_auth_rawntlmssp_authenticate().
Its size is an "empirical" 5*sizeof(struct _AUTHENTICATE_MESSAGE) (320B
on x86_64). I don't know where this value comes from or if it was ever
appropriate, but it is currently insufficient: the user and domain name
in UTF16 could take 1kB by themselves. I'm not sure what's the proper
way to fix this. Naively I'd say to allocate the blob dynamically in
build_ntlmssp_auth_blob().
While I haven't run into the issue, the size of ntlmssp_blob in
SMB2_sess_setup is too small too (sizeof(struct _NEGOTIATE_MESSAGE) + 500).

Regards,
Jerome Marchand


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-02-03 14:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-03 14:48 cifs: out-of-bound write in build_ntlmssp_auth_blob() Jerome Marchand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox