ksmbd: fix bug on trap in smb2_lock
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>
This commit is contained in:
parent
84d2d1641b
commit
e26e2d2e15
1 changed files with 1 additions and 1 deletions
|
@ -7468,7 +7468,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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue