]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
cifs: fix strcat buffer overflow and reduce raciness in smb21_set_oplock_level()
authorChristoph Probst <kernel@probst.it>
Wed, 17 Jul 2019 20:13:09 +0000 (17:13 -0300)
committerSultan Alsawaf <sultan.alsawaf@canonical.com>
Wed, 24 Jul 2019 15:45:11 +0000 (09:45 -0600)
commit7c85762bf0ee29bc27b6c08c8465f2263079e673
tree54e5a85436bf4b27797894d735d5dae8c7bc576d
parent7788507d9d1d9e1b02598bf0a3a40ee5e555548e
cifs: fix strcat buffer overflow and reduce raciness in smb21_set_oplock_level()

BugLink: https://bugs.launchpad.net/bugs/1824981
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>
(cherry picked from commit 6a54b2e002c9d00b398d35724c79f9fe0d9b38fb)
Signed-off-by: Guilherme G. Piccoli <gpiccoli@canonical.com>
Acked-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/cifs/smb2ops.c