New issue
Advanced search Search tips

Issue 773859 link

Starred by 1 user

Issue metadata

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

Blocked on:
issue 773873



Sign in to add a comment

shill doesn't generate unique or stable storage identifiers for cellular devices

Project Member Reported by benchan@chromium.org, Oct 11 2017

Issue description

shill currently uses 'device_<mac>' as the storage identifier for devices, which assumes the MAC address is a unique identifier available on any device. That assumption is not always true, especially for cellular devices, in the following aspects: 

(1) A MAC address isn't always available - cellular devices don't necessarily need a MAC address.

(2) A MAC address isn't always unique - cellular devices of the same model may have the same default MAC address.

(3) The MAC address of a device remains unchanged - Because of (1) and (2), kernel drivers may assign a randomly generated MAC address for a cellular device.

It's thus inappropriate to use 'device_<mac>' as the storage identifier for cellular devices, which can lead to unstable identifier (e.g. a cellular device acquires a new storage identifier due to random MAC address assignment on each system boot) and potential (though rare) collisions of storage identifier.

For cellular devices, we should use IMEI or MEID (or ESN) instead of MAC address to generate unique storage identifiers.
 
Status: Started (was: Assigned)
Blockedon: 773873
Components: OS>Systems>Network
Status: Fixed (was: Started)
Project Member

Comment 4 by bugdroid1@chromium.org, Oct 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/aosp/platform/system/connectivity/shill/+/14399a2a23fd25b5e320df7521a778f2fe145347

commit 14399a2a23fd25b5e320df7521a778f2fe145347
Author: Ben Chan <benchan@chromium.org>
Date: Fri Oct 13 07:26:58 2017

shill: cellular: fix device storage identifier generation

Cellular devices don't always have a unique MAC address or even have
one. Cellular devices can be assigned a randomly generated MAC address
by the kernel. Thus the MAC address is not unique or stable enough to be
used in the storage identifier generation. Fortunately, cellular devices
have their own unique identifier, such as IMEI for 3GPP devices and MEID
for 3GPP2 devices.

This CL updates the storage identifier generation for cellular devices
to use IMEI or MEID, and fall back to use MAC address if neither IMEI
nor MEID is available.

BUG= chromium:773859 
TEST=Run unit tests.
TEST=Test a few cellular devices and verify that shill creates and uses
     the same device entry in the profile for each cellular device,
     including the cellular devices with a varying MAC address randomly
     generated by the kernel.

Change-Id: If0a9acb444ae700ca2867f04de5698fd3285643e
Reviewed-on: https://chromium-review.googlesource.com/715179
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Eric Caruso <ejcaruso@chromium.org>

[modify] https://crrev.com/14399a2a23fd25b5e320df7521a778f2fe145347/device.h
[modify] https://crrev.com/14399a2a23fd25b5e320df7521a778f2fe145347/cellular/cellular.cc
[modify] https://crrev.com/14399a2a23fd25b5e320df7521a778f2fe145347/cellular/cellular.h
[modify] https://crrev.com/14399a2a23fd25b5e320df7521a778f2fe145347/cellular/cellular_unittest.cc

Comment 5 by dchan@chromium.org, Jan 22 2018

Status: archived (was: Fixed)

Comment 6 by dchan@chromium.org, Jan 23 2018

Status: Fixed (was: Archived)
Status: Verified (was: Fixed)

Sign in to add a comment