Commit graph

11 commits

Author SHA1 Message Date
Lepton Wu
fbb368a9f7 seccomp: Allow statx for video device on arm
I guess this was caused by libc uprev so the actual used
system call changed.

BUG=b:206348631
TEST=manual - Run arc.Boot.vm on kukui-arc-r with updated policy

Change-Id: Ibb8702d9ec6844624c9779088aefcdad34322d80
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3290581
Auto-Submit: Lepton Wu <lepton@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2021-11-18 08:50:57 +00:00
Jorge E. Moreira
e40fb21c0d Allow sched_yield in all devices' seccomp policy
The sched_yield system call is somehow called by the code the rust
compiler generates and not directly by the author's implementation. That
along with the fact that it won't get called on every run makes it very
easy to miss when adding a new device (that happened with virtio-snd).
Since that call is quite harmless (it could be argued minijail shouldn't
even block it in the first place) it makes sense to allow it for all
devices.

BUG=b/201306350

Change-Id: I9895da6c8060ae83053474ed9e4472ea2cd8d3e3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3248126
Auto-Submit: Jorge Moreira Broche <jemoreira@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Jorge Moreira Broche <jemoreira@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2021-10-28 19:10:45 +00:00
Jordan R Abrahams
b785cf2bae seccomp: Mass fstatfs change for glibc for Arm
On trogdor devices, fstatfs64 is not used. Instead, 32bit
fstatfs is used. We need to add both to all 32bit Arm
policy files which were originally determined to be
problematic.

This adds fstsatfs to all 32bit Arm policy files which
were modified for the original glibc security change.

Additionally, this commit sorts the syscalls lexicographically
if the policy file was already sorted.

BUG=chromium:1182687
TEST=CQ of http://crrev.com/c/2910526

Change-Id: I42eb12456625d400ee3422af08d56d648e3f9075
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3066144
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Jordan R Abrahams <ajordanr@google.com>
2021-08-03 08:08:58 +00:00
Jordan R Abrahams
e3c53096d7 seccomp: Update seccomp filters for glibc
At present, libraries which use glibc to dynamically load
shared libraries do not have fstafs in their seccomp policies.
A change in glibc will force all systems which load shared
libraries to call the fstatfs or fstatfs64 syscall.

Without the call, crosvm will not start when running
crostini/android tests.

BUG=chromium:1182687
TEST=CQ of https://crrev.com/c/2910526

Change-Id: I10abb8866474c2fe0398a17a80069cf2b0629493
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3011355
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Jordan R Abrahams <ajordanr@google.com>
2021-07-22 17:08:20 +00:00
hscham
a7fd914538 crosvm: add memfd_create to seccomp policy files
To enable SupportsChannelUpgrade in libchrome (upstream r850346,
crrev.com/c/2670092).

BUG=b:189403036
TEST=tast run $hatch-DUT
         arc.Notification.vm
         arc.CheckAndroidVersion.vm
         arc.RemovableMedia.vm
         arc.Gamepad.vm
         arc.IMEBlockingVK.vm
         security.SELinuxFilesDataDir.vm
         arc.StartStop.vm
         arc.CPUSet.vm
         arc.Optin.vm
         arc.IntentForward.vm
         arc.MIDIClient.vm
         arc.IMESwitchShortcut.vm
         arc.ChromeCrash.vm_logged_in
         arc.Boot.vm
         arc.BuildProperties.vm
         arc.ConciergeCrash
         arc.VMPstoreDump
         security.SELinuxProcessesARC.vm
         security.NetworkListenersARC.vm
     with disable patch removed in libchrome

Change-Id: I1a924c60ebe9707627fdd064b2233a7452d5cc57
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2984719
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-by: Qijiang Fan <fqj@google.com>
Commit-Queue: Grace Cham <hscham@chromium.org>
2021-06-28 04:40:43 +00:00
Jorge E. Moreira
c8cff01c36 Specify prctl's policy only once per device
The libminijail version in AOSP complains when there are multiple entries for
the same system call, which was the case for virtio-fs's policy.

BUG=b/185811304

Change-Id: I389c07c86e7d79f16e4f47a893abad598033352a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2837307
Commit-Queue: Jorge Moreira Broche <jemoreira@google.com>
Tested-by: Jorge Moreira Broche <jemoreira@google.com>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
2021-04-20 22:50:20 +00:00
Chirantan Ekbote
a00991cd84 Replace dup with fcntl(F_DUPFD_CLOEXEC)
Fds created via dup don't share file descriptor flags with the original
fd, which means that they don't have the FD_CLOEXEC flag set.  Use
fcntl(F_DUPFD_CLOEXEC) so that this flag gets set for the duplicated fds
as well.

BUG=none
TEST=unit tests

Change-Id: Ib471cf40acac1eacf72969ba45247f50b349ed58
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2809687
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2021-04-15 10:34:04 +00:00
Manoj Gupta
d4d0b5ccf3 crosvm: add more time syscalls to policies
glibc 2.32 is using clock_gettime/64 on some arm boards
when gettimeofday is used. In addition, support 64-bit
variants of the time syscalls for use with glibc 2.32.

BUG=chromium:1190305
TEST=crostini tests pass

Change-Id: I070eee92817d3f959ea385ff2c3adca610e0a574
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2776211
Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Auto-Submit: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2021-03-20 13:40:00 +00:00
Lepton Wu
e0598548aa seccomp: arm: Allow getrandom for video device.
libvda depends on libchrome and libchrome changed to use
getrandom since http://crrev.com/c/2380673

BUG=b:182223105
TEST=manual - Push updated policy file to kukui and run ARCVM.

Change-Id: I135121fc824ab07f114dd84e1a2a36fc9b8d5896
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2745819
Tested-by: Lepton Wu <lepton@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Lepton Wu <lepton@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2021-03-10 03:01:09 +00:00
Lepton Wu
436296b1f0 secomp: Allow sched_yield for video device.
libvda depends on libchrome and libchrome call sched_yield
in NeedsLazyInstance sometimes.

BUG=b:159855961
TEST=manual - keep running `android -c reboot` on hatch-arc-r

Change-Id: I39afb77541c6d129ff84a776644c5cb68687ec82
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2269339
Commit-Queue: Lepton Wu <lepton@chromium.org>
Commit-Queue: Chirantan Ekbote <chirantan@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Tested-by: Lepton Wu <lepton@chromium.org>
Auto-Submit: Lepton Wu <lepton@chromium.org>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
2020-06-26 11:35:33 +00:00
Alexandre Courbot
97d6359feb seccomp: add policy file video_device on ARM.
BUG=b:151399776
BUG=b:151394062
TEST=Video device is properly probed with policy enabled on a guest
kernel with VIRTIO_VIDEO enabled.

Change-Id: Ia29afa0ab3eb969291c046d8657cd28e88d54b96
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2230418
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
2020-06-11 01:56:42 +00:00