New issue
Advanced search Search tips

Issue 879003 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 3
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Clearing GCache doesn't work on ext4-encrypted profiles

Project Member Reported by dats@chromium.org, Aug 30

Issue description

Clearing pinned files in GCache/v1 relies on both "no dump" attribute and string extended attributes. This used to work with ecryptfs, but ChromeOS-patched version of ext4 encryption allows to obtain those attributes only on directories, not on files. So cryptohome is unable to check whether file is actually removable, as a result only GCache/v1/tmp is removed, but not GCache/v1/files or anything else.
 
Labels: CrOSFilesFeature-DriveSync
Labels: CrOSFilesFeature-LowStorage
2018-08-30T14:33:40.736082+10:00 WARNING cryptohomed[1238]: Deleting Cache /home/.shadow/65c29647362e83129c1cbbfd673071f5f31214a0/mount/user/Cache
2018-08-30T14:33:40.746957+10:00 WARNING cryptohomed[1238]: Deleting GCache /home/.shadow/65c29647362e83129c1cbbfd673071f5f31214a0/mount/user/GCache/v1/DSAiI3LPLALMS9meNdyrwA
2018-08-30T14:33:40.752418+10:00 WARNING cryptohomed[1238]: Cleaning removable files in /home/.shadow/65c29647362e83129c1cbbfd673071f5f31214a0/mount/user/GCache/v1
2018-08-30T14:33:40.758231+10:00 WARNING cryptohomed[1238]: Cleaning removable files in /home/.shadow/65c29647362e83129c1cbbfd673071f5f31214a0/mount/user/GCache/v2
2018-08-30T14:33:40.760427+10:00 ERR cryptohomed[1238]: open: /home/.shadow/65c29647362e83129c1cbbfd673071f5f31214a0/mount/user/GCache/v2/Downloads/VjreTvlP4n3gn6tIz9QTYC: Required key not available
2018-08-30T14:33:40.760701+10:00 ERR cryptohomed[1238]: open: /home/.shadow/65c29647362e83129c1cbbfd673071f5f31214a0/mount/user/GCache/v2/Downloads/0VbpZCfUKgPxxTxmBkdlxA: Required key not available
2018-08-30T14:33:40.760857+10:00 ERR cryptohomed[1238]: open: /home/.shadow/65c29647362e83129c1cbbfd673071f5f31214a0/mount/user/GCache/v2/Downloads/8erUt8ZHfjgn,cDzFh9oAA: Required key not available
2018-08-30T14:33:40.761222+10:00 ERR cryptohomed[1238]: open: /home/.shadow/65c29647362e83129c1cbbfd673071f5f31214a0/mount/user/GCache/v2/Downloads/PbvuVrfkFlsm9+DocTbGgC/jK8YZVoINC,F9YTFDJio3B: Required key not available
...
2018-08-30T14:33:40.779771+10:00 INFO cryptohomed[1238]: Freeing disk space by deleting user /home/.shadow/65c29647362e83129c1cbbfd673071f5f31214a0


Apparently we should rely on setfattr instead which is available even if the key is unloaded:

localhost ~ # lsattr /home/.shadow/65c29647362e83129c1cbbfd673071f5f31214a0/mount/user/GCache/v2/Downloads/PbvuVrfkFlsm9+DocTbGgC/
lsattr: Required key not available While reading flags on /home/.shadow/65c29647362e83129c1cbbfd673071f5f31214a0/mount/user/GCache/v2/Downloads/PbvuVrfkFlsm9+DocTbGgC/jK8YZVoINC,F9YTFDJio3B
lsattr: Required key not available While reading flags on /home/.shadow/65c29647362e83129c1cbbfd673071f5f31214a0/mount/user/GCache/v2/Downloads/PbvuVrfkFlsm9+DocTbGgC/On7MG9OuZfz7YW3u638H,C
localhost ~ # getfattr -d  /home/.shadow/65c29647362e83129c1cbbfd673071f5f31214a0/mount/user/GCache/v2/Downloads/*
getfattr: Removing leading '/' from absolute path names
# file: home/.shadow/65c29647362e83129c1cbbfd673071f5f31214a0/mount/user/GCache/v2/Downloads/U4EXZ3Fu85hzGlJc4DD3uB
user.foo="bar"

# file: home/.shadow/65c29647362e83129c1cbbfd673071f5f31214a0/mount/user/GCache/v2/Downloads/VjreTvlP4n3gn6tIz9QTYC
user.foo="bar"


Project Member

Comment 3 by bugdroid1@chromium.org, Aug 31

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

commit e5a99eb66dd8654f086b0e6c4507fcf6800851c7
Author: Sergei Datsenko <dats@chromium.org>
Date: Fri Aug 31 06:30:39 2018

Mark removable gcache files with file attributes

ext4 encryption on ChromeOS doesn't allow access to inode attributes for files
in encrypted dir, so we need to indicate files that are ok to remove on low disk
space with extended attributes too.

BUG= chromium:879003 

Change-Id: Ibf917ac255c93ea4e971b2a622b51e452257a4c7
Reviewed-on: https://chromium-review.googlesource.com/1196288
Reviewed-by: Stuart Langley <slangley@chromium.org>
Reviewed-by: Sam McNally <sammc@chromium.org>
Commit-Queue: Sergei Datsenko <dats@chromium.org>
Cr-Commit-Position: refs/heads/master@{#587958}
[modify] https://crrev.com/e5a99eb66dd8654f086b0e6c4507fcf6800851c7/components/drive/chromeos/file_cache.cc
[modify] https://crrev.com/e5a99eb66dd8654f086b0e6c4507fcf6800851c7/components/drive/chromeos/file_cache.h
[modify] https://crrev.com/e5a99eb66dd8654f086b0e6c4507fcf6800851c7/components/drive/chromeos/file_cache_unittest.cc

Status: Fixed (was: Assigned)

Sign in to add a comment