]> www.infradead.org Git - users/dwmw2/linux.git/commit
cifs: fix strcat buffer overflow and reduce raciness in smb21_set_oplock_level()
authorChristoph Probst <kernel@probst.it>
Tue, 7 May 2019 15:16:40 +0000 (17:16 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 23 Sep 2019 20:12:00 +0000 (21:12 +0100)
commit67d35f29cd9729fc5641b74fe848e6f7cb599359
treed1fbc0b84925a6e1da877da9c40edb80ec11b2d9
parent4c2fa9dab83f3bf8f584a6b51c151d04d0c02f66
cifs: fix strcat buffer overflow and reduce raciness in smb21_set_oplock_level()

commit 6a54b2e002c9d00b398d35724c79f9fe0d9b38fb upstream.

Change strcat to strncpy in the "None" case to fix a buffer overflow
when cinode->oplock is reset to 0 by another thread accessing the same
cinode. It is never valid to append "None" to any other message.

Consolidate multiple writes to cinode->oplock to reduce raciness.

Signed-off-by: Christoph Probst <kernel@probst.it>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/cifs/smb2ops.c