ksmbd: fix bug on trap in smb2_lock
commit e26e2d2e15 upstream.
If lock count is greater than 1, flags could be old value.
It should be checked with flags of smb_lock, not flags.
It will cause bug-on trap from locks_free_lock in error handling
routine.
Cc: stable@vger.kernel.org
Reported-by: Norbert Szetei <norbert@doyensec.com>
Tested-by: Norbert Szetei <norbert@doyensec.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
8573571060
commit
8994f0ce82
@@ -7452,7 +7452,7 @@ no_check_cl:
|
||||
retry:
|
||||
rc = vfs_lock_file(filp, smb_lock->cmd, flock, NULL);
|
||||
skip:
|
||||
if (flags & SMB2_LOCKFLAG_UNLOCK) {
|
||||
if (smb_lock->flags & SMB2_LOCKFLAG_UNLOCK) {
|
||||
if (!rc) {
|
||||
ksmbd_debug(SMB, "File unlocked\n");
|
||||
} else if (rc == -ENOENT) {
|
||||
|
||||
Reference in New Issue
Block a user