Commit 3702d386 authored by evliu's avatar evliu Committed by Commit Bot

Whitelist getdents() for the speech recognition Linux sandbox

The Speech team recently made a change to the Speech On-Device API to
take in a path to the language pack directory rather than a path to the
dictation.ascii_proto config file. The getdents() syscall is required
for SODA to select the appropriate config file to use.

Bug: 1124367
Change-Id: I9265d7f178d85bb9cb0fea8175878d4db6f26dfe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2390879Reviewed-by: default avatarMatthew Denton <mpdenton@chromium.org>
Commit-Queue: Evan Liu <evliu@google.com>
Cr-Commit-Position: refs/heads/master@{#803973}
parent 9b670b9c
......@@ -23,6 +23,16 @@ SpeechRecognitionProcessPolicy::~SpeechRecognitionProcessPolicy() = default;
ResultExpr SpeechRecognitionProcessPolicy::EvaluateSyscall(
int system_call_number) const {
switch (system_call_number) {
// Required by the Speech On-Device API (SODA) binary to find the
// appropriate configuration file to use within a language pack directory.
#if defined(__NR_getdents64)
case __NR_getdents64:
return Allow();
#endif
#if defined(__NR_getdents)
case __NR_getdents:
return Allow();
#endif
default:
auto* broker_process = SandboxLinux::GetInstance()->broker_process();
if (broker_process->IsSyscallAllowed(system_call_number))
......
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