0004-chromium-create-wakeup-pipe-with-O_CLOEXEC.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From af4993f6ad442816be12ad609544ac56e2ed4cee Mon Sep 17 00:00:00 2001
  2. From: Vincent Lang <vincent@plexapp.com>
  3. Date: Mon, 12 Oct 2015 19:24:54 +0200
  4. Subject: [PATCH] chromium: create wakeup pipe with O_CLOEXEC
  5. Since the sandbox thread is terminated by closing the pipe, forked
  6. processes could keep the pipe alive for a longer time than intended,
  7. and freeze RenderSandboxHostLinux::~RenderSandboxHostLinux().
  8. This is all Linux-specific code, so use the glibc-specific pipe2()
  9. function.
  10. ---
  11. .../content/browser/renderer_host/render_sandbox_host_linux.cc | 4 +++-
  12. 1 file changed, 3 insertions(+), 1 deletion(-)
  13. diff --git a/src/3rdparty/chromium/content/browser/renderer_host/render_sandbox_host_linux.cc b/src/3rdparty/chromium/content/browser/renderer_host/render_sandbox_host_linux.cc
  14. index 5b26054..c7b3cdd 100644
  15. --- a/src/3rdparty/chromium/content/browser/renderer_host/render_sandbox_host_linux.cc
  16. +++ b/src/3rdparty/chromium/content/browser/renderer_host/render_sandbox_host_linux.cc
  17. @@ -5,6 +5,8 @@
  18. #include "content/browser/renderer_host/render_sandbox_host_linux.h"
  19. #include <sys/socket.h>
  20. +#include <fcntl.h>
  21. +#include <unistd.h>
  22. #include "base/memory/singleton.h"
  23. #include "base/posix/eintr_wrapper.h"
  24. @@ -45,7 +47,7 @@ void RenderSandboxHostLinux::Init() {
  25. PCHECK(0 == shutdown(browser_socket, SHUT_WR)) << "shutdown";
  26. int pipefds[2];
  27. - CHECK(0 == pipe(pipefds));
  28. + CHECK(0 == pipe2(pipefds, O_CLOEXEC));
  29. const int child_lifeline_fd = pipefds[0];
  30. childs_lifeline_fd_ = pipefds[1];
  31. --
  32. 2.5.1