mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1068410 - Convert remote crash dump to use pipe instead of socketpair in the child. r=kang r=ted
This commit is contained in:
parent
17583b3f2c
commit
7cf6aed7d3
@ -222,6 +222,7 @@ SandboxFilterImplContent::Build() {
|
|||||||
Allow(SYSCALL(sched_getparam));
|
Allow(SYSCALL(sched_getparam));
|
||||||
Allow(SYSCALL(sched_setparam));
|
Allow(SYSCALL(sched_setparam));
|
||||||
Allow(SYSCALL(sigaltstack));
|
Allow(SYSCALL(sigaltstack));
|
||||||
|
Allow(SYSCALL(pipe));
|
||||||
|
|
||||||
/* Always last and always OK calls */
|
/* Always last and always OK calls */
|
||||||
/* Architecture-specific very infrequently used syscalls */
|
/* Architecture-specific very infrequently used syscalls */
|
||||||
@ -263,7 +264,6 @@ SandboxFilterImplContent::Build() {
|
|||||||
Allow(SYSCALL(readahead));
|
Allow(SYSCALL(readahead));
|
||||||
Allow(SYSCALL(pread64));
|
Allow(SYSCALL(pread64));
|
||||||
Allow(SYSCALL(statfs));
|
Allow(SYSCALL(statfs));
|
||||||
Allow(SYSCALL(pipe));
|
|
||||||
#if SYSCALL_EXISTS(ugetrlimit)
|
#if SYSCALL_EXISTS(ugetrlimit)
|
||||||
Allow(SYSCALL(ugetrlimit));
|
Allow(SYSCALL(ugetrlimit));
|
||||||
#else
|
#else
|
||||||
@ -413,7 +413,7 @@ void SandboxFilterImplGMP::Build() {
|
|||||||
Allow(SYSCALL(sigaction));
|
Allow(SYSCALL(sigaction));
|
||||||
#endif
|
#endif
|
||||||
Allow(SYSCALL(rt_sigaction));
|
Allow(SYSCALL(rt_sigaction));
|
||||||
Allow(SOCKETCALL(socketpair, SOCKETPAIR));
|
Allow(SYSCALL(pipe));
|
||||||
Allow(SYSCALL_WITH_ARG(tgkill, 0, uint32_t(getpid())));
|
Allow(SYSCALL_WITH_ARG(tgkill, 0, uint32_t(getpid())));
|
||||||
Allow(SYSCALL_WITH_ARG(prctl, 0, PR_SET_DUMPABLE));
|
Allow(SYSCALL_WITH_ARG(prctl, 0, PR_SET_DUMPABLE));
|
||||||
|
|
||||||
|
@ -0,0 +1,40 @@
|
|||||||
|
commit 634161872e2dcddcea95784651a985e8ebe3e937
|
||||||
|
Author: Jed Davis <jld@mozilla.com>
|
||||||
|
Date: Wed Sep 17 11:35:34 2014 -0700
|
||||||
|
|
||||||
|
Bug 1068410 - Convert remote crash dump to use pipe instead of socketpair in the child.
|
||||||
|
|
||||||
|
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_client.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_client.cc
|
||||||
|
index 6ede779..df069e4 100644
|
||||||
|
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_client.cc
|
||||||
|
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_client.cc
|
||||||
|
@@ -45,7 +45,8 @@ bool
|
||||||
|
CrashGenerationClient::RequestDump(const void* blob, size_t blob_size)
|
||||||
|
{
|
||||||
|
int fds[2];
|
||||||
|
- sys_socketpair(AF_UNIX, SOCK_STREAM, 0, fds);
|
||||||
|
+ if (sys_pipe(fds) != 0)
|
||||||
|
+ return false;
|
||||||
|
static const unsigned kControlMsgSize = CMSG_SPACE(sizeof(int));
|
||||||
|
|
||||||
|
struct kernel_msghdr msg;
|
||||||
|
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_server.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_server.cc
|
||||||
|
index 420e4b2..721078c 100644
|
||||||
|
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_server.cc
|
||||||
|
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_server.cc
|
||||||
|
@@ -275,14 +275,7 @@ CrashGenerationServer::ClientEvent(short revents)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send the done signal to the process: it can exit now.
|
||||||
|
- memset(&msg, 0, sizeof(msg));
|
||||||
|
- struct iovec done_iov;
|
||||||
|
- done_iov.iov_base = const_cast<char*>("\x42");
|
||||||
|
- done_iov.iov_len = 1;
|
||||||
|
- msg.msg_iov = &done_iov;
|
||||||
|
- msg.msg_iovlen = 1;
|
||||||
|
-
|
||||||
|
- HANDLE_EINTR(sendmsg(signal_fd, &msg, MSG_DONTWAIT | MSG_NOSIGNAL));
|
||||||
|
+ // (Closing this will make the child's sys_read unblock and return 0.)
|
||||||
|
HANDLE_EINTR(close(signal_fd));
|
||||||
|
|
||||||
|
return true;
|
@ -45,7 +45,8 @@ bool
|
|||||||
CrashGenerationClient::RequestDump(const void* blob, size_t blob_size)
|
CrashGenerationClient::RequestDump(const void* blob, size_t blob_size)
|
||||||
{
|
{
|
||||||
int fds[2];
|
int fds[2];
|
||||||
sys_socketpair(AF_UNIX, SOCK_STREAM, 0, fds);
|
if (sys_pipe(fds) != 0)
|
||||||
|
return false;
|
||||||
static const unsigned kControlMsgSize = CMSG_SPACE(sizeof(int));
|
static const unsigned kControlMsgSize = CMSG_SPACE(sizeof(int));
|
||||||
|
|
||||||
struct kernel_msghdr msg;
|
struct kernel_msghdr msg;
|
||||||
|
@ -275,14 +275,7 @@ CrashGenerationServer::ClientEvent(short revents)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send the done signal to the process: it can exit now.
|
// Send the done signal to the process: it can exit now.
|
||||||
memset(&msg, 0, sizeof(msg));
|
// (Closing this will make the child's sys_read unblock and return 0.)
|
||||||
struct iovec done_iov;
|
|
||||||
done_iov.iov_base = const_cast<char*>("\x42");
|
|
||||||
done_iov.iov_len = 1;
|
|
||||||
msg.msg_iov = &done_iov;
|
|
||||||
msg.msg_iovlen = 1;
|
|
||||||
|
|
||||||
HANDLE_EINTR(sendmsg(signal_fd, &msg, MSG_DONTWAIT | MSG_NOSIGNAL));
|
|
||||||
HANDLE_EINTR(close(signal_fd));
|
HANDLE_EINTR(close(signal_fd));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user