aboutsummaryrefslogtreecommitdiffstats
path: root/community/chromium/musl-fix-getrlimit-failed.patch
blob: 08692abf16ec0501edf8b2a49f361eba81927541 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Date: Wed, 18 Jan 2017 09:51:29 -0600
From: Samuel Holland <samuel@...lland.org>
Subject: Re: getrlimit failed (chromium on musl)

> Running chromium on a musl system spams this message:
>
>  getrlimit(RLIMIT_NOFILE) failed

The problem is that the sandbox blocks prlimit64 with EPERM, but musl
only falls back to getrlimit on ENOSYS. The diff below will fix the
error. From the linked bug, the only reason it is blocked in the first
place is ChromeOS, and this change should be fine even there.

--- content/common/sandbox_linux/bpf_renderer_policy_linux.cc.orig
+++ content/common/sandbox_linux/bpf_renderer_policy_linux.cc
@@ -88,7 +88,7 @@
     case __NR_sched_setscheduler:
       return sandbox::RestrictSchedTarget(GetPolicyPid(), sysno);
     case __NR_prlimit64:
-      return Error(EPERM);  // See crbug.com/160157.
+      return Error(ENOSYS);  // See crbug.com/160157.
     default:
       // Default on the content baseline policy.
       return SandboxBPFBasePolicy::EvaluateSyscall(sysno);