Skip to content

Commit dbcd7fd

Browse files
namjaejeongregkh
authored andcommitted
ksmbd: fix bug on trap in smb2_lock
commit e26e2d2 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: [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]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a060909 commit dbcd7fd

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
@@ -7451,7 +7451,7 @@ int smb2_lock(struct ksmbd_work *work)
74517451
retry:
74527452
rc = vfs_lock_file(filp, smb_lock->cmd, flock, NULL);
74537453
skip:
7454-
if (flags & SMB2_LOCKFLAG_UNLOCK) {
7454+
if (smb_lock->flags & SMB2_LOCKFLAG_UNLOCK) {
74557455
if (!rc) {
74567456
ksmbd_debug(SMB, "File unlocked\n");
74577457
} else if (rc == -ENOENT) {

0 commit comments

Comments
 (0)