Skip to content

Commit 7408a67

Browse files
committed
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>
1 parent df4766b commit 7408a67

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

smb2pdu.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -8069,7 +8069,7 @@ int smb2_lock(struct ksmbd_work *work)
80698069
retry:
80708070
rc = vfs_lock_file(filp, smb_lock->cmd, flock, NULL);
80718071
skip:
8072-
if (flags & SMB2_LOCKFLAG_UNLOCK) {
8072+
if (smb_lock->flags & SMB2_LOCKFLAG_UNLOCK) {
80738073
if (!rc) {
80748074
ksmbd_debug(SMB, "File unlocked\n");
80758075
} else if (rc == -ENOENT) {

0 commit comments

Comments
 (0)