Skip to content

Commit 8994f0c

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 8573571 commit 8994f0c

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

0 commit comments

Comments
 (0)