]> git.baikalelectronics.ru Git - kernel.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)
committerSteve French <stfrench@microsoft.com>
Wed, 8 May 2019 04:24:55 +0000 (23:24 -0500)
commit7eedb007ef90e7adb6766c3e3b979bd7e1216912
tree15337da48020ddeb9265edcad0abf0255895d881
parent2b2a685b5897f50ce969d59bc397a743422aa6b4
cifs: fix strcat buffer overflow and reduce raciness in smb21_set_oplock_level()

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>
CC: Stable <stable@vger.kernel.org>
fs/cifs/smb2ops.c