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

Issue 753478 link

Starred by 1 user

Issue metadata

Status: Archived
Owner:
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

ModemManager doesn't always report remaining attempts for PIN1

Project Member Reported by benchan@chromium.org, Aug 8 2017

Issue description

This issue is mostly due to a limitation in the MBIM 1.0 spec. A MBIM modem may support multiple types of PIN (PIN1, PIN2, etc). However, the MBIM_CID_PIN query operation doesn't allow specifying which PIN type to query about. The MBIM spec only requires that the modem should report PIN1 in favor of other PIN types if PIN1 is currently enabled.

If PIN1 is currently disabled, the modem may report info about PIN2 in the response to a MBIM_CID_PIN query. Only after a MBIM_CID_PIN set operation on PIN1 (e.g. to enable PIN1), we can deduce the remaining attempts for PIN1. If the MBIM_CID_PIN set operation succeeds, the reported remaining attempts would be the total number of attempts allowed for PIN1. If the MBIM_CID_PIN set operation fails, the reported remaining attempts would be a smaller value. A subsequent MBIM_CID_PIN query may report info about PIN2 again.

That aforementioned behavior leads to an issue in how ModemManager reports the remaining attempts (or "unlock retries" in ModemManager code) for PIN1. If PIN1 is initially disabled, ModemManager may not know the current remaining attempts for PIN1. After ModemManager tries to enable PIN1, it receives the updated remaining attempts for PIN1, but currently doesn't use that information. Instead, ModemManager tries to issue a MBIM_CID_PIN query to obtain the remaining attempts for PIN1, but the modem may report the remaining attempts for PIN2 (or other PIN type) instead of PIN1. That means we may not always determine the remaining attempts for PIN1 through ModemManager.
 
Status: Started (was: Untriaged)
Project Member

Comment 3 by bugdroid1@chromium.org, Aug 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/modemmanager-next/+/21108a0b64e3792c205eb2cf026b543e28a0bd7c

commit 21108a0b64e3792c205eb2cf026b543e28a0bd7c
Author: Ben Chan <benchan@chromium.org>
Date: Wed Aug 23 02:05:03 2017

FROMLIST: iface-modem: add mm_iface_modem_get_unlock_retries helper

This patch adds a mm_iface_modem_get_unlock_retries helper for getting
the current MMUnlockRetries value of a MMIfaceModem object, which later
allows us to partially update (e.g. a specific MMModemLock) the
MMUnlockRetries value of a MMIfaceModem object.

See https://lists.freedesktop.org/archives/modemmanager-devel/2017-August/005547.html

BUG= chromium:753478 
TEST=`FEATURES=test emerge-$BOARD modemmanager-next`

Change-Id: I7e32be86eec6904c80e20a48f723978c54736a42
Reviewed-on: https://chromium-review.googlesource.com/625458
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/21108a0b64e3792c205eb2cf026b543e28a0bd7c/src/mm-iface-modem.h
[modify] https://crrev.com/21108a0b64e3792c205eb2cf026b543e28a0bd7c/src/mm-iface-modem.c

Project Member

Comment 4 by bugdroid1@chromium.org, Aug 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/modemmanager-next/+/aada1c23d0e387bafddfc656d323b0d0cab20dfa

commit aada1c23d0e387bafddfc656d323b0d0cab20dfa
Author: Ben Chan <benchan@chromium.org>
Date: Wed Aug 23 02:05:03 2017

FROMLIST: iface-modem: export update_unlock_retries outside MMIfaceModem

This patch exports the internal function update_unlock_retries() in
MMIfaceModem as mm_iface_modem_update_unlock_retries(), which later
allows us to call it from other classes.

See https://lists.freedesktop.org/archives/modemmanager-devel/2017-August/005547.html

BUG= chromium:753478 
TEST=`FEATURES=test emerge-$BOARD modemmanager-next`

Change-Id: Icc1a40997964a3f189e0a482f27211ba8bc234e6
Reviewed-on: https://chromium-review.googlesource.com/625459
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/aada1c23d0e387bafddfc656d323b0d0cab20dfa/src/mm-iface-modem.h
[modify] https://crrev.com/aada1c23d0e387bafddfc656d323b0d0cab20dfa/src/mm-iface-modem.c

Project Member

Comment 5 by bugdroid1@chromium.org, Aug 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/modemmanager-next/+/7a0639c7b7a048f545cea23107409791a527d5dd

commit 7a0639c7b7a048f545cea23107409791a527d5dd
Author: Ben Chan <benchan@chromium.org>
Date: Wed Aug 23 02:05:04 2017

FROMLIST: sim-mbim: update unlock retries information after PIN operations

After MMSimMbim performs a MBIM_CID_PIN set operation, it calls
mm_iface_modem_update_lock_info() (through its base class MMBaseSim) to
refresh the unlock retries information, which results in a MBIM_CID_PIN
query. However, a MBIM_CID_PIN query reports only the information of one
PIN type and the PIN type can't be specified, we need to deduce the
number of retries left for a specific PIN type from the response of a
MBIM_CID_PIN set operation for that PIN type. To allow that, this patch
modifies MMSimMbim to update the unlock retries information after a PIN
operation based on the response to the MBIM_CID_PIN set operation.

See https://lists.freedesktop.org/archives/modemmanager-devel/2017-August/005547.html

BUG= chromium:753478 
TEST=`FEATURES=test emerge-$BOARD modemmanager-next`

Change-Id: I96f073e3c0bc28942fbaa836af9e891c052c0108
Reviewed-on: https://chromium-review.googlesource.com/625460
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/7a0639c7b7a048f545cea23107409791a527d5dd/src/mm-sim-mbim.c

Project Member

Comment 6 by bugdroid1@chromium.org, Aug 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/modemmanager-next/+/86ea97f7a88da3fdbdca94175723d10a32c6b90a

commit 86ea97f7a88da3fdbdca94175723d10a32c6b90a
Author: Ben Chan <benchan@chromium.org>
Date: Wed Aug 23 02:05:04 2017

FROMLIST: broadband-modem-mbim: preserve unlock retries for PIN1 when appropriate

If PIN1 is disabled and we have tried to enable it with a wrong PIN, a
MBIM modem would have indicated the number of remaining attempts for
PIN1 (unless PUK1 is engaged) in the response to the failed MBIM_CID_PIN
set operation.

However, a MBIM_CID_PIN query may be issued (e.g.  MMBaseSim calls
mm_iface_modem_update_lock_info()) after the MBIM_CID_PIN set operation
to query the number of remaining attempts for a PIN type. Unfortunately,
we can't specify a particular PIN type in a MBIM_CID_PIN query. The
modem may not reply with information about PIN1 if PIN1 is disabled.
When that happens, we would like to preserve our knowledge about the
number of remaining attempts for PIN1.

This patch modifies MMBroadbandModemMbim's load_unlock_retries()
operation to carry over any existing information on PIN1
from MMIfaceModem's MMUnlockRetries if the MBIM_CID_PIN query reports
something other than PIN1.

See https://lists.freedesktop.org/archives/modemmanager-devel/2017-August/005547.html

BUG= chromium:753478 
TEST=Tested the following on a Chromebook with a MBIM modem:
- Enable SIM locking via the Chrome OS settings UI.
- When the UI prompts for a PIN, Enter a wrong PIN.
- Verify that the UI reports an error and shows the correct number of
  retries left for entering the PIN.
- Enter a wrong PIN again.
- Verify that the UI reports an error and shows the correct number of
  retries left for entering the PIN.

Change-Id: Ie2def5c9b8ddff976be5c1c8e087f8a181de4bf0
Reviewed-on: https://chromium-review.googlesource.com/625461
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/86ea97f7a88da3fdbdca94175723d10a32c6b90a/src/mm-broadband-modem-mbim.c

Status: Fixed (was: Started)

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

Status: Archived (was: Fixed)

Sign in to add a comment