Windows Desktop Directory Sharing#13630
Conversation
725f742 to
2cd91e5
Compare
|
@ibeckermayer - this PR is large and will require admin approval to merge. Consider breaking it up into a series smaller changes. |
|
@ibeckermayer - this PR is large and will require admin approval to merge. Consider breaking it up into a series smaller changes. |
4 similar comments
|
@ibeckermayer - this PR is large and will require admin approval to merge. Consider breaking it up into a series smaller changes. |
|
@ibeckermayer - this PR is large and will require admin approval to merge. Consider breaking it up into a series smaller changes. |
|
@ibeckermayer - this PR is large and will require admin approval to merge. Consider breaking it up into a series smaller changes. |
|
@ibeckermayer - this PR is large and will require admin approval to merge. Consider breaking it up into a series smaller changes. |
|
@ibeckermayer - this PR is large and will require admin approval to merge. Consider breaking it up into a series smaller changes. |
|
@ibeckermayer - this PR is large and will require admin approval to merge. Consider breaking it up into a series smaller changes. |
1 similar comment
|
@ibeckermayer - this PR is large and will require admin approval to merge. Consider breaking it up into a series smaller changes. |
|
@ibeckermayer - this PR is large and will require admin approval to merge. Consider breaking it up into a series smaller changes. |
|
@ibeckermayer - this PR is large and will require admin approval to merge. Consider breaking it up into a series smaller changes. |
|
@ibeckermayer - this PR is large and will require admin approval to merge. Consider breaking it up into a series smaller changes. |
| // In other words, all pointer data that needs to persist after this function returns MUST | ||
| // be copied into Rust-owned memory. | ||
|
|
||
| let res = SharedDirectoryInfoResponse::from(res); |
There was a problem hiding this comment.
At first, the SharedDirectoryInfoResponse was created in place where it was used, inside the call to handle_tdp_sd_info_response, but now it has been moved into top of the function. There's nothing wrong with defining it as a standalone variable, but I'm just wondering why you've moved it here? There are couple of old functions in which we follow the old pattern, so maybe we should unify them?
There was a problem hiding this comment.
The purpose of these changes are to always ensure that we adhere to the following memory safety protocol, all the way up here at the "C" boundary:
teleport/lib/srv/desktop/rdp/rdpclient/src/lib.rs
Lines 838 to 842 in 9f10dca
(Which we do in SharedDirectoryInfoResponse::from)
This way, we don't need to worry about any tricky memory bugs further down the call stack. It's all taken care of right here at the boundary.
I'm not sure which old functions you're referring to, can you point them out?
There was a problem hiding this comment.
Thanks for the response! I should've included the other function I had in my mind in my previous response. Like here: I did it the other way:
teleport/lib/srv/desktop/rdp/rdpclient/src/lib.rs
Lines 984 to 1004 in 9f10dca
There was a problem hiding this comment.
Ah I see, good eye. I must have not had those functions merged yet whenever I went back and revised all of these functions to use this pattern. The code and memory all works fine, but I'll add the safety comments and rearrange the order in an upcoming PR just for the sake of consistency.
Co-authored-by: Łukasz Kozłowski <admin@lkozlowski.com>
|
@ibeckermayer See the table below for backport results.
|
* `IRP_MJ_CREATE` (#12665) * `IRP_MJ_QUERY_INFORMATION` (#12717) * `IRP_MJ_CLOSE` (#12729) * Refactor rdpdr client (#12750) * Adding logic for `FILE_SUPERSEDE` (#12829) * Improve `process_irp_create` (#12830) * adds return statements that got lost in a merge * `IRP_MJ_DIRECTORY_CONTROL` (#12870) * `FileFullDirectoryInformation` (#12908) * Improve `ClientDriveQueryDirectoryResponse.encode()` (#12912) * `IRP_MJ_QUERY_VOLUME_INFORMATION` (#13071) * Fix Shared Directory Request handling when feature is disabled (#13439) * IRP_MJ_READ, IRP_MJ_WRITE, and IRP_MJ_SET_INFORMATION (#13995) * Adds constants for sizing calculations (#14051) Co-authored-by: Łukasz Kozłowski <lukasz.kozlowski@goteleport.com> Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
* `IRP_MJ_CREATE` (#12665) * `IRP_MJ_QUERY_INFORMATION` (#12717) * `IRP_MJ_CLOSE` (#12729) * Refactor rdpdr client (#12750) * Adding logic for `FILE_SUPERSEDE` (#12829) * Improve `process_irp_create` (#12830) * adds return statements that got lost in a merge * `IRP_MJ_DIRECTORY_CONTROL` (#12870) * `FileFullDirectoryInformation` (#12908) * Improve `ClientDriveQueryDirectoryResponse.encode()` (#12912) * `IRP_MJ_QUERY_VOLUME_INFORMATION` (#13071) * Fix Shared Directory Request handling when feature is disabled (#13439) * IRP_MJ_READ, IRP_MJ_WRITE, and IRP_MJ_SET_INFORMATION (#13995) * Adds constants for sizing calculations (#14051) Co-authored-by: Łukasz Kozłowski <lukasz.kozlowski@goteleport.com> Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
…ring) (#15770) * Windows Desktop Directory Sharing (#13630) * `IRP_MJ_CREATE` (#12665) * `IRP_MJ_QUERY_INFORMATION` (#12717) * `IRP_MJ_CLOSE` (#12729) * Refactor rdpdr client (#12750) * Adding logic for `FILE_SUPERSEDE` (#12829) * Improve `process_irp_create` (#12830) * adds return statements that got lost in a merge * `IRP_MJ_DIRECTORY_CONTROL` (#12870) * `FileFullDirectoryInformation` (#12908) * Improve `ClientDriveQueryDirectoryResponse.encode()` (#12912) * `IRP_MJ_QUERY_VOLUME_INFORMATION` (#13071) * Fix Shared Directory Request handling when feature is disabled (#13439) * IRP_MJ_READ, IRP_MJ_WRITE, and IRP_MJ_SET_INFORMATION (#13995) * Adds constants for sizing calculations (#14051) Co-authored-by: Łukasz Kozłowski <lukasz.kozlowski@goteleport.com> Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com> * `UnixPath` and `WindowsPath` (#14267) * `SharedDirectoryMoveRequest` and `SharedDirectoryMoveResponse` (#14959) * `SharedDirectoryCreateResponse` update (#15289) * Fix `process_irp_set_information` (#15364) * Sanitize Rust Debug Logs (#15743) * updates rdp-rs ref to include licensing changes * Updates rdp-rs ref and fixes Cargo Co-authored-by: Łukasz Kozłowski <lukasz.kozlowski@goteleport.com> Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
No description provided.