Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Issue 12638015: Android sandbox: workaround for restricted errno values. (Closed)

Created:
7 years, 9 months ago by jln (very slow on Chromium)
Modified:
7 years, 9 months ago
Reviewers:
Markus (顧孟勤)
CC:
chromium-reviews, agl, jln+watch_chromium.org
Visibility:
Public.

Description

Android sandbox: workaround for restricted errno values. On Android, errno are only supported up to 255 and are not processed otherwise. Fix a test to work around this issue. BUG=181647, 169416 NOTRY=true TBR=markus Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=187410

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -3 lines) Patch
M sandbox/linux/seccomp-bpf/errorcode.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc View 1 2 6 chunks +35 lines, -3 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
commit-bot: I haz the power
No comments yet.
7 years, 9 months ago (2013-03-11 23:21:07 UTC) #1
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jln@chromium.org/12638015/16001
7 years, 9 months ago (2013-03-11 23:24:16 UTC) #2
commit-bot: I haz the power
Change committed as 187410
7 years, 9 months ago (2013-03-11 23:39:22 UTC) #3
Markus (顧孟勤)
We should check whether we can make a direct SandboxSyscall() instead of going through the ...
7 years, 9 months ago (2013-03-12 00:23:05 UTC) #4
jln (very slow on Chromium)
7 years, 9 months ago (2013-03-12 00:30:57 UTC) #5
Message was sent while issue was closed.
On 2013/03/12 00:23:05, Markus (顧孟勤) wrote:
> We should check whether we can make a direct SandboxSyscall() instead of going
> through the bionic libc wrapper.
> 
> That might be a cleaner fix.

It really depends on the intention of the test. To me the intention was: "Any
errno between the min and max value that is returned by the kernel to userland
will appear automatically in errno to userland". Indeed, we're also testing the
libc in that case, which is important and useful.

In other words: we caught an interesting bug that needs to be fixed (most likely
on Android itself, or perhaps in ErrorCode, as a workaround).

> Do we have any indication that Android patched the kernel to reduce the
maximum
> errno value? If not, then it probably is still 4096; it's just the runtime
> library that doesn't know this.

Let's discuss this on the bug (crbug.com/181647). I already asked David if we
could get this fixed in Android at some point.

> And if in doubt, I rather do what is correct for the kernel than what is
correct
> for a user-space layer on top of that. Following the kernel's conventions is
> less likely to introduce security relevant bugs.

In general yes. In this case, I don't think that further restricting it would be
bad for security.

Powered by Google App Engine
This is Rietveld 408576698