mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-25 06:21:34 -05:00
ksmbd: fix use-after-free in smb2_lock
If smb_lock->zero_len has value, ->llist of smb_lock is not delete and flock is old one. It will cause use-after-free on 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:
committed by
Steve French
parent
e2ff19f0b7
commit
84d2d1641b
@@ -7458,13 +7458,13 @@ int smb2_lock(struct ksmbd_work *work)
|
||||
}
|
||||
|
||||
no_check_cl:
|
||||
flock = smb_lock->fl;
|
||||
list_del(&smb_lock->llist);
|
||||
|
||||
if (smb_lock->zero_len) {
|
||||
err = 0;
|
||||
goto skip;
|
||||
}
|
||||
|
||||
flock = smb_lock->fl;
|
||||
list_del(&smb_lock->llist);
|
||||
retry:
|
||||
rc = vfs_lock_file(filp, smb_lock->cmd, flock, NULL);
|
||||
skip:
|
||||
|
||||
Reference in New Issue
Block a user