Add a policy to control clipboard size limit for Chrome Remote Desktop [chromium/src : main]

153 views
Skip to first unread message

Joe Downing (Gerrit)

unread,
Oct 26, 2021, 12:50:53 AM10/26/21
to asvitkine...@chromium.org, chromeos-commercial-rem...@google.com, Jamie Walch, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, chromotin...@chromium.org

Attention is currently required from: Jamie Walch.

View Change

1 comment:

To view, visit change 3243274. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I7cf6cac423a2a1b33ac1fa701c282a47aebcbeb0
Gerrit-Change-Number: 3243274
Gerrit-PatchSet: 2
Gerrit-Owner: Joe Downing <joe...@chromium.org>
Gerrit-Reviewer: Jamie Walch <jamie...@chromium.org>
Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-Attention: Jamie Walch <jamie...@chromium.org>
Gerrit-Comment-Date: Tue, 26 Oct 2021 04:50:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Jamie Walch (Gerrit)

unread,
Oct 26, 2021, 1:31:03 PM10/26/21
to Joe Downing, asvitkine...@chromium.org, chromeos-commercial-rem...@google.com, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, chromotin...@chromium.org

Attention is currently required from: Joe Downing.

Patch set 2:Code-Review +1

View Change

4 comments:

  • Patchset:

  • File components/policy/resources/policy_templates.json:

    • Patch Set #2, Line 2710: 2147483647

      I could see someone trying to work around the WebRTC message size limitation by setting this to 2147483647, which won't work. It's difficult to set a true maximum here, because it depends on the WebRTC implementation, and it's a bit awkward to phrase the description to document that limitation so this is just FYI, unless you want to change anything.

    • Patch Set #2, Line 2722: effectively

      No need for "effectively" either, I'd say.

    • Patch Set #2, Line 2722: not exceed this value for each event. If an event contains more data than is allowed, the payload will

      I think you can cut everything from "not" to "will" here without losing any information.

To view, visit change 3243274. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I7cf6cac423a2a1b33ac1fa701c282a47aebcbeb0
Gerrit-Change-Number: 3243274
Gerrit-PatchSet: 2
Gerrit-Owner: Joe Downing <joe...@chromium.org>
Gerrit-Reviewer: Jamie Walch <jamie...@chromium.org>
Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-Attention: Joe Downing <joe...@chromium.org>
Gerrit-Comment-Date: Tue, 26 Oct 2021 17:30:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Joe Downing (Gerrit)

unread,
Oct 26, 2021, 1:52:40 PM10/26/21
to asvitkine...@chromium.org, chromeos-commercial-rem...@google.com, Jamie Walch, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, chromotin...@chromium.org

View Change

4 comments:

  • Patchset:

  • File components/policy/resources/policy_templates.json:

    • I could see someone trying to work around the WebRTC message size limitation by setting this to 2147 […]

      I agree with this but don't have a better solution. Setting a maximum value is required so I can't drop the field and I didn't want to add WebRTC impl details into the policy if I could avoid it (especially if we decide to fix the message dropping behavior).

      I'll add a blurb that the actual message size is subject to data channel restrictions as that should help clarify the behavior for the folks setting the policy.

    • Done

    • Patch Set #2, Line 2722: not exceed this value for each event. If an event contains more data than is allowed, the payload will

      I think you can cut everything from "not" to "will" here without losing any information.

    • Done

To view, visit change 3243274. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I7cf6cac423a2a1b33ac1fa701c282a47aebcbeb0
Gerrit-Change-Number: 3243274
Gerrit-PatchSet: 2
Gerrit-Owner: Joe Downing <joe...@chromium.org>
Gerrit-Reviewer: Jamie Walch <jamie...@chromium.org>
Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-Comment-Date: Tue, 26 Oct 2021 17:52:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Jamie Walch <jamie...@chromium.org>
Gerrit-MessageType: comment

Joe Downing (Gerrit)

unread,
Oct 26, 2021, 1:54:43 PM10/26/21
to asvitkine...@chromium.org, chromeos-commercial-rem...@google.com, Maksim Ivanov, Jamie Walch, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, chromotin...@chromium.org

Attention is currently required from: Maksim Ivanov.

View Change

1 comment:

To view, visit change 3243274. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I7cf6cac423a2a1b33ac1fa701c282a47aebcbeb0
Gerrit-Change-Number: 3243274
Gerrit-PatchSet: 3
Gerrit-Owner: Joe Downing <joe...@chromium.org>
Gerrit-Reviewer: Jamie Walch <jamie...@chromium.org>
Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
Gerrit-Reviewer: Maksim Ivanov <em...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-Attention: Maksim Ivanov <em...@chromium.org>
Gerrit-Comment-Date: Tue, 26 Oct 2021 17:54:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Maksim Ivanov (Gerrit)

unread,
Oct 26, 2021, 2:28:40 PM10/26/21
to Joe Downing, asvitkine...@chromium.org, chromeos-commercial-rem...@google.com, Jamie Walch, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, chromotin...@chromium.org

Attention is currently required from: Joe Downing.

View Change

4 comments:

  • File chrome/test/data/policy/policy_test_cases.json:

    • Patch Set #3, Line 587: "reason_for_missing_test": "TODO(crbug.com/1213429) add test case"

      Please add a test for this new policy - that bug is tracking backfilling tests for existing policies, not the new ones.

  • File components/policy/resources/policy_templates.json:

    • Patch Set #3, Line 2717: 1MiB

      8 MiB?

    • Patch Set #3, Line 2718: None

      Just trying to understand... Is the default behavior - an infinite limit, i.e., 2147483647? (after truncating it to the data channel size)

      So up to you whether to replace this with "2147483647", or keep this "none" to designate a special behavior that different from any other value.

  • File remoting/host/it2me/it2me_host.cc:

    • Patch Set #3, Line 372: if (policies->GetInteger(policy::key::kRemoteAccessHostClipboardSizeBytes,

      Just in case - I don't think there's any validation of min/max values at this point. Normally these kind of things are validated at the point of transforming the policy value into a pref, which is usually done via a handler at configuration_policy_handler_list_factory.cc.

      So if int is 64-bit, this code will accept much larger values than 2147483647 that's specified in policy_templates.json. Unless I'm missing something.

To view, visit change 3243274. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I7cf6cac423a2a1b33ac1fa701c282a47aebcbeb0
Gerrit-Change-Number: 3243274
Gerrit-PatchSet: 3
Gerrit-Owner: Joe Downing <joe...@chromium.org>
Gerrit-Reviewer: Jamie Walch <jamie...@chromium.org>
Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
Gerrit-Reviewer: Maksim Ivanov <em...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-Attention: Joe Downing <joe...@chromium.org>
Gerrit-Comment-Date: Tue, 26 Oct 2021 18:28:26 +0000

Joe Downing (Gerrit)

unread,
Oct 27, 2021, 11:30:02 PM10/27/21
to asvitkine...@chromium.org, chromeos-commercial-rem...@google.com, Maksim Ivanov, Jamie Walch, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, chromotin...@chromium.org

Attention is currently required from: Maksim Ivanov.

View Change

5 comments:

  • Patchset:

  • File chrome/test/data/policy/policy_test_cases.json:

    • Please add a test for this new policy - that bug is tracking backfilling tests for existing policies […]

      I was planning on submitting a separate CL to take care of all of these but AFAICT this isn't something that's needed for our component. None of these policies are read from or exposed through the browser so I'm not sure what would be specified here.

      If you have an example where the policy has a test case but with no prefs or there is a specific format to use, please let me know. For now I've marked them as N/A.

  • File components/policy/resources/policy_templates.json:

    • Argh, yeah I was thinking bits instead of bytes : P

    • Just trying to understand... Is the default behavior - an infinite limit, i.e. […]

      Yeah the default is that we (CRD) won't enforce any limits. None seemed correct for this behavior but LMK if something else is more appropriate.

  • File remoting/host/it2me/it2me_host.cc:

    • Just in case - I don't think there's any validation of min/max values at this point. […]

      None of these are exposed from the browser so I don't think prefs come into play (LMK if that's incorrect).

      Our PolicyWatcher (https://source.chromium.org/chromium/chromium/src/+/main:remoting/host/policy_watcher.h) relies on the PolicyService and AsyncPolicyLoader which handle schema validation (if one of values is entered incorrectly, then the host will not run).

      I've verified that setting a value larger than max (e.g. 2147483648) is handled and the host logs an error:
      ERROR 11676 20200 15:25:16-417 ../../remoting/host/policy_watcher.cc 263 Invalid policy contents: RemoteAccessHostClipboardSizeBytes: Invalid value for integer

      INFORMATION 11676 26140 15:25:16-418 ../../remoting/host/remoting_me2me_host.cc 1807 SendHostOfflineReason: sending POLICY_READ_ERROR.

To view, visit change 3243274. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I7cf6cac423a2a1b33ac1fa701c282a47aebcbeb0
Gerrit-Change-Number: 3243274
Gerrit-PatchSet: 4
Gerrit-Owner: Joe Downing <joe...@chromium.org>
Gerrit-Reviewer: Jamie Walch <jamie...@chromium.org>
Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
Gerrit-Reviewer: Maksim Ivanov <em...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-Attention: Maksim Ivanov <em...@chromium.org>
Gerrit-Comment-Date: Thu, 28 Oct 2021 03:29:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Maksim Ivanov <em...@chromium.org>
Gerrit-MessageType: comment

Maksim Ivanov (Gerrit)

unread,
Oct 27, 2021, 11:44:03 PM10/27/21
to Joe Downing, asvitkine...@chromium.org, chromeos-commercial-rem...@google.com, Jamie Walch, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, chromotin...@chromium.org

Attention is currently required from: Joe Downing.

Patch set 4:Code-Review +1

View Change

4 comments:

  • Patchset:

  • File chrome/test/data/policy/policy_test_cases.json:

    • I was planning on submitting a separate CL to take care of all of these but AFAICT this isn't someth […]

      Ack - If there's no handling in the browser, then, indeed, this .json file won't be able to test it.

  • File components/policy/resources/policy_templates.json:

  • File remoting/host/it2me/it2me_host.cc:

    • None of these are exposed from the browser so I don't think prefs come into play (LMK if that's inco […]

      Ack - I didn't know that the remoting code applies the schema validation itself (in PolicyWatcher::NormalizePolicies(), as it turns out to be). Good to know.

To view, visit change 3243274. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I7cf6cac423a2a1b33ac1fa701c282a47aebcbeb0
Gerrit-Change-Number: 3243274
Gerrit-PatchSet: 4
Gerrit-Owner: Joe Downing <joe...@chromium.org>
Gerrit-Reviewer: Jamie Walch <jamie...@chromium.org>
Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
Gerrit-Reviewer: Maksim Ivanov <em...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-Attention: Joe Downing <joe...@chromium.org>
Gerrit-Comment-Date: Thu, 28 Oct 2021 03:43:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Maksim Ivanov <em...@chromium.org>
Comment-In-Reply-To: Joe Downing <joe...@chromium.org>
Gerrit-MessageType: comment

Joe Downing (Gerrit)

unread,
Oct 28, 2021, 11:37:13 AM10/28/21
to asvitkine...@chromium.org, chromeos-commercial-rem...@google.com, Maksim Ivanov, Jamie Walch, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, chromotin...@chromium.org

Patch set 5:Commit-Queue +2

View Change

1 comment:

To view, visit change 3243274. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I7cf6cac423a2a1b33ac1fa701c282a47aebcbeb0
Gerrit-Change-Number: 3243274
Gerrit-PatchSet: 5
Gerrit-Owner: Joe Downing <joe...@chromium.org>
Gerrit-Reviewer: Jamie Walch <jamie...@chromium.org>
Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
Gerrit-Reviewer: Maksim Ivanov <em...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-Comment-Date: Thu, 28 Oct 2021 15:37:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Chromium LUCI CQ (Gerrit)

unread,
Oct 28, 2021, 11:46:23 AM10/28/21
to Joe Downing, asvitkine...@chromium.org, chromeos-commercial-rem...@google.com, Maksim Ivanov, Jamie Walch, Chromium Metrics Reviews, chromium...@chromium.org, chromotin...@chromium.org

Chromium LUCI CQ submitted this change.

View Change



4 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.

Approvals: Jamie Walch: Looks good to me Maksim Ivanov: Looks good to me Joe Downing: Commit
Add a policy to control clipboard size limit for Chrome Remote Desktop

Change-Id: I7cf6cac423a2a1b33ac1fa701c282a47aebcbeb0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3243274
Commit-Queue: Joe Downing <joe...@chromium.org>
Reviewed-by: Maksim Ivanov <em...@chromium.org>
Reviewed-by: Jamie Walch <jamie...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#935899}
---
M chrome/test/data/policy/policy_test_cases.json
M remoting/host/desktop_environment_options.h
M tools/metrics/histograms/enums.xml
M remoting/host/desktop_environment_options.cc
M remoting/host/remoting_me2me_host.cc
M remoting/host/policy_watcher_unittest.cc
M remoting/host/it2me/it2me_host.cc
M remoting/host/it2me/it2me_host.h
M components/policy/resources/policy_templates.json
M remoting/host/policy_watcher.cc
10 files changed, 126 insertions(+), 31 deletions(-)


To view, visit change 3243274. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I7cf6cac423a2a1b33ac1fa701c282a47aebcbeb0
Gerrit-Change-Number: 3243274
Gerrit-PatchSet: 6
Gerrit-Owner: Joe Downing <joe...@chromium.org>
Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Reviewer: Jamie Walch <jamie...@chromium.org>
Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
Gerrit-Reviewer: Maksim Ivanov <em...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-MessageType: merged
Reply all
Reply to author
Forward
0 new messages