From: Mark Salyzyn <salyzyn@android.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: kernel-team@android.com, Miklos Szeredi <miklos@szeredi.hu>,
Vivek Goyal <vgoyal@redhat.com>,
overlayfs <linux-unionfs@vger.kernel.org>
Subject: Re: [PATCH v10 5/5] overlayfs: override_creds=off option bypass creator_cred
Date: Thu, 25 Jul 2019 09:42:37 -0700 [thread overview]
Message-ID: <82a94a36-773d-3925-7937-e3a4a7129b8b@android.com> (raw)
In-Reply-To: <CAOQ4uxhLQGpG0=K46hAgPFgQ3KrDipUCqNs_=L6xNwG-dS_jtw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3233 bytes --]
On 7/25/19 9:12 AM, Amir Goldstein wrote:
> [reduce CC list]
>
>>> I am fine with this patch, but would like to request that you add @sb arg
>>> to the ovl_revert_creds() helper, so it is more useful for other things in the
>>> future that scope the underlying layers access (like shutdown).
>> Will respin and retest.
>>
> Apropos testing, I wanted to bring up this issue.
> I noticed that the test coverage I have for unprivileged user access to
> overlayfs is lacking.
>
> xfstests has several generic tests that use _runas and run on overlayfs,
> but that's only for pure upper files.
>
> unionmount-testsuite is always run as root, because it needs to
> mount/umount/etc.
> I am working on a new mode ./run --ov --runas=1
> to seteuid(1);setegid(1) before every test (after set_up and mount)
> That's fine for basic UNIX permission and capability checks, but does not cover
> more complex setups like with sepolicy.
>
> I was thinking maybe to execute "./run --ov --set-up" with mounter process
> credentials (e.g. initd) and then add a new mode "./run --ov --no-set-up"
> which uses the mount prepared by the mounter and runs the tests.
>
> I wanted to get feedback on the ideas above if they are useful for
> your use cases? Is that enough or is there more functionality required
> to cover more use cases?
>
> Thanks,
> Amir.
I had already filed an internal bug to find a solution for this because
I did not have a full answer to this vacuum in testing. Everything I do
is cumbersome, manual or instrumented w.r.t. overlayfs with a poor
velocity because solution is checked on all android kernel releases; and
relies on a functional device (can be run under emulator) to smoke test
the integrated result (where we do have some automation).
These new problems that added extra patches to this series were only
uncovered over the last two months of investigation and root cause on
4.14 and (very recently) 4.19 devices and have not discovered any
automation (well, two simple tests is not enough) that pleases me.
We have no problem running functionality or security tests on
"userdebug" (near identical to "user" builds that go to the planet) that
is in effect rooted (su root <command>) and may have a limited few extra
test or engineering excecutables, with a policy to upload them to
/data/nativetest/ otherwise. Our standard POSIX tools are delivered from
toybox, so keep that in mind.
I had looked at https://github.com/SELinuxProject/selinux-testsuite, but
it could not easily be Android'ified because of reliance for on-target
for Bash, Perl and Python. But I am sure there are many tests scenarios
there that could be 'translated'.
An Android'ified test that would test sepolicy would probably leverage
our existing policy
(https://android.git.corp.google.com/platform/system/sepolicy/+/HEAD/
<https://www.google.com/url?q=https://www.google.com/url?q%3Dhttps://android.git.corp.google.com/platform/system/core/%252B/HEAD/fs_mgr/README.overlayfs.md%2523%26sa%3DD%26ust%3D1564076098999000%26usg%3DAFQjCNGi5PJ_zn-Jm_Qykb3PfLbNfEgZwA&source=gmail&ust=1564158899354000&usg=AFQjCNHVYoSdS1JcqtSpiVENiNKx-w_2cQ>)
and free rein in /data/local/tmp/ to play mounting games.
Sincerely -- Mark Salyzyn
[-- Attachment #2: Type: text/html, Size: 5866 bytes --]
prev parent reply other threads:[~2019-07-25 16:42 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-24 19:57 [PATCH v10 0/2] overlayfs override_creds=off Mark Salyzyn
2019-07-24 19:57 ` [PATCH v10 1/5] overlayfs: check CAP_DAC_READ_SEARCH before issuing exportfs_decode_fh Mark Salyzyn
2019-07-24 19:57 ` [PATCH v10 2/5] Add optional __get xattr method paired to __vfs_getxattr Mark Salyzyn
2019-07-24 19:57 ` [PATCH v10 3/5] overlayfs: add __get xattr method Mark Salyzyn
2019-07-25 5:48 ` Amir Goldstein
2019-07-25 15:03 ` Mark Salyzyn
2019-07-25 15:43 ` Amir Goldstein
2019-07-25 16:22 ` Mark Salyzyn
2019-07-26 5:04 ` Amir Goldstein
2019-07-26 18:30 ` Mark Salyzyn
2019-07-30 15:55 ` Stephen Smalley
2019-07-30 16:54 ` Mark Salyzyn
2019-07-24 19:57 ` [PATCH v10 4/5] overlayfs: internal getxattr operations without sepolicy checking Mark Salyzyn
2019-07-25 11:00 ` Amir Goldstein
2019-07-25 14:37 ` Mark Salyzyn
2019-07-25 15:51 ` Amir Goldstein
2019-07-24 19:57 ` [PATCH v10 5/5] overlayfs: override_creds=off option bypass creator_cred Mark Salyzyn
2019-07-25 6:14 ` Amir Goldstein
2019-07-25 14:38 ` Mark Salyzyn
2019-07-25 16:12 ` Amir Goldstein
2019-07-25 16:42 ` Mark Salyzyn [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=82a94a36-773d-3925-7937-e3a4a7129b8b@android.com \
--to=salyzyn@android.com \
--cc=amir73il@gmail.com \
--cc=kernel-team@android.com \
--cc=linux-unionfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=vgoyal@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox