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

Issue 592084 link

Starred by 2 users

Issue metadata

Status: Verified
Owner: ----
Closed: Mar 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug

Blocking:
issue 347322



Sign in to add a comment

ext4 crypto: lstat within encypted directory structure returns -EIO

Project Member Reported by gwendal@chromium.org, Mar 4 2016

Issue description


After reboot, ls / stat within an encrypted directory:
/home/.shadow/d38294b75ec476b7cc3d861209913dd94d7d1bcf/mount fails:

ls -l  /home/.shadow/d38294b75ec476b7cc3d861209913dd94d7d1bcf/mount/                      
ls: cannot access /home/.shadow/d38294b75ec476b7cc3d861209913dd94d7d1bcf/mount/S6tDSmhROSkocriXjG4adC: Input/output error
total 4
d????????? ? ?    ?               ?            ? S6tDSmhROSkocriXjG4adC
drwxrwx--T 2 root daemon-store 4096 Mar  3 12:22 q0DkM3uEiuodE8gYCnmIZA

echo 1 > tracing_on; stat /home/.shadow/d38294b75ec476b7cc3d861209913dd94d7d1bcf/mount/S6tDSmhROSkocriXjG4adC ; echo 0 > tracing_on
stat: cannot stat '/home/.shadow/d38294b75ec476b7cc3d861209913dd94d7d1bcf/mount/S6tDSmhROSkocriXjG4adC': Input/output error

I include the function_graph trace and an added warn() output in d_spice_alias.

 
trace_stat2
1.8 MB View Download
screen-exchange
3.3 KB View Download
To reproduce, I copied the virual disk image at 
https://x20web.corp.google.com/~gwendal/no_crawl/chromiumos_qemu_image_crbug592084.bin
There is the test root key in that directory as well.

I ran the image with:

sudo mkfifo /tmp/kvm.monitor.out
sudo mkfifo /tmp/kvm.monitor.oin

sudo qemu-system-x86_64 -enable-kvm -m 2G -smp 4 -vga cirrus \
-pidfile /tmp/kvm.pid \
-chardev pipe,id=control_pipe,path=/tmp/kvm.monitor \
-serial file:/tmp/kvm.serial \
-mon chardev=control_pipe -daemonize -net nic,model=virtio -display none \
-net user,hostfwd=tcp:127.0.0.1:9222-:22 \
-drive file=~/Downloads/<image>,index=0,media=disk,cache=unsafe

And I ssh as "ssh root@localhost -p 9222 -o StrictHostKeyChecking=no"

Comment 2 by tytso@google.com, Mar 4 2016

So I've extracted out the state partition using the following mechanism:

losetup -o 4439670784 /dev/loop0 /tmp/chromiumos_qemu_image_crbug592084.bin 
e2image -r /dev/loop0 | xz -9 > /tmp/state.img.gz

This is an compressed image of just the metadata blocks (including directory blocks, but all of the data blocks have been replaced by zero's).  This makes the file system much easier to move around.

I can then reconsitute it by:

xzcat < state.img.xz | make-sparse /u1/sparse.img

where the sources to make-sparse can be found here: https://git.kernel.org/cgit/fs/ext2/e2fsprogs.git/plain/contrib/make-sparse.c

I than ran this under my kvm infrastructure: "kvm-xfstests --log shell" and got the following log file.

log.201603041659
3.9 KB Download

Comment 3 by tytso@google.com, Mar 4 2016

I've uploaded the extracted compressed e2image of the state file here (1362k to download):

http://www/~tytso/no_crawl/state-592084.img.xz
Blocking: 347322
Status: Fixed (was: Untriaged)
A fix in d_splice_alias() from upstream addresses the issue.
Project Member

Comment 5 by bugdroid1@chromium.org, Mar 19 2016

Labels: merge-merged-chromeos-3.18
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/ba5eb89fb613b33e93eb2debf60e3c119fa24fa7

commit ba5eb89fb613b33e93eb2debf60e3c119fa24fa7
Author: Al Viro <viro@zeniv.linux.org.uk>
Date: Mon Oct 13 02:16:02 2014

UPSTREAM: merge d_materialise_unique() into d_splice_alias()

BUG= chromium:347322 , chromium:592084 
TEST=With this patch lstat works after rebooting machine, before adding
the encryption key to the keyring.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
(cherry picked from commit b5ae6b15bd73e35b129408755a0804287a87e041)
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>

Change-Id: I59211316c4c4cd7da0fc05b94e906285a376286e
Reviewed-on: https://chromium-review.googlesource.com/333382
Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>

[modify] https://crrev.com/ba5eb89fb613b33e93eb2debf60e3c119fa24fa7/include/linux/dcache.h
[modify] https://crrev.com/ba5eb89fb613b33e93eb2debf60e3c119fa24fa7/fs/dcache.c

Project Member

Comment 6 by bugdroid1@chromium.org, Mar 19 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/db61030859248ba61632c09f712ca2c0b4b42e6d

commit db61030859248ba61632c09f712ca2c0b4b42e6d
Author: Al Viro <viro@zeniv.linux.org.uk>
Date: Sun Oct 12 22:46:26 2014

UPSTREAM: d_add_ci() should just accept a hashed exact match if it finds one

BUG= chromium:347322 , chromium:592084 
TEST=with next CL, checked that lstat works after rebooting machine,
before adding the encryption key to the keyring.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
(cherry picked from commit 427c77d4619657c483c49b28ca1813bb33e857b0)

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Change-Id: I759c39f8fa1be933c8867cae4787e5f535873d18
Reviewed-on: https://chromium-review.googlesource.com/333381
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>

[modify] https://crrev.com/db61030859248ba61632c09f712ca2c0b4b42e6d/fs/dcache.c

Project Member

Comment 7 by bugdroid1@chromium.org, Mar 21 2016

Labels: merge-merged-stabilize-smaug-7897.B-chromeos-3.18
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/c6c9923629ec8edfcd6b3b0cf7a680d2a2b13e86

commit c6c9923629ec8edfcd6b3b0cf7a680d2a2b13e86
Author: Al Viro <viro@zeniv.linux.org.uk>
Date: Sun Oct 12 22:46:26 2014

UPSTREAM: d_add_ci() should just accept a hashed exact match if it finds one

BUG= chromium:347322 , chromium:592084 
TEST=with next CL, checked that lstat works after rebooting machine,
before adding the encryption key to the keyring.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
(cherry picked from commit 427c77d4619657c483c49b28ca1813bb33e857b0)

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Change-Id: I759c39f8fa1be933c8867cae4787e5f535873d18
Previous-Reviewed-on: https://chromium-review.googlesource.com/333381
(cherry picked from commit 59cb1e376284f29ff86f01f271bd4441929bda9a)
Reviewed-on: https://chromium-review.googlesource.com/334280

[modify] https://crrev.com/c6c9923629ec8edfcd6b3b0cf7a680d2a2b13e86/fs/dcache.c

Project Member

Comment 8 by bugdroid1@chromium.org, Mar 21 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/57dbc4373a1be0b06790651175fded3710b2506d

commit 57dbc4373a1be0b06790651175fded3710b2506d
Author: Al Viro <viro@zeniv.linux.org.uk>
Date: Mon Oct 13 02:16:02 2014

UPSTREAM: merge d_materialise_unique() into d_splice_alias()

BUG= chromium:347322 , chromium:592084 
TEST=With this patch lstat works after rebooting machine, before adding
the encryption key to the keyring.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
(cherry picked from commit b5ae6b15bd73e35b129408755a0804287a87e041)
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>

Change-Id: I59211316c4c4cd7da0fc05b94e906285a376286e
Previous-Reviewed-on: https://chromium-review.googlesource.com/333382
(cherry picked from commit 3a6ad7775f87e843edcfeb862b034f993a4ab72a)
Reviewed-on: https://chromium-review.googlesource.com/334290
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Commit-Queue: Gwendal Grignou <gwendal@chromium.org>

[modify] https://crrev.com/57dbc4373a1be0b06790651175fded3710b2506d/include/linux/dcache.h
[modify] https://crrev.com/57dbc4373a1be0b06790651175fded3710b2506d/fs/dcache.c

Labels: VerifyIn-51
Status: Verified (was: Fixed)

Sign in to add a comment