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

Issue 598029 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

chrome.networkingPrivate.createNetwork mishandles duplicate networks

Project Member Reported by cernekee@chromium.org, Mar 25 2016

Issue description

The documentation[1] states: "If a matching configured network already exists, this will fail."

Unfortunately, it doesn't actually fail.  Calling createNetwork with the same parameters multiple times in a row just causes it to repeatedly change the GUID of the already-configured network.  The new GUID is passed to the createNetwork callback, and it is reflected in the getNetworks result.  This can be easily verified by opening a JS console on chrome://settings/network .

Here is what I see happening:

 - ManagedNetworkConfigurationHandlerImpl::CreateConfiguration() in Chrome generates a random GUID, then calls CreateShillConfiguration().  There is a TODO in this function that says that Chrome should check for duplicates first, but that code doesn't currently exist.

 - NetworkConfigurationHandler::CreateShillConfiguration() makes doubly sure there's a non-empty GUID in the request.

 - shill's ConfigureServiceForProfile handler looks up the GUID and finds nothing.

 - shill looks up the service by (ssid,mode,security) and finds it.

 - shill updates the existing service with the new GUID.

 - shill sends an event to Chrome to indicate that the GUID property has changed.

One option is to perform the duplicate check in Chrome's CreateConfiguration, per the TODO.  A disadvantage of this approach is that the check isn't atomic, so if somebody hammers Chrome with createNetwork() calls (for whatever insane reason), some of them might succeed in changing the GUID of an existing connection.

Another option is to change the semantics of the ConfigureServiceForProfile shill dbus method so that it atomically checks for duplicates, and fails if there is a (ssid,mode,security) match.  This behavior could be gated by a new property.  Or maybe we allow Chrome to pass in an empty or special GUID to tell shill how to handle that case.

Or, we can just update the docs to reflect the current behavior.  This will require rewriting some of our ARC code, which was based on the documented API behavior.  The ARC code may need to implement the racey "check before update" logic listed in the first option.

Your thoughts?


[1] https://developer.chrome.com/extensions/networkingPrivate#method-createNetwork

 

Comment 1 by quiche@chromium.org, Mar 28 2016

Owner: steve...@chromium.org
Steven's probably the right person to advise on the best fix. Assigning bug to him, accordingly.
Labels: -Pri-1 Pri-2
Status: Available (was: Unconfirmed)
Lowering priority and marking 'Available'. Will investigate if/when I have a chance. If someone else wants to jump in and fix this, feel free.

(We should check for duplicates first when create a new configuration, unless a GUID is provided).


Labels: Pri-3
Project Member

Comment 4 by sheriffbot@chromium.org, Apr 13 2018

Labels: Hotlist-Recharge-Cold
Labels: -Hotlist-Recharge-Cold
Status: Assigned (was: Available)

Sign in to add a comment