New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 658454 link

Starred by 5 users

Issue metadata

Status: Verified
Owner:
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

Quic Protocol not disabled when QuicAllowed policy is False

Project Member Reported by krishna...@chromium.org, Oct 21 2016

Issue description

Chrome Version: 55.0.2883.22
Chrome OS Version: 8872.19.0
Chrome OS Platform: Peppy
Network info: Wifi

Quic protocol/sessions are not disabled even when the QuicAllowed policy is set to False

Steps To Reproduce:
(1) On an Enrolled device sign in with an user for which the QuicAllowed policy is set to False
(2) Navigate to Youtube and check in chrome://net-internals that QUIC protocol is disabled.

Expected Result:
Quic protocol shall not be utilized when the QuicAllowed policy is set to False via chrome policy

Actual Result:
Quic protocol/sessions are not disabled even when the QuicAllowed is set to False

How frequently does this problem reproduce? (Always, sometimes, hard to
reproduce?)
Always

Attached 
1) a screenshot of the chrome://net-internals/#quic page displaying Quic active sessions.
2) Device logs
3) Screenshot of the events page showing a QUIC protocol request.
(I didn't modify the flags on the chrome://flags page ie, the flag is set to Default.)

Flakiness seen:
Quic Protocol is indeed disabled the very first time that the user (that has the policy = False) sign in. 
But if the user were removed and added again or if the device is rebooted, QUIC is not disabled.


 
chrome-policy-page.png
478 KB View Download
chrome-net-events.png
574 KB View Download
log-102116-161148.tar.gz
606 KB Download
Cc: -sduraisamy@chromium.org
Owner: sduraisamy@chromium.org
Components: Internals>Network>QUIC
Cc: atwilson@chromium.org
Labels: -Pri-1 M-56 Pri-2
Note: Chrome should be restarted for this policy to take effect - atleast that is the case for the chrome flag #enable-quic

Looks like issues were observed after system reboot.
Cc: sduraisamy@chromium.org
Owner: pmarko@chromium.org
Status: Started (was: Available)

Comment 7 by pmarko@chromium.org, Nov 10 2016

Note to self: The QuicAllowed policy was originally introduced in  bug 461739 .

Comment 8 by pmarko@chromium.org, Nov 16 2016

The problem here is the order in which things happen at startup.

The original  bug 461739  implemented the QuicAllowed policy with Windows Registry-based policy in mind. This (and the .json config dir policy on chromeos) is loaded on the first access to BrowserProcessImpl::policy_service():
- BrowserProcessImpl::policy_service() constructs the ChromeBrowserPolicyConnector (subclass)
- ChromeBrowserPolicyConnector ctor calls ChromeBrowserPolicyConnector::CreatePlatformProvider
- which in turn creates a AsyncPolicyProvider with a backing PolicyLoaderWin (for windows registry) or ConfigDirPolicyLoader (for .json)
- AsyncPolicyProvider ctor actually performs a synchronous policy load

This all happens before IOThread is constructed (last action in BrowserProcessImpl::PreCreateThreads), which is where the QuicAllowed policy value is evaluated.

Any cloud-based policies are only fetched afterwards.

Possible solutions:
- If possible, try to disable quic after startup on incoming policy change of QuicAllowed to false ( changing QuicAllowed to true would probably require a restart to take effect)
- don't declare QuicAllowed as user policy
- some special solution (like restart & caching) for QuicAllowed

Comment 9 by rch@chromium.org, Nov 16 2016

Cc: b...@chromium.org
+bnc
Looping back here - we should allow disabling quic post-profile initialization per our offline discussion.

Comment 11 by b...@chromium.org, Nov 17 2016

As far as I remember, disabling QUIC by policy after profile initialization has never been implemented.  It can be done using a NetPrefObserver, a class that used to exists for SPDY/3.1 policy until SPDY/3.1 was removed entirely.  For reference, there are the CLs that ripped out NetPrefObserver:
https://crrev.com/2140733002
https://crrev.com/2172543003

In the net stack QUIC can then be controlled by a static boolean member of some high-level class like HttpStreamFactory, where the SPDY/3.1 policy flag used to live, or maybe there is a more tasteful, I'm not sure.
Thanks a lot for the hint, Bence!

I think a static member in HttpStreamFactory would work but it feels "hacky".

As a HttpStreamFactoryImpl refers to a HttpNetworkSession, a more "natural" solution might be to try to update existing HttpNetworkSessions. The challenge with that approach is that there will be many HttpNetworkSessions instantiated in various places which seem to be unrelated after construction (where params tend to be copied & altered). Updating them afterwards would require introducing a "registry of HttpNetworkSessions" or some kind of hierarchy between them, which sounds like overkill for this usecase.
Labels: -M-56 M-57
Project Member

Comment 14 by bugdroid1@chromium.org, Jan 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6ab8be2474cd5017e22a4027019546a145474207

commit 6ab8be2474cd5017e22a4027019546a145474207
Author: pmarko <pmarko@chromium.org>
Date: Wed Jan 11 11:02:55 2017

Respect QuicAllowed policy for new streams

Introduce a mechanism for an incoming QuicAllowed cloud policy
to control QUIC protocol usage for new streams even after
IOThread initialization.
NetPrefObserver has been re-introduced to observe the change
(after it was removed in crrev.com/2140733002 and
crrev.com/2172543003).

BUG= 658454 
TEST=browser_tests --gtest_filter=*QuicAllowed*
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2546533003
Cr-Commit-Position: refs/heads/master@{#442866}

[modify] https://crrev.com/6ab8be2474cd5017e22a4027019546a145474207/chrome/browser/BUILD.gn
[modify] https://crrev.com/6ab8be2474cd5017e22a4027019546a145474207/chrome/browser/io_thread.cc
[modify] https://crrev.com/6ab8be2474cd5017e22a4027019546a145474207/chrome/browser/io_thread.h
[modify] https://crrev.com/6ab8be2474cd5017e22a4027019546a145474207/chrome/browser/policy/configuration_policy_handler_list_factory.cc
[modify] https://crrev.com/6ab8be2474cd5017e22a4027019546a145474207/chrome/browser/policy/policy_network_browsertest.cc
[modify] https://crrev.com/6ab8be2474cd5017e22a4027019546a145474207/chrome/browser/prefs/browser_prefs.cc
[add] https://crrev.com/6ab8be2474cd5017e22a4027019546a145474207/chrome/browser/profiles/net_http_session_params_observer.cc
[add] https://crrev.com/6ab8be2474cd5017e22a4027019546a145474207/chrome/browser/profiles/net_http_session_params_observer.h
[modify] https://crrev.com/6ab8be2474cd5017e22a4027019546a145474207/chrome/browser/profiles/profile_io_data.cc
[modify] https://crrev.com/6ab8be2474cd5017e22a4027019546a145474207/chrome/browser/profiles/profile_io_data.h
[modify] https://crrev.com/6ab8be2474cd5017e22a4027019546a145474207/chrome/browser/safe_browsing/safe_browsing_service.cc
[modify] https://crrev.com/6ab8be2474cd5017e22a4027019546a145474207/chrome/browser/safe_browsing/safe_browsing_service.h
[modify] https://crrev.com/6ab8be2474cd5017e22a4027019546a145474207/chrome/common/pref_names.cc
[modify] https://crrev.com/6ab8be2474cd5017e22a4027019546a145474207/chrome/common/pref_names.h
[modify] https://crrev.com/6ab8be2474cd5017e22a4027019546a145474207/google_apis/gcm/engine/connection_factory_impl.cc
[modify] https://crrev.com/6ab8be2474cd5017e22a4027019546a145474207/google_apis/gcm/engine/connection_factory_impl.h
[modify] https://crrev.com/6ab8be2474cd5017e22a4027019546a145474207/net/http/http_network_session.cc
[modify] https://crrev.com/6ab8be2474cd5017e22a4027019546a145474207/net/http/http_network_session.h
[modify] https://crrev.com/6ab8be2474cd5017e22a4027019546a145474207/net/http/http_stream_factory_impl_job.cc
[modify] https://crrev.com/6ab8be2474cd5017e22a4027019546a145474207/net/http/http_stream_factory_impl_job_controller.cc

Status: Fixed (was: Started)
Cc: jingwee@chromium.org
Status: Verified (was: Fixed)
Verified that when QuicAllowed policy is set to False via YAPS (and double checked in chrome://net-internals), the QUIC active session is no longer visible when visiting YouTube. Verified working in 57.0.2978.0:9176.0.0 dev lulu.
Note: If this is going to be merged somewhere, we should also merge
https://codereview.chromium.org/2639403004
which adds a forgotten command line flag to the browser tests which were newly introduced in this CL.
Status: Assigned (was: Verified)
QUIC failed to honor the policy consistently, as tested in M57.2987.30:9202.17.0 dev daisy and M57.2987.35:9202.21.0 beta daisy.

Steps:

1. Disabled QUIC on YAPS.
2. On a newly imaged and enrolled device, logon device as user, verified policies showed QuicAllowed=false and net-internals showed "QUIC enabled": false.

3. Enabled QUIC on YAPS.
4. policies showed QuicAllowed=true, net-internal showed "Quick enabled": false.  This is ok.
5. Rebooted device.
6. policies showed QuicAllowed=true, net-internal showed "Quick enabled": true. 

7. Disabled QUIC on YAPS.
8. policies showed QuicAllowed=false, net-internal showed "Quick enabled": true. This is ok.
9. Rebooted device.
10. policies showed QuicAllowed=false, net-internal showed "Quick enabled": true. This is bad.

11. Rebooted device.
12. policies showed QuicAllowed=false, net-internal showed "Quick enabled": false. This is good.

13. Rebooted device.
14. policies showed QuicAllowed=false, net-internal showed "Quick enabled": true. This is bad.

15. From here onward, after rebooting the device countless times, QUIC remained enable in net-internals despite the policy said false.
log-020917-180508.tar.gz
559 KB Download
Thank you for reporting the problems you were observing.

I was trying to reproduce this today but had no luck so far.
Could you please help me out with the following few questions:

(1) Are you sure that chrome://policies showed QuicAllowed=false? Did it say Level=MANDATORY and Source=Cloud?
I'm asking to rule out that the policy fetch failed (I see a few lines saying 'DMServer sent an error response: 400' in the logs).

(2) How did you configure YAPS on the device? By adding the URL into /etc/chrome_dev.conf ?

(3) Did you test with one profile or multiple profiles?

(4) How did you go on during the reboots?
(4a) Turn off the device from the UI / using the physical button / typing reboot into the console?
(4b) Did you just re-enter the user's password on the new boot? Or use Guest mode / Or add anothe ruser?
(4c) Did you wait for the network to be connected before logging in?

Thank you!
Also, what other policies were set in YAPS (were any auto-logon device policies set?)
Cc: pmarko@chromium.org
Labels: -Pri-2 Pri-1
Owner: jingwee@chromium.org
Cc: -pmarko@chromium.org
Owner: pmarko@chromium.org
Status: Verified (was: Assigned)
I'm terribly sorry I had not configured YAPS correctly; I had the QuicAllowed policy mode set as RECOMMENDED instead of MANDATORY.

Once I had that option set as MANDATORY, I no longer experienced the issues I reported earlier as tested with public and user sessions.

Tested no issue as verified in M57.0.2987.50:9202.26.0 beta peppy.

No worries, I'm glad that it works!

I'm writing up a document describing the QuicAllowed policy behavior (because its dynamic-disabling but reboot enabling is a bit weird), so I'll include a warning about MANDATORY being needed there.

Thanks!

Sign in to add a comment