Commit 67d35f29 authored by Christoph Probst's avatar Christoph Probst Committed by Ben Hutchings
Browse files

cifs: fix strcat buffer overflow and reduce raciness in smb21_set_oplock_level()



commit 6a54b2e0 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: default avatarChristoph Probst <kernel@probst.it>
Reviewed-by: default avatarPavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 4c2fa9da
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment