Commit 62ae450f authored by Xiaohan Wang's avatar Xiaohan Wang Committed by Commit Bot

media: Allow __NR_ftruncate in bpf CDM policy on Linux

The CDM needs to access files in PluginPrivateFileSystem to support
persistent-state and persistent-license. It opens the through CdmStorage
mojo service, which opens the file in the browser process, and pass the
file descriptor to the CDM running in the sandboxed CDM (utility)
process. Then the CDM needs to be able to read and write the file. To
complete the write, we need to call base::File::SetLength() which needs
to call ftruncate().

BUG=774762

Change-Id: I60d15bc4c308569128e6c0164d5c5d79bd5c9096
Reviewed-on: https://chromium-review.googlesource.com/720273
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509460}
parent 8c7026ba
...@@ -30,6 +30,7 @@ ResultExpr CdmProcessPolicy::EvaluateSyscall(int sysno) const { ...@@ -30,6 +30,7 @@ ResultExpr CdmProcessPolicy::EvaluateSyscall(int sysno) const {
// Allow the system calls below. // Allow the system calls below.
case __NR_fdatasync: case __NR_fdatasync:
case __NR_fsync: case __NR_fsync:
case __NR_ftruncate:
#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
defined(__aarch64__) defined(__aarch64__)
case __NR_getrlimit: case __NR_getrlimit:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment