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

Issue 1077143002: Introduce sys_sigprocmask and sys_sigaction. (Closed)

Created:
5 years, 8 months ago by hidehiko
Modified:
5 years, 8 months ago
Reviewers:
mdempsky
CC:
chromium-reviews, rickyz+watch_chromium.org, jln+watch_chromium.org, jln (very slow on Chromium), Mark Seaborn, hamaji, mazda
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Introduce sys_sigprocmask and sys_sigaction. This is preparation of nacl_helper_nonsfi's secompbpf sandbox implementation. PNaCl toolchain's signal ABI is incompatible with Linux's. For example, the length of sigset_t is shoter than Linux's. (Android has also same problem). siginfo_t has different memory layout. Some signal numbers, including SIGBUS, SIGCHLD and SIGSYS, or some signal flags are different. This CL fills the gap, by introducing linux_signal.h and two syscalls, sys_sigprocmask and sys_sigaction. Also, as signal.h provides ucontext_t, but PNaCl toolchain does not provides ucontext_t, this CL re-use the android_ucontext.h (by renaming it to linux_ucontext.h). TEST=Ran bots. BUG=358465 CQ_EXTRA_TRYBOTS=tryserver.chromium.linux:linux_chromium_trusty32_rel,linux_arm Committed: https://crrev.com/3a315e3246a5191cee27216c09e669ea2d6c33d3 Cr-Commit-Position: refs/heads/master@{#325634}

Patch Set 1 : #

Total comments: 18

Patch Set 2 : Rebase #

Patch Set 3 : #

Patch Set 4 : Rebase #

Patch Set 5 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+319 lines, -359 lines) Patch
M sandbox/linux/BUILD.gn View 1 1 chunk +5 lines, -4 lines 0 comments Download
M sandbox/linux/sandbox_linux.gypi View 1 1 chunk +5 lines, -5 lines 0 comments Download
M sandbox/linux/seccomp-bpf/die.cc View 1 2 3 4 2 chunks +6 lines, -1 line 0 comments Download
M sandbox/linux/seccomp-bpf/syscall.h View 1 chunk +1 line, -5 lines 0 comments Download
M sandbox/linux/seccomp-bpf/trap.h View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M sandbox/linux/seccomp-bpf/trap.cc View 1 2 7 chunks +17 lines, -17 lines 0 comments Download
M sandbox/linux/services/credentials.cc View 1 2 2 chunks +3 lines, -7 lines 0 comments Download
M sandbox/linux/services/syscall_wrappers.h View 1 2 2 chunks +12 lines, -0 lines 0 comments Download
M sandbox/linux/services/syscall_wrappers.cc View 1 2 2 chunks +61 lines, -0 lines 0 comments Download
M sandbox/linux/services/syscall_wrappers_unittest.cc View 1 2 2 chunks +14 lines, -0 lines 0 comments Download
D sandbox/linux/system_headers/android_arm64_ucontext.h View 1 chunk +0 lines, -29 lines 0 comments Download
D sandbox/linux/system_headers/android_arm_ucontext.h View 1 chunk +0 lines, -32 lines 0 comments Download
D sandbox/linux/system_headers/android_i386_ucontext.h View 1 chunk +0 lines, -79 lines 0 comments Download
D sandbox/linux/system_headers/android_mips_ucontext.h View 1 chunk +0 lines, -51 lines 0 comments Download
D sandbox/linux/system_headers/android_ucontext.h View 1 chunk +0 lines, -28 lines 0 comments Download
D sandbox/linux/system_headers/android_x86_64_ucontext.h View 1 chunk +0 lines, -88 lines 0 comments Download
A + sandbox/linux/system_headers/arm64_linux_ucontext.h View 2 chunks +3 lines, -3 lines 0 comments Download
A sandbox/linux/system_headers/arm_linux_ucontext.h View 1 2 1 chunk +67 lines, -0 lines 0 comments Download
A + sandbox/linux/system_headers/i386_linux_ucontext.h View 1 2 2 chunks +15 lines, -1 line 0 comments Download
A sandbox/linux/system_headers/linux_signal.h View 1 2 1 chunk +73 lines, -0 lines 0 comments Download
A sandbox/linux/system_headers/linux_ucontext.h View 1 chunk +28 lines, -0 lines 0 comments Download
A + sandbox/linux/system_headers/mips_linux_ucontext.h View 2 chunks +3 lines, -3 lines 0 comments Download
A + sandbox/linux/system_headers/x86_64_linux_ucontext.h View 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 25 (9 generated)
hidehiko
Could you take a look? - hidehiko
5 years, 8 months ago (2015-04-10 18:26:40 UTC) #2
mdempsky
First pass of feedback. https://codereview.chromium.org/1077143002/diff/40001/sandbox/linux/seccomp-bpf/die.cc File sandbox/linux/seccomp-bpf/die.cc (right): https://codereview.chromium.org/1077143002/diff/40001/sandbox/linux/seccomp-bpf/die.cc#newcode40 sandbox/linux/seccomp-bpf/die.cc:40: sigaddset(&sa.sa_mask, LINUX_SIGSEGV); With POSIX sigaction(), ...
5 years, 8 months ago (2015-04-13 18:55:07 UTC) #5
hidehiko
Thank you for review! PTAL. - hidehiko https://codereview.chromium.org/1077143002/diff/40001/sandbox/linux/seccomp-bpf/die.cc File sandbox/linux/seccomp-bpf/die.cc (right): https://codereview.chromium.org/1077143002/diff/40001/sandbox/linux/seccomp-bpf/die.cc#newcode40 sandbox/linux/seccomp-bpf/die.cc:40: sigaddset(&sa.sa_mask, LINUX_SIGSEGV); ...
5 years, 8 months ago (2015-04-14 11:56:41 UTC) #8
hidehiko
On 2015/04/14 11:56:41, hidehiko wrote: > Thank you for review! > PTAL. > - hidehiko ...
5 years, 8 months ago (2015-04-16 00:44:27 UTC) #9
mdempsky
LGTM Sorry for the delay! https://codereview.chromium.org/1077143002/diff/40001/sandbox/linux/seccomp-bpf/die.cc File sandbox/linux/seccomp-bpf/die.cc (right): https://codereview.chromium.org/1077143002/diff/40001/sandbox/linux/seccomp-bpf/die.cc#newcode40 sandbox/linux/seccomp-bpf/die.cc:40: sigaddset(&sa.sa_mask, LINUX_SIGSEGV); On 2015/04/14 ...
5 years, 8 months ago (2015-04-17 04:36:22 UTC) #10
hidehiko
Thank you for review! Submitting. https://codereview.chromium.org/1077143002/diff/40001/sandbox/linux/seccomp-bpf/die.cc File sandbox/linux/seccomp-bpf/die.cc (right): https://codereview.chromium.org/1077143002/diff/40001/sandbox/linux/seccomp-bpf/die.cc#newcode40 sandbox/linux/seccomp-bpf/die.cc:40: sigaddset(&sa.sa_mask, LINUX_SIGSEGV); On 2015/04/17 ...
5 years, 8 months ago (2015-04-17 06:18:41 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1077143002/160001
5 years, 8 months ago (2015-04-17 06:19:07 UTC) #14
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/49292)
5 years, 8 months ago (2015-04-17 08:47:34 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1077143002/160001
5 years, 8 months ago (2015-04-17 13:47:42 UTC) #18
commit-bot: I haz the power
Committed patchset #5 (id:160001)
5 years, 8 months ago (2015-04-17 14:59:41 UTC) #19
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/3a315e3246a5191cee27216c09e669ea2d6c33d3 Cr-Commit-Position: refs/heads/master@{#325634}
5 years, 8 months ago (2015-04-17 15:00:34 UTC) #20
johnme
A revert of this CL (patchset #5 id:160001) has been created in https://codereview.chromium.org/1093843002/ by johnme@chromium.org. ...
5 years, 8 months ago (2015-04-17 16:02:31 UTC) #21
mdempsky
On 2015/04/17 16:02:31, johnme wrote: > ==22726== WARNING: MemorySanitizer: use-of-uninitialized-value > #0 0x7fb677cf3d50 in sandbox::Trap::SigSys(int, ...
5 years, 8 months ago (2015-04-17 16:38:18 UTC) #22
Mark Seaborn
On 17 April 2015 at 06:38, <mdempsky@chromium.org> wrote: > On 2015/04/17 16:02:31, johnme wrote: > ...
5 years, 8 months ago (2015-04-17 22:21:34 UTC) #23
mdempsky
On Fri, Apr 17, 2015 at 3:21 PM, Mark Seaborn <mseaborn@chromium.org> wrote: > I think ...
5 years, 8 months ago (2015-04-17 22:24:51 UTC) #24
hidehiko
5 years, 8 months ago (2015-04-20 10:53:55 UTC) #25
Message was sent while issue was closed.
On 2015/04/17 22:24:51, mdempsky wrote:
> On Fri, Apr 17, 2015 at 3:21 PM, Mark Seaborn <mailto:mseaborn@chromium.org>
wrote:
> 
> > I think normally MSan wraps various libc syscall wrappers, such as
> > sigaction(), to annotate that the kernel is initialising memory.  If we
> > call syscalls directly, I suppose we have to supply those annotations
> > ourselves. :-/
> >
> 
> That's what I suspect too. :(
> 
> To unsubscribe from this group and stop receiving emails from it, send an
email
> to mailto:chromium-reviews+unsubscribe@chromium.org.

Hmm, this is unfortunate...

BTW, is there a way to run the test locally?
I've tried to run ./third_party/WebKit/Tools/Scripts/run-webkit-tests
--enable-sanitizer with the binary built with msan=1. However, the error is not
reported on my local env.

Powered by Google App Engine
This is Rietveld 408576698