Skip to content

Commit f6bd412

Browse files
namjaejeonsmfrench
authored andcommitted
ksmbd: override fsids for smb2_query_info()
Sangsoo reported that a DAC denial error occurred when accessing files through the ksmbd thread. This patch override fsids for smb2_query_info(). Reported-by: Sangsoo Lee <[email protected]> Signed-off-by: Namjae Jeon <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent a018c1b commit f6bd412

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

fs/smb/server/smb2pdu.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5596,6 +5596,11 @@ int smb2_query_info(struct ksmbd_work *work)
55965596

55975597
ksmbd_debug(SMB, "GOT query info request\n");
55985598

5599+
if (ksmbd_override_fsids(work)) {
5600+
rc = -ENOMEM;
5601+
goto err_out;
5602+
}
5603+
55995604
switch (req->InfoType) {
56005605
case SMB2_O_INFO_FILE:
56015606
ksmbd_debug(SMB, "GOT SMB2_O_INFO_FILE\n");
@@ -5614,6 +5619,7 @@ int smb2_query_info(struct ksmbd_work *work)
56145619
req->InfoType);
56155620
rc = -EOPNOTSUPP;
56165621
}
5622+
ksmbd_revert_fsids(work);
56175623

56185624
if (!rc) {
56195625
rsp->StructureSize = cpu_to_le16(9);
@@ -5623,6 +5629,7 @@ int smb2_query_info(struct ksmbd_work *work)
56235629
le32_to_cpu(rsp->OutputBufferLength));
56245630
}
56255631

5632+
err_out:
56265633
if (rc < 0) {
56275634
if (rc == -EACCES)
56285635
rsp->hdr.Status = STATUS_ACCESS_DENIED;

0 commit comments

Comments
 (0)