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

Issue 893451 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

RLZ permanently disabled when Guest mode entered directly after OOBE

Project Member Reported by stephenlin@chromium.org, Oct 9

Issue description

CrOS version: 10895.56.0 (probably earlier versions as well)

What steps will reproduce the problem?
(1) Recovery/powerwash device. Put device in dev mode.
(2) Go through OOBE.
(3) Enter Guest mode before any regular login.
(4) Look at /home/chronos/Local State for rlz > brand value.

What is the expected result?

The expected brand code for the device. For instance, on vayne it should be NPEC.

What happens instead?

empty string

This appears to affect any device where the brand code has been moved from the RO_VPD to mosys as a result of  crbug.com/731016  (July 2017). The bug reproduces on vayne and sona. Everything works fine on eve, cave, and maple (hana).

This bug permanently disables RLZ because an empty brand code is persisted in Local State and any subsequent user logins will retrieve this brand code which disables the RLZ system.

To fix this bug we should make the brand code available in Guest mode somehow. Anyone on CC have thoughts on how to do this?

We should also prevent an empty brand code from being written to Local State. This fixes the issue of permanently disabling RLZ if Guest mode is entered right after OOBE and before a regular login. It does not address making the brand code available to Guest mode. Assigning to wzang@ for this relatively easy part. Ideally, this simple fix is merged back to M70 (though it is already branched with Stable being cut soon).

 
From Colin:

|rlz_brand_code| may be read either from machine_info_path (the actual path is /tmp/machine-info) or vpd_path (the actual path is /mnt/stateful_partition/unencrypted/cache/vpd/filtered.txt). The parsing is done when you see the login screen.

If you log in a regular user, then everything works fine. But if you start guest session, Chrome has to restart, which means statistic_provider will need to parse the info again in the new process. However, /tmp/machine-info is intentionally deleted after user logs in, so the |rlz_brand_code| value within a guest session always comes from |vpd_path|.

However, |vpd_path| may not always contain |rlz_brand_code|, and it may be board-specific and dependent on the specific image. I suspect it's related to the work in  crbug.com/731016 . hungte@ should have more info on this.

Finally, when you launch guest session before completing OOBE, it first reports "not found" from statistic_provider (because machine_info_path is deleted and vpd_path doesn't contain the field). And then it tries to read the brand from the file, which doesn't exist either. But it does not check the string is empty in SetBrand, so an empty value is stored in local state, and the brand code will be empty forever.
Similar to "/mnt/stateful_partition/unencrypted/cache/vpd/filtered.txt", can we create a "/tmp/machine-info-filtered" which contains data that doesn't have privacy concern?
Thiemo, I'll assume the reason that machine-info is not available in Guest mode is somehow related to Privacy and the expectations of users in this mode. Prior to  crbug.com/731016 , rlz_brand_code was put into the VPD and thus available in Guest mode via filtered.txt which is why devices like eve work. Can I assume there would be no privacy concern to restore this functionality?

> hungte@ should have more info on this.

We've intentionally removed RLZ from VPD, since we've realized it's really something should be decided by SKU or HW identifiers, not what VPD should provide.

So all projects since then won't have RLZ in VPD.

Understood. I'm not suggesting we move back to VPD. Just that the brand code should always be available in Guest mode regardless of where the brand code is located. Brand code is currently read through StatisticsProvider.
Afaiu, the reason for deleting machine-info is that it contains the serial number that we would not like to expose.

I don't particularly like the fact that we make use of RLZ in guest mode, but it's the status quo and until we have decided to change it we should maintain it. In that spirit I'm fine with exposing the brand code in guest mode.
Labels: -M-71 M-70
Project Member

Comment 8 by bugdroid1@chromium.org, Oct 9

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

commit 5f5b2b565747cc268a6279698158caef5f210556
Author: Wenzhao Zang <wzang@chromium.org>
Date: Tue Oct 09 19:05:55 2018

cros: Do not store empty brand code to local state

SetBrand() should check if the brand is empty before storing it to
local state. Otherwise, an empty string will permanently disable RLZ
(see bug). When the brand is empty, do not run the callback.

Bug:  893451 
Change-Id: I7b23b50aa9cd395cc4c79fac3c78a96caa335ced
Reviewed-on: https://chromium-review.googlesource.com/c/1271575
Commit-Queue: Wenzhao (Colin) Zang <wzang@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#598023}
[modify] https://crrev.com/5f5b2b565747cc268a6279698158caef5f210556/chrome/browser/google/google_brand_chromeos.cc
[modify] https://crrev.com/5f5b2b565747cc268a6279698158caef5f210556/chrome/browser/google/google_brand_chromeos.h

Labels: Merge-Request-70
Status: Fixed (was: Untriaged)
Project Member

Comment 10 by sheriffbot@chromium.org, Oct 9

Labels: -Merge-Request-70 Merge-Review-70 Hotlist-Merge-Review
This bug requires manual review: We are only 6 days from stable.
Please contact the milestone owner if you have questions.
Owners: benmason@(Android), kariahda@(iOS), geohsu@(ChromeOS), abdulsyed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Please mark OS.
Labels: OS-Chrome
M70 is nearing Stable. Please provide justification on why this needs to make M70 instead of M71? Also how well has this change been tested? Thanks.
Labels: -M-70 -Merge-Review-70 M-71
No need to merge to M71 per offline chat with stephenlin@. Thanks.
Sorry, *M70
in general we need to stop using /tmp as an IPC mechanism.  programs need to get the content from the relevant storage directly instead.
Labels: -Hotlist-Merge-Review
Re-opening and re-assigning to Roger to make changes to fix any Chromebook clients that have permanently disabled RLZ by storing an empty brandcode.

Roger, in discussions with Colin we should check not just if Local State has prefs::kRLZBrand here:

https://codesearch.chromium.org/chromium/src/chrome/browser/chromeos/login/session/user_session_manager.cc?rcl=1aad28fdfd83d1241de2ee0dd24ca10659d9c9d6&l=683

But, also if the value is empty. If the value is empty, then proceed to call InitRlz again. This will fix any existing clients where brand in Local State is empty.


Cc: wzang@chromium.org
Owner: rogerta@chromium.org
Status: Assigned (was: Fixed)
Components: Internals>Metrics>RLZ
Project Member

Comment 20 by bugdroid1@chromium.org, Oct 15

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

commit 5d80e3087f51f96491f2a53df786447aa6458287
Author: Roger Tawa <rogerta@chromium.org>
Date: Mon Oct 15 15:48:25 2018

Don't clear brand for regular cros sessions.

If the brand code persisted in local prefs is empty, reinitialize to correct.

Bug: 846033,  893451 
Change-Id: I49cc299374d8530d3a46aee93cb7cb2518ff1dee
Reviewed-on: https://chromium-review.googlesource.com/c/1272447
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Reviewed-by: Wenzhao (Colin) Zang <wzang@chromium.org>
Commit-Queue: Roger Tawa <rogerta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599645}
[modify] https://crrev.com/5d80e3087f51f96491f2a53df786447aa6458287/chrome/browser/chromeos/login/session/chrome_session_manager_browsertest.cc
[modify] https://crrev.com/5d80e3087f51f96491f2a53df786447aa6458287/chrome/browser/chromeos/login/session/user_session_manager.cc

Labels: Merge-Request-70
Merge request. This CL is critical to the functionality of this feature.
Project Member

Comment 22 by sheriffbot@chromium.org, Oct 15

Labels: -Merge-Request-70 Merge-Review-70 Hotlist-Merge-Review
This bug requires manual review: We are only 0 days from stable.
Please contact the milestone owner if you have questions.
Owners: benmason@(Android), kariahda@(iOS), geohsu@(ChromeOS), abdulsyed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Merge-Review-70 Merge-Request-71O
Oops, I meant merge request to 71.
Labels: -Merge-Request-71O Merge-Request-71
Project Member

Comment 25 by sheriffbot@chromium.org, Oct 16

Labels: -Merge-Request-71 Hotlist-Merge-Approved Merge-Approved-71
Your change meets the bar and is auto-approved for M71. Please go ahead and merge the CL to branch 3578 manually. Please contact milestone owner if you have questions.
Owners: benmason@(Android), kariahda@(iOS), kbleicher@(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 26 by bugdroid1@chromium.org, Oct 16

Labels: -merge-approved-71 merge-merged-3578
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/983503bf5d75abcb153fb6ca438ed4840ab2a782

commit 983503bf5d75abcb153fb6ca438ed4840ab2a782
Author: Roger Tawa <rogerta@chromium.org>
Date: Tue Oct 16 20:40:39 2018

Don't clear brand for regular cros sessions.

If the brand code persisted in local prefs is empty, reinitialize to correct.

Bug: 846033,  893451 
Change-Id: I49cc299374d8530d3a46aee93cb7cb2518ff1dee
Reviewed-on: https://chromium-review.googlesource.com/c/1272447
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Reviewed-by: Wenzhao (Colin) Zang <wzang@chromium.org>
Commit-Queue: Roger Tawa <rogerta@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#599645}(cherry picked from commit 5d80e3087f51f96491f2a53df786447aa6458287)
Reviewed-on: https://chromium-review.googlesource.com/c/1284532
Reviewed-by: Roger Tawa <rogerta@chromium.org>
Cr-Commit-Position: refs/branch-heads/3578@{#62}
Cr-Branched-From: 4226ddf99103e493d7afb23a4c7902ee496108b6-refs/heads/master@{#599034}
[modify] https://crrev.com/983503bf5d75abcb153fb6ca438ed4840ab2a782/chrome/browser/chromeos/login/session/chrome_session_manager_browsertest.cc
[modify] https://crrev.com/983503bf5d75abcb153fb6ca438ed4840ab2a782/chrome/browser/chromeos/login/session/user_session_manager.cc

Status: Verified (was: Assigned)
Confirmed fixed in M71 11151.5.0.
Labels: Merge-Merged-71-3578
The following revision refers to this bug: 
https://chromium.googlesource.com/chromium/src.git/+/983503bf5d75abcb153fb6ca438ed4840ab2a782

Commit: 983503bf5d75abcb153fb6ca438ed4840ab2a782
Author: rogerta@chromium.org
Commiter: rogerta@chromium.org
Date: 2018-10-16 20:40:39 +0000 UTC

Don't clear brand for regular cros sessions.

If the brand code persisted in local prefs is empty, reinitialize to correct.

Bug: 846033,  893451 
Change-Id: I49cc299374d8530d3a46aee93cb7cb2518ff1dee
Reviewed-on: https://chromium-review.googlesource.com/c/1272447
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Reviewed-by: Wenzhao (Colin) Zang <wzang@chromium.org>
Commit-Queue: Roger Tawa <rogerta@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#599645}(cherry picked from commit 5d80e3087f51f96491f2a53df786447aa6458287)
Reviewed-on: https://chromium-review.googlesource.com/c/1284532
Reviewed-by: Roger Tawa <rogerta@chromium.org>
Cr-Commit-Position: refs/branch-heads/3578@{#62}
Cr-Branched-From: 4226ddf99103e493d7afb23a4c7902ee496108b6-refs/heads/master@{#599034}

Sign in to add a comment