[crd host][linux] Recover desktop session when host restarts [chromium/src : main]

0 views
Skip to first unread message

Yuwei Huang (Gerrit)

unread,
Mar 11, 2026, 6:55:27 PM (3 days ago) Mar 11
to Joe Downing, Lambros Lambrou, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org, ipc-securi...@chromium.org
Attention needed from Joe Downing

Yuwei Huang added 3 comments

Patchset-level comments
File-level comment, Patchset 6 (Latest):
Yuwei Huang . resolved

PTAL, thanks!

File-level comment, Patchset 6 (Latest):
Yuwei Huang . resolved

PTAL thanks!

File remoting/host/mojom/desktop_session.mojom
Line 251, Patchset 6 (Latest): string client_email;
Yuwei Huang . resolved

I also thought about just having the daemon process "push" a recovered desktop session to [IpcDesktopEnvironment](https://source.chromium.org/chromium/chromium/src/+/main:remoting/host/ipc_desktop_environment.h;l=171;drc=373482a795ba8d47958dd09d49669cc23d076ec8), which seems to make sense in the first glance since it already has some session reuse logic, but it is going to have race conditions if a client tries to connect at the beginning of the session recovery process. The terminal ID clash is one issue, and another issue is that if the recovered desktop session is delivered after the connection, then the user will end up with two remote displays.

Open in Gerrit

Related details

Attention is currently required from:
  • Joe Downing
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I935b53c7327105e0d67181b21b4ab93a7247b693
Gerrit-Change-Number: 7652711
Gerrit-PatchSet: 6
Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
Gerrit-CC: Lambros Lambrou <lambros...@chromium.org>
Gerrit-Attention: Joe Downing <joe...@chromium.org>
Gerrit-Comment-Date: Wed, 11 Mar 2026 22:55:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Yuwei Huang (Gerrit)

unread,
Mar 11, 2026, 7:03:53 PM (3 days ago) Mar 11
to Joe Downing, Lambros Lambrou, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org, ipc-securi...@chromium.org
Attention needed from Joe Downing

Yuwei Huang added 1 comment

File remoting/host/linux/remote_display_session_manager.cc
Line 560, Patchset 7 (Latest): HandleSessionInfoQueriesBlockingStartup();
Yuwei Huang . resolved

This is to ensure that `DesktopSessionFactoryLinux::OnStartResult` can observe the environment variables of recovered sessions.

Open in Gerrit

Related details

Attention is currently required from:
  • Joe Downing
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I935b53c7327105e0d67181b21b4ab93a7247b693
Gerrit-Change-Number: 7652711
Gerrit-PatchSet: 7
Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
Gerrit-CC: Lambros Lambrou <lambros...@chromium.org>
Gerrit-Attention: Joe Downing <joe...@chromium.org>
Gerrit-Comment-Date: Wed, 11 Mar 2026 23:03:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Joe Downing (Gerrit)

unread,
Mar 11, 2026, 8:15:20 PM (3 days ago) Mar 11
to Yuwei Huang, Lambros Lambrou, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org, ipc-securi...@chromium.org
Attention needed from Yuwei Huang

Joe Downing added 5 comments

File remoting/host/linux/desktop_session_factory_linux.cc
Line 56, Patchset 8: static constexpr std::string_view kCharset =
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
std::string result;
result.reserve(16);
for (int i = 0; i < 16; ++i) {
result += kCharset[base::RandInt(0, kCharset.size() - 1)];
Joe Downing . unresolved

Why not just use a UUID? I think that's more common and would simplify your impl.

Line 87, Patchset 8: std::string_view client_email,
Joe Downing . unresolved

nit: This isn't critical but it's very possible for the client user to only have a username and not an email address (though you could always synthesize one). I'd suggest calling this client_id which is a string to represent the remote user which could be an email, username, etc. I don't think it's too critical though so feel free to ack if you prefer using email here and want to synthesize it.

Line 650, Patchset 8: protocol::RemoteDisplays proto;
Joe Downing . unresolved

WDYT about using base::Value::Dict and serializing to JSON instead of a protobuf? It seems like storing state between host instances (crash, update, etc) would be useful or other purposes and then you don't need to add a (to me) confusingly name 'remote_display.proto' file which is specific to Linux and actually represents GDM sessions (not remote displays in the video sense)?

Another way to resolve this would be to store the proto in the same directory as this file. IMO /remoting/proto is for service and protocol protos which is why I find it a little confusing to see a Linux-specific, local-only proto there. I would be fine with the name and such if the proto were stored and built in a /linux directory.

Line 651, Patchset 10 (Latest): for (const auto& [display_name, weak_session] : desktop_sessions_) {
Joe Downing . unresolved

Can you call this 'session'? It seems like the fact that it is a WeakPtr isn't important to call out.

File remoting/host/linux/remote_display_session_manager.cc
Line 476, Patchset 8: }
Joe Downing . unresolved

From Review Agent (and it seems reasonable):

These two lines were moved inside the `if (result.has_value())` block. This seems to be in error.

If `result` does not have a value (i.e., the `logind` query fails), `session_info_queries_blocking_startup_` will not be erased for this `display_path`, and `HandleSessionInfoQueriesBlockingStartup` will not be called for this path.

This will likely cause the startup to hang, waiting for a query that has already completed (with a failure).

These lines should be moved back outside the `if (result.has_value())` block to ensure startup can proceed even if session info cannot be fetched.

Open in Gerrit

Related details

Attention is currently required from:
  • Yuwei Huang
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I935b53c7327105e0d67181b21b4ab93a7247b693
    Gerrit-Change-Number: 7652711
    Gerrit-PatchSet: 10
    Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
    Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
    Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
    Gerrit-CC: Lambros Lambrou <lambros...@chromium.org>
    Gerrit-Attention: Yuwei Huang <yuw...@chromium.org>
    Gerrit-Comment-Date: Thu, 12 Mar 2026 00:15:09 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yuwei Huang (Gerrit)

    unread,
    Mar 12, 2026, 12:36:31 AM (3 days ago) Mar 12
    to Joe Downing, Lambros Lambrou, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org, ipc-securi...@chromium.org
    Attention needed from Joe Downing

    Yuwei Huang voted and added 5 comments

    Votes added by Yuwei Huang

    Commit-Queue+1

    5 comments

    File remoting/host/linux/desktop_session_factory_linux.cc
    Line 56, Patchset 8: static constexpr std::string_view kCharset =
    "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
    std::string result;
    result.reserve(16);
    for (int i = 0; i < 16; ++i) {
    result += kCharset[base::RandInt(0, kCharset.size() - 1)];
    Joe Downing . resolved

    Why not just use a UUID? I think that's more common and would simplify your impl.

    Yuwei Huang

    Done. GDM doesn't like `-` in the remote ID though, so I have to remove them.

    Line 87, Patchset 8: std::string_view client_email,
    Joe Downing . resolved

    nit: This isn't critical but it's very possible for the client user to only have a username and not an email address (though you could always synthesize one). I'd suggest calling this client_id which is a string to represent the remote user which could be an email, username, etc. I don't think it's too critical though so feel free to ack if you prefer using email here and want to synthesize it.

    Yuwei Huang

    Done

    Line 650, Patchset 8: protocol::RemoteDisplays proto;
    Joe Downing . resolved

    WDYT about using base::Value::Dict and serializing to JSON instead of a protobuf? It seems like storing state between host instances (crash, update, etc) would be useful or other purposes and then you don't need to add a (to me) confusingly name 'remote_display.proto' file which is specific to Linux and actually represents GDM sessions (not remote displays in the video sense)?

    Another way to resolve this would be to store the proto in the same directory as this file. IMO /remoting/proto is for service and protocol protos which is why I find it a little confusing to see a Linux-specific, local-only proto there. I would be fine with the name and such if the proto were stored and built in a /linux directory.

    Yuwei Huang

    Done

    Line 651, Patchset 10: for (const auto& [display_name, weak_session] : desktop_sessions_) {
    Joe Downing . resolved

    Can you call this 'session'? It seems like the fact that it is a WeakPtr isn't important to call out.

    Yuwei Huang

    Done

    File remoting/host/linux/remote_display_session_manager.cc
    Line 476, Patchset 8: }
    Joe Downing . resolved

    From Review Agent (and it seems reasonable):

    These two lines were moved inside the `if (result.has_value())` block. This seems to be in error.

    If `result` does not have a value (i.e., the `logind` query fails), `session_info_queries_blocking_startup_` will not be erased for this `display_path`, and `HandleSessionInfoQueriesBlockingStartup` will not be called for this path.

    This will likely cause the startup to hang, waiting for a query that has already completed (with a failure).

    These lines should be moved back outside the `if (result.has_value())` block to ensure startup can proceed even if session info cannot be fetched.

    Yuwei Huang

    The display path needs to be erased if `result` has no value, yes. AI's suggestion of moving it out the else block doesn't make sense though. The point is that, if we need to fetch the systemd environment, then we should wait for it to complete. The else block is for the session reporter code path, so we could wait for that as well, but we are going to delete that code path at some point, so I just didn't bother to fix it.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Joe Downing
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I935b53c7327105e0d67181b21b4ab93a7247b693
      Gerrit-Change-Number: 7652711
      Gerrit-PatchSet: 11
      Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
      Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
      Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
      Gerrit-CC: Lambros Lambrou <lambros...@chromium.org>
      Gerrit-Attention: Joe Downing <joe...@chromium.org>
      Gerrit-Comment-Date: Thu, 12 Mar 2026 04:36:23 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Joe Downing <joe...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Joe Downing (Gerrit)

      unread,
      Mar 12, 2026, 12:16:38 PM (2 days ago) Mar 12
      to Yuwei Huang, Lambros Lambrou, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org, ipc-securi...@chromium.org
      Attention needed from Yuwei Huang

      Joe Downing voted and added 1 comment

      Votes added by Joe Downing

      Code-Review+1

      1 comment

      File remoting/host/linux/desktop_session_factory_linux.cc
      Line 71, Patchset 13 (Latest): return config_dir.Append("remote_displays.json");
      Joe Downing . unresolved

      Can you confirm some details about this file (probably also worth a comment).

      This file will be read by a process running as root and the file will be ACL'd to that process correct?

      If the file is tampered with, and the 'required_username' field is set (as is the case for Corp connections) then the remoting desktop process will not be injected in the 'remote display' since the user associated with the session will not match.

      I think these are important details and worth documenting, meaning the mitigations in place to prevent the file from being tampered with to gain access to arbitrary sessions.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Yuwei Huang
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I935b53c7327105e0d67181b21b4ab93a7247b693
        Gerrit-Change-Number: 7652711
        Gerrit-PatchSet: 13
        Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
        Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
        Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
        Gerrit-CC: Lambros Lambrou <lambros...@chromium.org>
        Gerrit-Attention: Yuwei Huang <yuw...@chromium.org>
        Gerrit-Comment-Date: Thu, 12 Mar 2026 16:16:27 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Yuwei Huang (Gerrit)

        unread,
        Mar 12, 2026, 3:36:29 PM (2 days ago) Mar 12
        to Chromium IPC Reviews, Joe Downing, Lambros Lambrou, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org, ipc-securi...@chromium.org
        Attention needed from Chromium IPC Reviews and Joe Downing

        Yuwei Huang voted and added 2 comments

        Votes added by Yuwei Huang

        Commit-Queue+1

        2 comments

        Patchset-level comments
        File-level comment, Patchset 14 (Latest):
        Yuwei Huang . resolved

        New approval is needed for the async file util change. PTAL thanks!

        Also adding IPC reviewer.

        File remoting/host/linux/desktop_session_factory_linux.cc
        Line 71, Patchset 13: return config_dir.Append("remote_displays.json");
        Joe Downing . resolved

        Can you confirm some details about this file (probably also worth a comment).

        This file will be read by a process running as root and the file will be ACL'd to that process correct?

        If the file is tampered with, and the 'required_username' field is set (as is the case for Corp connections) then the remoting desktop process will not be injected in the 'remote display' since the user associated with the session will not match.

        I think these are important details and worth documenting, meaning the mitigations in place to prevent the file from being tampered with to gain access to arbitrary sessions.

        Yuwei Huang

        I was kind of relying on the default 022 umask. I think it could be exposing information if everyone can read that file, i.e. who has connected to CRD. I just changed the permission of the file to 600.

        If the file is tampered with, and the 'required_username' field is set (as is the case for Corp connections) then the remoting desktop process will not be injected in the 'remote display' since the user associated with the session will not match.

        We are not checking `required_username` on the `client_id` (which is the client email), since as you said, `client_id` could become something other than the client email.

        The check is in `IsSessionUsernameAllowed`, which happens during client connection. If the file is tampered with so that it points to another user's graphical session, then the entry will still be in the map, but the desktop session will be immediately closed when the client connects.

        I've added some more comments.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Chromium IPC Reviews
        • Joe Downing
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I935b53c7327105e0d67181b21b4ab93a7247b693
          Gerrit-Change-Number: 7652711
          Gerrit-PatchSet: 14
          Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
          Gerrit-Reviewer: Chromium IPC Reviews <chrome-ip...@google.com>
          Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
          Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
          Gerrit-CC: Lambros Lambrou <lambros...@chromium.org>
          Gerrit-Attention: Joe Downing <joe...@chromium.org>
          Gerrit-Attention: Chromium IPC Reviews <chrome-ip...@google.com>
          Gerrit-Comment-Date: Thu, 12 Mar 2026 19:36:19 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          Comment-In-Reply-To: Joe Downing <joe...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          gwsq (Gerrit)

          unread,
          Mar 12, 2026, 3:39:48 PM (2 days ago) Mar 12
          to Yuwei Huang, Chromium IPC Reviews, Daniel Cheng, Joe Downing, Lambros Lambrou, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org, ipc-securi...@chromium.org
          Attention needed from Daniel Cheng and Joe Downing

          Message from gwsq

          From googleclient/chrome/chromium_gwsq/ipc/config.gwsq:
          IPC: dch...@chromium.org

          📎 It looks like you’re making a possibly security-sensitive change! 📎 IPC security review isn’t a rubberstamp, so your friendly security reviewer will need a fair amount of context to review your CL effectively. Please review your CL description and code comments to make sure they provide context for someone unfamiliar with your project/area. Pay special attention to where data comes from and which processes it flows between (and their privilege levels). Feel free to point your security reviewer at design docs, bugs, or other links if you can’t reasonably make a self-contained CL description. (Also see https://cbea.ms/git-commit/).

          IPC reviewer(s): dch...@chromium.org


          Reviewer source(s):
          dch...@chromium.org is from context(googleclient/chrome/chromium_gwsq/ipc/config.gwsq)

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Daniel Cheng
          • Joe Downing
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I935b53c7327105e0d67181b21b4ab93a7247b693
          Gerrit-Change-Number: 7652711
          Gerrit-PatchSet: 14
          Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
          Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
          Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
          Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
          Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
          Gerrit-CC: Lambros Lambrou <lambros...@chromium.org>
          Gerrit-CC: gwsq
          Gerrit-Attention: Joe Downing <joe...@chromium.org>
          Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
          Gerrit-Comment-Date: Thu, 12 Mar 2026 19:39:43 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Joe Downing (Gerrit)

          unread,
          Mar 12, 2026, 3:44:52 PM (2 days ago) Mar 12
          to Yuwei Huang, Chromium IPC Reviews, Daniel Cheng, Lambros Lambrou, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org, ipc-securi...@chromium.org
          Attention needed from Daniel Cheng and Yuwei Huang

          Joe Downing added 1 comment

          File remoting/host/linux/desktop_session_factory_linux.cc
          Line 71, Patchset 13: return config_dir.Append("remote_displays.json");
          Joe Downing . resolved

          Can you confirm some details about this file (probably also worth a comment).

          This file will be read by a process running as root and the file will be ACL'd to that process correct?

          If the file is tampered with, and the 'required_username' field is set (as is the case for Corp connections) then the remoting desktop process will not be injected in the 'remote display' since the user associated with the session will not match.

          I think these are important details and worth documenting, meaning the mitigations in place to prevent the file from being tampered with to gain access to arbitrary sessions.

          Yuwei Huang

          I was kind of relying on the default 022 umask. I think it could be exposing information if everyone can read that file, i.e. who has connected to CRD. I just changed the permission of the file to 600.

          If the file is tampered with, and the 'required_username' field is set (as is the case for Corp connections) then the remoting desktop process will not be injected in the 'remote display' since the user associated with the session will not match.

          We are not checking `required_username` on the `client_id` (which is the client email), since as you said, `client_id` could become something other than the client email.

          The check is in `IsSessionUsernameAllowed`, which happens during client connection. If the file is tampered with so that it points to another user's graphical session, then the entry will still be in the map, but the desktop session will be immediately closed when the client connects.

          I've added some more comments.

          Joe Downing

          We are not checking required_username on the client_id (which is the client email), since as you said, client_id could become something other than the client email.

          I wasn't implying that you should, I just wanted to ensure that at some point it is being checked such that modifications to the file would not allow an arbitrary client to connect to another user's session.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Daniel Cheng
          • Yuwei Huang
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I935b53c7327105e0d67181b21b4ab93a7247b693
          Gerrit-Change-Number: 7652711
          Gerrit-PatchSet: 14
          Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
          Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
          Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
          Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
          Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
          Gerrit-CC: Lambros Lambrou <lambros...@chromium.org>
          Gerrit-CC: gwsq
          Gerrit-Attention: Yuwei Huang <yuw...@chromium.org>
          Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
          Gerrit-Comment-Date: Thu, 12 Mar 2026 19:44:41 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Joe Downing <joe...@chromium.org>
          Comment-In-Reply-To: Yuwei Huang <yuw...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Yuwei Huang (Gerrit)

          unread,
          Mar 12, 2026, 4:14:12 PM (2 days ago) Mar 12
          to Chromium IPC Reviews, Daniel Cheng, Joe Downing, Lambros Lambrou, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org, ipc-securi...@chromium.org
          Attention needed from Daniel Cheng and Joe Downing

          Yuwei Huang added 1 comment

          File remoting/host/linux/desktop_session_factory_linux.cc
          Line 71, Patchset 13: return config_dir.Append("remote_displays.json");
          Joe Downing . resolved

          Can you confirm some details about this file (probably also worth a comment).

          This file will be read by a process running as root and the file will be ACL'd to that process correct?

          If the file is tampered with, and the 'required_username' field is set (as is the case for Corp connections) then the remoting desktop process will not be injected in the 'remote display' since the user associated with the session will not match.

          I think these are important details and worth documenting, meaning the mitigations in place to prevent the file from being tampered with to gain access to arbitrary sessions.

          Yuwei Huang

          I was kind of relying on the default 022 umask. I think it could be exposing information if everyone can read that file, i.e. who has connected to CRD. I just changed the permission of the file to 600.

          If the file is tampered with, and the 'required_username' field is set (as is the case for Corp connections) then the remoting desktop process will not be injected in the 'remote display' since the user associated with the session will not match.

          We are not checking `required_username` on the `client_id` (which is the client email), since as you said, `client_id` could become something other than the client email.

          The check is in `IsSessionUsernameAllowed`, which happens during client connection. If the file is tampered with so that it points to another user's graphical session, then the entry will still be in the map, but the desktop session will be immediately closed when the client connects.

          I've added some more comments.

          Joe Downing

          We are not checking required_username on the client_id (which is the client email), since as you said, client_id could become something other than the client email.

          I wasn't implying that you should, I just wanted to ensure that at some point it is being checked such that modifications to the file would not allow an arbitrary client to connect to another user's session.

          Yuwei Huang

          Could you re-approve?

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Daniel Cheng
          • Joe Downing
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I935b53c7327105e0d67181b21b4ab93a7247b693
          Gerrit-Change-Number: 7652711
          Gerrit-PatchSet: 14
          Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
          Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
          Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
          Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
          Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
          Gerrit-CC: Lambros Lambrou <lambros...@chromium.org>
          Gerrit-CC: gwsq
          Gerrit-Attention: Joe Downing <joe...@chromium.org>
          Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
          Gerrit-Comment-Date: Thu, 12 Mar 2026 20:14:04 +0000
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Joe Downing (Gerrit)

          unread,
          Mar 12, 2026, 4:15:20 PM (2 days ago) Mar 12
          to Yuwei Huang, Chromium IPC Reviews, Daniel Cheng, Lambros Lambrou, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org, ipc-securi...@chromium.org
          Attention needed from Daniel Cheng and Yuwei Huang

          Joe Downing voted and added 1 comment

          Votes added by Joe Downing

          Code-Review+1

          1 comment

          File remoting/host/linux/desktop_session_factory_linux.cc
          Line 71, Patchset 13: return config_dir.Append("remote_displays.json");
          Joe Downing . resolved

          Can you confirm some details about this file (probably also worth a comment).

          This file will be read by a process running as root and the file will be ACL'd to that process correct?

          If the file is tampered with, and the 'required_username' field is set (as is the case for Corp connections) then the remoting desktop process will not be injected in the 'remote display' since the user associated with the session will not match.

          I think these are important details and worth documenting, meaning the mitigations in place to prevent the file from being tampered with to gain access to arbitrary sessions.

          Yuwei Huang

          I was kind of relying on the default 022 umask. I think it could be exposing information if everyone can read that file, i.e. who has connected to CRD. I just changed the permission of the file to 600.

          If the file is tampered with, and the 'required_username' field is set (as is the case for Corp connections) then the remoting desktop process will not be injected in the 'remote display' since the user associated with the session will not match.

          We are not checking `required_username` on the `client_id` (which is the client email), since as you said, `client_id` could become something other than the client email.

          The check is in `IsSessionUsernameAllowed`, which happens during client connection. If the file is tampered with so that it points to another user's graphical session, then the entry will still be in the map, but the desktop session will be immediately closed when the client connects.

          I've added some more comments.

          Joe Downing

          We are not checking required_username on the client_id (which is the client email), since as you said, client_id could become something other than the client email.

          I wasn't implying that you should, I just wanted to ensure that at some point it is being checked such that modifications to the file would not allow an arbitrary client to connect to another user's session.

          Yuwei Huang

          Could you re-approve?

          Joe Downing

          Ugh, I highly dislike Geritt and how it resets +1s to OWNERS :(

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Daniel Cheng
          • Yuwei Huang
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I935b53c7327105e0d67181b21b4ab93a7247b693
            Gerrit-Change-Number: 7652711
            Gerrit-PatchSet: 14
            Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
            Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
            Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
            Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
            Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
            Gerrit-CC: Lambros Lambrou <lambros...@chromium.org>
            Gerrit-CC: gwsq
            Gerrit-Attention: Yuwei Huang <yuw...@chromium.org>
            Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
            Gerrit-Comment-Date: Thu, 12 Mar 2026 20:15:09 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Yuwei Huang (Gerrit)

            unread,
            Mar 13, 2026, 3:07:24 PM (24 hours ago) Mar 13
            to Chromium IPC Reviews, Joe Downing, Lambros Lambrou, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org, ipc-securi...@chromium.org
            Attention needed from Chromium IPC Reviews

            Yuwei Huang voted and added 1 comment

            Votes added by Yuwei Huang

            Commit-Queue+1

            1 comment

            Patchset-level comments
            Yuwei Huang . resolved

            IPC reviewer is OOO

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Chromium IPC Reviews
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I935b53c7327105e0d67181b21b4ab93a7247b693
            Gerrit-Change-Number: 7652711
            Gerrit-PatchSet: 14
            Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
            Gerrit-Reviewer: Chromium IPC Reviews <chrome-ip...@google.com>
            Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
            Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
            Gerrit-CC: Lambros Lambrou <lambros...@chromium.org>
            Gerrit-CC: gwsq
            Gerrit-Attention: Chromium IPC Reviews <chrome-ip...@google.com>
            Gerrit-Comment-Date: Fri, 13 Mar 2026 19:07:13 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            gwsq (Gerrit)

            unread,
            Mar 13, 2026, 3:27:45 PM (24 hours ago) Mar 13
            to Yuwei Huang, Chromium IPC Reviews, Alex Gough, Joe Downing, Lambros Lambrou, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org, ipc-securi...@chromium.org
            Attention needed from Alex Gough

            Message from gwsq

            From googleclient/chrome/chromium_gwsq/ipc/config.gwsq:
            IPC: aj...@chromium.org

            📎 It looks like you’re making a possibly security-sensitive change! 📎 IPC security review isn’t a rubberstamp, so your friendly security reviewer will need a fair amount of context to review your CL effectively. Please review your CL description and code comments to make sure they provide context for someone unfamiliar with your project/area. Pay special attention to where data comes from and which processes it flows between (and their privilege levels). Feel free to point your security reviewer at design docs, bugs, or other links if you can’t reasonably make a self-contained CL description. (Also see https://cbea.ms/git-commit/).

            IPC reviewer(s): aj...@chromium.org


            Reviewer source(s):
            aj...@chromium.org is from context(googleclient/chrome/chromium_gwsq/ipc/config.gwsq)

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Alex Gough
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I935b53c7327105e0d67181b21b4ab93a7247b693
            Gerrit-Change-Number: 7652711
            Gerrit-PatchSet: 14
            Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
            Gerrit-Reviewer: Alex Gough <aj...@chromium.org>
            Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
            Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
            Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
            Gerrit-CC: Lambros Lambrou <lambros...@chromium.org>
            Gerrit-CC: gwsq
            Gerrit-Attention: Alex Gough <aj...@chromium.org>
            Gerrit-Comment-Date: Fri, 13 Mar 2026 19:27:06 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: No
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Alex Gough (Gerrit)

            unread,
            Mar 13, 2026, 4:10:39 PM (23 hours ago) Mar 13
            to Yuwei Huang, Alex Gough, Chromium IPC Reviews, Joe Downing, Lambros Lambrou, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org, ipc-securi...@chromium.org
            Attention needed from Yuwei Huang

            Alex Gough voted and added 1 comment

            Votes added by Alex Gough

            Code-Review+1

            1 comment

            Patchset-level comments
            Alex Gough . resolved

            lgtm mojom

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Yuwei Huang
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I935b53c7327105e0d67181b21b4ab93a7247b693
            Gerrit-Change-Number: 7652711
            Gerrit-PatchSet: 14
            Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
            Gerrit-Reviewer: Alex Gough <aj...@chromium.org>
            Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
            Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
            Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
            Gerrit-CC: Lambros Lambrou <lambros...@chromium.org>
            Gerrit-CC: gwsq
            Gerrit-Attention: Yuwei Huang <yuw...@chromium.org>
            Gerrit-Comment-Date: Fri, 13 Mar 2026 20:10:29 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            open
            diffy

            Yuwei Huang (Gerrit)

            unread,
            Mar 13, 2026, 4:11:34 PM (23 hours ago) Mar 13
            to Alex Gough, Chromium IPC Reviews, Joe Downing, Lambros Lambrou, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org, ipc-securi...@chromium.org

            Yuwei Huang voted and added 1 comment

            Votes added by Yuwei Huang

            Commit-Queue+2

            1 comment

            Patchset-level comments
            Yuwei Huang . resolved

            Thanks!

            Open in Gerrit

            Related details

            Attention set is empty
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I935b53c7327105e0d67181b21b4ab93a7247b693
            Gerrit-Change-Number: 7652711
            Gerrit-PatchSet: 14
            Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
            Gerrit-Reviewer: Alex Gough <aj...@chromium.org>
            Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
            Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
            Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
            Gerrit-CC: Lambros Lambrou <lambros...@chromium.org>
            Gerrit-CC: gwsq
            Gerrit-Comment-Date: Fri, 13 Mar 2026 20:11:25 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            open
            diffy

            Chromium LUCI CQ (Gerrit)

            unread,
            Mar 13, 2026, 5:07:11 PM (22 hours ago) Mar 13
            to Yuwei Huang, Alex Gough, Chromium IPC Reviews, Joe Downing, Lambros Lambrou, chromium...@chromium.org, chromotin...@chromium.org, ipc-securi...@chromium.org

            Chromium LUCI CQ submitted the change

            Change information

            Commit message:
            [crd host][linux] Recover desktop session when host restarts

            This CL updates the multi-process Linux host so that it stores the
            client_email=>remote_display_name mapping in a protobuf file and reuses
            these remote displays when creating new desktop sessions. This allows
            users to connect to graphical sessions created by the previous host
            incarnation, in case of host crashes or updates.

            The display name is also updated to a UUID to avoid race conditions and
            management pains of the terminal ID, which is currently assigned by the
            network process.

            RemoteDisplaySessionManager is also updated to wait for environment
            variables of user sessions to be loaded before they run the Init
            callback, eliminating a potential race condition.
            Bug: 475611769
            Change-Id: I935b53c7327105e0d67181b21b4ab93a7247b693
            Reviewed-by: Joe Downing <joe...@chromium.org>
            Reviewed-by: Alex Gough <aj...@chromium.org>
            Commit-Queue: Yuwei Huang <yuw...@chromium.org>
            Cr-Commit-Position: refs/heads/main@{#1599307}
            Files:
            • M remoting/base/async_file_util.cc
            • M remoting/base/async_file_util.h
            • M remoting/host/ipc_desktop_environment.cc
            • M remoting/host/ipc_desktop_environment.h
            • M remoting/host/linux/desktop_session_factory_linux.cc
            • M remoting/host/linux/desktop_session_factory_linux.h
            • M remoting/host/linux/remote_display_session_manager.cc
            • M remoting/host/mojom/desktop_session.mojom
            Change size: L
            Delta: 8 files changed, 340 insertions(+), 59 deletions(-)
            Branch: refs/heads/main
            Submit Requirements:
            • requirement satisfiedCode-Review: +1 by Joe Downing, +1 by Alex Gough
            Open in Gerrit
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: merged
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I935b53c7327105e0d67181b21b4ab93a7247b693
            Gerrit-Change-Number: 7652711
            Gerrit-PatchSet: 15
            Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
            Gerrit-Reviewer: Alex Gough <aj...@chromium.org>
            Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
            Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
            Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
            Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
            open
            diffy
            satisfied_requirement
            Reply all
            Reply to author
            Forward
            0 new messages