From: Alyssa Ross <hi@alyssa.is>
To: devel@spectrum-os.org
Cc: Michael Raskin <7c6f434c@mail.ru>
Subject: [PATCH crosvm] seccomp: allow getdents64 if getdents is allowed
Date: Fri, 5 Jun 2020 23:47:57 +0000 [thread overview]
Message-ID: <20200605234757.28848-1-hi@alyssa.is> (raw)
This fixes a crash where crosvm would crash if run on x86_64 with
--shared-dir when running ls in the shared directory. I suspect
whether getdents or getdents64 is used depends on the host libc, so
allow both of them. I suspect upstream's libc uses getdents, and
that's why they haven't fixed the problem.
---
This finally annoyed me enough that I decided to fix it.
Michael, I think you'd also run into this issue. Want to test the
fix?
seccomp/x86_64/9p_device.policy | 1 +
seccomp/x86_64/gpu_device.policy | 1 +
seccomp/x86_64/xhci.policy | 1 +
3 files changed, 3 insertions(+)
diff --git a/seccomp/x86_64/9p_device.policy b/seccomp/x86_64/9p_device.policy
index 114ea11..271d244 100644
--- a/seccomp/x86_64/9p_device.policy
+++ b/seccomp/x86_64/9p_device.policy
@@ -18,6 +18,7 @@ unlink: 1
rename: 1
pread64: 1
getdents: 1
+getdents64: 1
mkdir: 1
rmdir: 1
fsync: 1
diff --git a/seccomp/x86_64/gpu_device.policy b/seccomp/x86_64/gpu_device.policy
index 331fc49..99d2a8d 100644
--- a/seccomp/x86_64/gpu_device.policy
+++ b/seccomp/x86_64/gpu_device.policy
@@ -52,6 +52,7 @@ fstat: 1
# Used to set of size new memfd.
ftruncate: 1
getdents: 1
+getdents64: 1
geteuid: 1
getrandom: 1
getuid: 1
diff --git a/seccomp/x86_64/xhci.policy b/seccomp/x86_64/xhci.policy
index 4b4fc3d..3448ce2 100644
--- a/seccomp/x86_64/xhci.policy
+++ b/seccomp/x86_64/xhci.policy
@@ -38,4 +38,5 @@ ioctl: arg1 == 0xc0185500 || arg1 == 0x41045508 || arg1 == 0x8004550f || arg1 ==
fstat: 1
getrandom: 1
getdents: 1
+getdents64: 1
lseek: 1
--
2.26.2
reply other threads:[~2020-06-05 23:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20200605234757.28848-1-hi@alyssa.is \
--to=hi@alyssa.is \
--cc=7c6f434c@mail.ru \
--cc=devel@spectrum-os.org \
/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.
Code repositories for project(s) associated with this public inbox
https://spectrum-os.org/git/crosvm
https://spectrum-os.org/git/doc
https://spectrum-os.org/git/mktuntap
https://spectrum-os.org/git/nixpkgs
https://spectrum-os.org/git/spectrum
https://spectrum-os.org/git/ucspi-vsock
https://spectrum-os.org/git/www
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).