Skip to content

Commit e26e2d2

Browse files
namjaejeonSteve French
authored and
Steve French
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: [email protected] Reported-by: Norbert Szetei <[email protected]> Tested-by: Norbert Szetei <[email protected]> Signed-off-by: Namjae Jeon <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 84d2d16 commit e26e2d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/smb/server/smb2pdu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7468,7 +7468,7 @@ int smb2_lock(struct ksmbd_work *work)
74687468
retry:
74697469
rc = vfs_lock_file(filp, smb_lock->cmd, flock, NULL);
74707470
skip:
7471-
if (flags & SMB2_LOCKFLAG_UNLOCK) {
7471+
if (smb_lock->flags & SMB2_LOCKFLAG_UNLOCK) {
74727472
if (!rc) {
74737473
ksmbd_debug(SMB, "File unlocked\n");
74747474
} else if (rc == -ENOENT) {

0 commit comments

Comments
 (0)