Skip to content

Commit d21a580

Browse files
Conchy-Conchysmfrench
authored andcommitted
ksmbd: fix reference count leak in smb_check_perm_dacl()
The issue happens in a specific path in smb_check_perm_dacl(). When "id" and "uid" have the same value, the function simply jumps out of the loop without decrementing the reference count of the object "posix_acls", which is increased by get_acl() earlier. This may result in memory leaks. Fix it by decreasing the reference count of "posix_acls" before jumping to label "check_access_bits". Fixes: 777cad1 ("ksmbd: remove select FS_POSIX_ACL in Kconfig") Signed-off-by: Xin Xiong <[email protected]> Signed-off-by: Xin Tan <[email protected]> Acked-by: Namjae Jeon <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent c5eb0a6 commit d21a580

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/ksmbd/smbacl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,6 +1261,7 @@ int smb_check_perm_dacl(struct ksmbd_conn *conn, struct path *path,
12611261
if (!access_bits)
12621262
access_bits =
12631263
SET_MINIMUM_RIGHTS;
1264+
posix_acl_release(posix_acls);
12641265
goto check_access_bits;
12651266
}
12661267
}

0 commit comments

Comments
 (0)